Prev: Why warnings about unused keyword although (call-next-method)is used?
Next: Why warnings about unused keyword although (call-next-method) is used?
From: Albert van der Horst on 14 Jun 2010 06:57 In article <e1aa09cd-3bcd-4e9b-8f4c-e307a14246fe(a)a2g2000prd.googlegroups.com>, bolega <gnuist006(a)gmail.com> wrote: >I am trying to compare LISP/Scheme/Python for their expressiveness. > >For this, I propose a vanilla C interpreter. I have seen a book which >writes C interpreter in C. > >The criteria would be the small size and high readability of the code. > >Are there already answers anywhere ? > >How would a gury approach such a project ? He would have his 10 year LISP sink in, meditate for 10 days and start from scratch with a typical LISP approach. He would have his 10 year Algol68 sink in, meditate for 10 days and start from scratch with a typical Algol68 approach. (Scheme is not different enough from LISP, to make this interesting. Hey Scheme *is* a dialect of LISP.) He would have his 10 year Python sink in, meditate for 10 days and start from scratch with a typical Python approach. Maybe he would code "one to throw away". The outcome would be extremely interesting, but ... > >Bolega Groetjes Albert -- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert(a)spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
From: fortunatus on 14 Jun 2010 09:25 On Jun 13, 7:07 pm, bolega <gnuist...(a)gmail.com> wrote: > I am trying to compare LISP/Scheme/Python for their expressiveness. > > For this, I propose a vanilla C interpreter. I have seen a book which > writes C interpreter in C. > > The criteria would be the small size and high readability of the code. > > Are there already answers anywhere ? > > How would a gury approach such a project ? > > Bolega Holy cow has this gone off topic! To OP - start writing a C context free grammar of a subset of C (arithmetic expressions IMHO are the historical root of C and a good place to start in any case), start writing a parser of a subset of your subset grammar (in a lisp of your chioce - Scheme and CL for instance are going to be pretty much equivalent in this task), and really the rest will be obvious... I'd go that far before posting on the topic again...
From: Tim Rentsch on 19 Jun 2010 21:48 nanothermite911fbibustards <nanothermite911fbibustards(a)gmail.com> writes: >> Probably doesn't meet your intent, but this is a really impressive bit >> of (whacky) art: > > Lisp runs faster than C. Once you get more time away from screwing > Palestinians, and other false-flags, you will find ideas like these > > How to make Lisp go faster than C > Didier Verna > [snip] Asking whether Lisp is faster than C is like asking why it's colder in the mountains than it is in the summer.
From: Define Macro on 20 Jun 2010 21:04 On Jun 13, 7:07 pm, bolega <gnuist...(a)gmail.com> wrote: > I am trying to compare LISP/Scheme/Python for their expressiveness. > > For this, I propose a vanilla C interpreter. I have seen a book which > writes C interpreter in C. > > The criteria would be the small size and high readability of the code. > > Are there already answers anywhere ? > > How would a gury approach such a project ? > > Bolega Maybe instead of full C, you should try something simplified, like Tiny-C (http://primepuzzle.com/tc/) or Arena, or maybe even Pike (some minimal variant thereof).
From: Richard Fateman on 21 Jun 2010 00:31
Define Macro wrote: > On Jun 13, 7:07 pm, bolega <gnuist...(a)gmail.com> wrote: >> I am trying to compare LISP/Scheme/Python for their expressiveness. >> >> For this, I propose a vanilla C interpreter. I have seen a book which >> writes C interpreter in C. >> >> The criteria would be the small size and high readability of the code. >> >> Are there already answers anywhere ? Sure. Lots of texts on compilers provide exercises which, in one way or another suggest how to write an interpreter and perhaps a compiler too for some language. Anyone taking a course on compilers is likely to have followed such exercises in order to pass the course. Some instructors are enlightened enough to allow students to pick the implementation language. Ask any such instructor. I think you will find that many people use a packaged parser-generator which eliminates much of the choice-of-language difference. Do you like Bison, Yacc, Antlr, or one of the many parser generators in Lisp, python, etc. My own experience is that in comparing Lisp to C, students end up with smaller and better interpreters and compilers, faster. I don't know about python vs C for sure, but I suspect python wins. As for python vs Lisp, I don't know. RJF |