Re: Eu to C translator questions.

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

Mark Brown writes:
> How can the Euphoria specific parts of the language (and I'm
> thinking here of the "dynamic" parts of Euphoria, atoms,
> sequences etc) be translated to C code without giving the
> whole game away? Or am right in thinking that an interpreted
> / run time core will still exist somewhere along the line.
> I can't see how the specific Euphoria types can be handled in
> C without the code that handles it either being visible to us
> or hidden in some sort of run time form.

The compiler generates a .c file for each Euphoria file in
your program, i.e. a .c for the main file, and a .c file for each
included file. Creating one huge .c would risk blowing the
size limits on some C compilers.

Your .c's are compiled into .obj's (machine code)
and linked with other .obj's supplied by RDS.
The RDS .obj's contain run-time routines
for things like repeat(), append(), dir() etc. Things which take
too much code to be done in-line.

The scanner, parser, and these runtime routines are shared
between the interpreter and the compiler (although some run-time
routines for the compiler have checking eliminated for
greater speed.)

It's true that by examining the generated C code, people
will learn a lot. They won't be able to examine the run-time
routines because I don't plan to give away the source
to the run-time routines.

Just because people get a few tips on how to implement
Euphoria in C, I don't think that means that a lot of Euphoria
clones are going to suddenly appear, putting RDS out of business.
I don't think there are many people out there with the motivation,
the time, and the stamina to do a really good job of it.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu