|machine code vs. byte codes firstname.lastname@example.org (Mark) (1999-03-28)|
|Re: machine code vs. byte codes email@example.com (1999-04-01)|
|Re: machine code vs. byte codes firstname.lastname@example.org (Steven D. Majewski) (1999-04-03)|
|Date:||28 Mar 1999 17:08:19 -0500|
|Organization:||USA Best Net|
|Keywords:||interpreter, performance, practice, question|
I'm working a compiler that compiles a very simple C-like language.
For the most part the source code will be compiled to byte codes and
interpreted, however certain parts can be compiled to machine code.
Performance is pretty critical in the app I'm working on and I was
wondering, would there be a significant advantage to using the machine
code? The code sections are fairly small and are basically just logic
operations, and math expressions. The one concern I have about using
machine code, is that I would have to port the compiler for each style
of CPU. If there isn't a huge performance benefit I'd rather use byte
[If each byte code does a lot of work, e.g., invert a matrix, the
overhead of interpreting is relatively low. If the byte codes are
simple, e.g., push a character onto the stack, the overhead is
horrible. If you don't want to write a code generator for each
architecture, the usual approach is to have your compiler translate
your language to C, then compile the C code. -John]
Return to the
Search the comp.compilers archives again.