Re: some questions...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Maurizio asked:
>>1) For Robert Craig, this is for my curiousity: did you ever think to
>> write euphoria in euphoria itself ?

Ralf replied:
> That's impossible, Euphoria doesn't provide such
> low level mechanism. It could interpreter euphoria
> code, but it would be calling the identical routines.

It would certainly be possible to write a Euphoria interpreter
in Euphoria. In fact, it would be much easier than writing one in C.
The only problem is that it would run slower than one
written in C, and it would need a Euphoria interpreter (or
compiler) before it could run, so it would be redundant
(unless you added new language features to it).

As a mind-expanding exercise one might consider
the following:

Suppose we had a complete Euphoria interpreter written in
Euphoria. Call it ex.ex. You could run it with: ex.exe ex.ex.
You could use it to run *any* Euphoria program. You might
try running (say) lw.ex (language war).  But wait a minute -
ex.ex is itself a Euphoria program. Therefore it should be able
to *run itself*.

We could run it on itself and ask it to run lw.ex
(language war).

This idea can be taken to any number of levels.
We could run ex.ex on itself as it runs itself as it runs itself
as it runs itself ... as it runs itself as it runs lw.ex .

The speed of execution of lw.ex would of course drop with each
level of interpreter that we introduced, but it should run correctly
no matter how many levels were involved. (and then consider
running them all in trace mode!)

Regards,
     Rob Craig
     Rapid Deployment Software

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu