Re: Jiri and his 'Hints'
Tony Bucholtz writes:
> ... if what we really want is easier access to C code, libraries,
> etc, why not create a C to Eu translator and move the
> mainstream towards Euphoria?
It would be nice if someone wrote such a thing, but
I don't think it's likely to happen. C is a much larger language
than Euphoria, and is not as easy to parse. C is heavily
dependent on pointers, structures, and mapping everything
to bytes in memory, things which aren't really supported in Euphoria.
C's GOTO would be especially painful to translate.
C is "word-at-a-time", so the resulting Euphoria code
would also be word-at-a-time. You'd rarely be able to
use Euphoria's operations on entire sequences.
> ... would it be possible to write a sort of "half way"
> compiler for Eu?
> What I'm thinking of is something that translates Eucode into a
> tokenized version ...
Sure, it could be done, but it's not such a good idea:
* There's no speed advantage, except at start-up time.
* On a Pentium, the time spent compiling, before a
program starts running, is just a fraction of a second,
even for large programs.
* Who needs the extra clutter on their disk and in their mind,
that would come from having source files *and* a tokenized
file for each program? Hmmm... did I remember to recompile
after that last change?...
* With each new release of Euphoria, I'd be under
pressure to not only make it upwardly-compatible at the
source level, but also at the tokenized level. People would
expect their tokenized files to run, without recompiling,
especially users of the program who don't have the source.
This would prevent me from making certain improvements,
or deleting obsolete stuff.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com
|
Not Categorized, Please Help
|
|