Re: Contemplating writing first compiler... comments please.

Herbert M Sauro <HSauro@fssc.demon.co.uk>
22 Jul 1997 20:55:40 -0400

          From comp.compilers

Related articles
Contemplating writing first compiler... comments please. mch24@harvey27.demon.co.uk (1997-06-30)
Re: Contemplating writing first compiler... comments please. gelleric@kafka.informatik.uni-stuttgart.de (1997-07-04)
Re: Contemplating writing first compiler... comments please. cdw10@cix.compulink.co.uk (1997-07-08)
Re: Contemplating writing first compiler... comments please. mrm1@msm.cam.ac.uk (1997-07-21)
Re: Contemplating writing first compiler... comments please. HSauro@fssc.demon.co.uk (Herbert M Sauro) (1997-07-22)
Re: Contemplating writing first compiler... comments please. pardo@cs.washington.edu (1997-07-29)
Re: Contemplating writing first compiler... comments please. anton@mips.complang.tuwien.ac.at (1997-08-09)
| List of all articles for this month |
From: Herbert M Sauro <HSauro@fssc.demon.co.uk>
Newsgroups: comp.compilers
Date: 22 Jul 1997 20:55:40 -0400
Organization: Future Skill Software
References: 97-06-113 97-07-032 97-07-101
Keywords: practice, comment

Mark Manning <mrm1@msm.cam.ac.uk> writes
>Our moderator wrote:
> [Another possibility is to generate byte codes and then write a little
> interpreter to runs them. Worked for UCSD Pascal, works for Java. -John]
>
>...and it works for me! An important factor for a hobby project
>(and compilers are my hobby, I *manage* computers for a living) is to get
>*something* working before you completely lose heart. Having an interpreter
>means that you split one large project into two smaller ones, and porting
>from one system to another becomes much easier. (This is also important if
>the project becomes a long one because you can only work on it spasmodically.)


This is likely to be a newbie question for most of the contributors here
but....


What's the best way to implement the executation of a chunk of code,
like byte codes? I've seen a number of approaches, ranging from a big
case statement (suitably optimised by compiler into a jump table), the
codes are actually pointers to interpreter functions, to a big if then
else chunk of code (the most inefficient). Does any body have any
recommentations for fast executation of interpreted code with out
resorting to a just in time compiler?


I'm not a comp sci student so I won't have been exposed to the latest
and the best.


Thanks
Herbert Sauro
--
Herbert M Sauro
email: HSauro@fssc.demon.co.uk
Telephone: 01974 282428
[A big case statement isn't bad, or you can try threaded code which was
discussed at some length in about 1990. Knuth in his brand new third
edition of Volume I has an overview of interpreters that's worth a look. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.