From: Richard Bos on
Tim Rentsch <txr(a)alumni.caltech.edu> wrote:

> nanothermite911fbibustards <nanothermite911fbibustards(a)gmail.com>
>
> > How to make Lisp go faster than C
> > Didier Verna
>
> Asking whether Lisp is faster than C is like asking why it's
> colder in the mountains than it is in the summer.

YM warmer.

HTH; HAND.

Richard
From: Michele Simionato on
On Jun 14, 1:07 am, 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

This look like a huge project for an evaluation of expressiveness
which result is obvious. Lisp (including Scheme) is more expressive
than Python, for many definitions of expressiveness (see for instance
http://www.ccs.neu.edu/scheme/pubs/scp91-felleisen.ps.gz if you like
academic papers). However, who cares? What matters in everyday life
are other things, like the availability of libraries, tools, easy of
maintenance, etc.

In your proposed project the choice of the parsing library would
matter a lot. Writing languages is a domain where Lisp is
traditionally strong, so you may find good libraries to help you with
the task. My guess is that it would take more or less the same amount
of effort both in Python and in Lisp. The place where Lisp has an
advantage is writing an *embedded* language: then thanks to macros you
could write a *compiled* sublanguage. Doing the same in Python is
essentially impossible.

Michele Simionato
From: Rivka Miller on
On Jun 13, 4: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

You should probably narrow down your project to one. For example,
write a LISt Processor Meta Circular Evaluator in C.

You can take Paul Graham's rendition as a start and forget about
garbage collection.

Start with getchar()/putchar() for I/O.

Although C comes with a regex library, you probably do not need a
regex or parser at all for this. This is the beauty of LISP which is
why McCarthy was able to bypass the several man years of effort
involved in FORmula TRANslator. Even as a young boy like L. Peter
Deutsch was able to write it in assembly for one of the PDP's.

You will have go implement an associative array or a symbol-value
table probably as a stack or linked list. You will have to decide how
you implement the trees, as cons cells or some other method. Dynamic
scoping is easy to implement and that is what elisp has. I am not
aware of any book that provides implementation of LISP in C and
explains it at the same time.

This is the extent of help I can provide, someone else can probably
help you more.

Anyone know what the first initial of L. Peter Deutsch stand for ?

Rivka

From: wolfgang.riedel on
On 20 June, 03:48, Tim Rentsch <t...(a)alumni.caltech.edu> wrote:
> nanothermite911fbibustards <nanothermite911fbibusta...(a)gmail.com>
> writes:
>

> Asking whether Lisp is faster than C is like asking why it's
> colder in the mountains than it is in the summer.

original Karl Valentin would be <colder outside than nighttime>
but yours is in his sense.

Wolfgang
From: Nick Keighley on
On 7 July, 17:38, Rivka Miller <rivkaumil...(a)gmail.com> wrote:

> Although C comes with a regex library,

C does not come with a regexp library


> Anyone know what the first initial of L. Peter Deutsch stand for ?

Laurence according to wikipedia (search time 2s)