Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

is there any app can compile lisp program to machine code?

14 views
Skip to first unread message

attonie

unread,
Feb 24, 2002, 2:32:49 AM2/24/02
to
as i know, lisp is a interpretion language, thus the speed is slow, so
is there any program can compile lisp program to machine code ?

Dr. Edmund Weitz

unread,
Feb 24, 2002, 2:53:46 AM2/24/02
to
att...@etang.com (attonie) writes:

> as i know, lisp is a interpretion language, thus the speed is slow,
> so is there any program can compile lisp program to machine code ?

Where do you 'know' that from? Every Common Lisp implementation
nowadays has a compiler, most compile directly to machine code, some
to C or bytecode. There are even implementations which don't have an
'interpreter' at all (but nevertheless allow for interactive
development as if there were an interpreter).

Edi.

--

Dr. Edmund Weitz
Hamburg
Germany

The Common Lisp Cookbook
<http://cl-cookbook.sourceforge.net/>

Erik Naggum

unread,
Feb 24, 2002, 3:50:43 AM2/24/02
to
* att...@etang.com (attonie)

| as i know, lisp is a interpretion language, thus the speed is slow, so
| is there any program can compile lisp program to machine code?

You must be thinking of Scheme, a toy Lisp. Common Lisp, a real Lisp,
has always had compilers. Matter of fact, even in 1959, Lisp had a
compiler. It is just that the toy Lisps that are used in education and
other forms of confusion are implemented by people who want to prove some
academic point -- and these all use Scheme. There is significant merit
to learning about computers from a higher-level point of view than, say,
machine instructions and stuff, and Scheme offers a way to look at Lambda
calculus. More of this is visible with interpreted code than with
compiled machine language, so for purpose of study, Scheme is usually an
interpreted Lisp.

Lisp has, however, always provided an interactive programming environment
and many toolmakers in the history of computing have made interactive
environments using interpreted languages, because it is _so_ much easier
than writing compilers that work with interactive environments, but all
this means is that people who are not very smart never gave you the power
of an interactive environment combined with the speed of compiled machine
code. The people who make Common Lisp environments are much smarter than
those who stay with interpreted environments, so they provide you with
this particular combination as a matter of course.

Now, over the years, a lot of people who have been overexposed to Scheme
and to lazy or stupid people and their toy implementations of Scheme have
come to Common Lisp with the severely misguided notions that Lisp is
slow, Lisp is interpreted, Lisp is a memory hog, etc, all because they
have gathered all their experience about Lisp from incompetent or lazy
people. What you have actually seen is that even incompetent and lazy
people can make some useful Lisp environments that can be really nifty
compared to the compile-only environments of other toy languages. This
should be an important clue. It is, sadly, often missed completely.

It is like those LEGO robot kits for modern kids (of any age :), with
which you can do a lot of fascinating stuff with building blocks and a
computer -- but it is of course no match for industrial robots, and
anyone who went into an automated machine shop and thought he knew how
robots were made, would be laughed at and kicked out. The nature of the
"virtual reality" on the Net provides no clues to what most people need
visual information to get, namely that their assumptions are all wrong.
When you start an obvious falsehood with "as I know", it it very easy to
think you are one of those guys whose assumptions are set in stone and
for whom reality had better fit nicely with them, or else. So it is very
easy to laugh at you and kick you out because of this. However, it is up
to you whether you accept that what you have known up to now is wrong (or
applies only to a very small fragment of reality, not to be confused with
larger fragments or the whole thing) and are prepared to listen to people
who know a lot more about this than you do, or whether you will insist
that you had a right to believe what you did, which a lot of people will
not grant you, and be laughed and tried to be kicked out.

If you really want the toy Lisp, go ask in comp.lang.lisp.toy, probably
known at your newsserver as comp.lang.scheme. Some Scheme freaks also
offer compiled versions, whatever the point of that waste would be. As
you might infer, Scheme is the annoying little kid brother who always
tags along and ruins your day, and Scheme freaks have an annyoing habit
of trying to make it on their own, only to blame real Lisp when it fails.
I do not think you _really_ want the toy Lisp, do you? :)

Visit www.lisp.org and look for links to commercial vendors who offer
their excellent environments in trial versions or to free, but much
smaller environments that require a slightly more educated user to enjoy
from the start. Note that these are not "apps", but environments.

///
--
In a fight against something, the fight has value, victory has none.
In a fight for something, the fight is a loss, victory merely relief.

Tim Bradshaw

unread,
Feb 24, 2002, 8:11:07 AM2/24/02
to
* attonie wrote:
> as i know, lisp is a interpretion language, thus the speed is slow, so
> is there any program can compile lisp program to machine code ?

As far as I know there is one current common lisp (clisp) which
doesn't compile to native machine code but to a virtual `bytecode'
machine like Java. There is also a rather old system, originally
Kyoto Common Lisp, now GNU Common Lisp (gcl) which compiles to C (and
thence to native code). All the other implementations I know of
compile to native code. So your problem is rather the inverse of what
you think: to find a Common Lisp system which does not compile to
machine code. If you count bytecode as machine code, then I don't
think there are any such systems.

--tim

Kaz Kylheku

unread,
Feb 24, 2002, 2:15:43 PM2/24/02
to
In article <32235294...@naggum.net>, Erik Naggum wrote:
>* att...@etang.com (attonie)
>| as i know, lisp is a interpretion language, thus the speed is slow, so
>| is there any program can compile lisp program to machine code?
>
> You must be thinking of Scheme, a toy Lisp. Common Lisp, a real Lisp,
^^^^^^^^^^^^^^^^^^^^

Evidence? ;)

Erik Naggum

unread,
Feb 24, 2002, 3:20:52 PM2/24/02
to
* k...@accton.shaw.ca (Kaz Kylheku)
| Evidence? ;)

Explanation?

Frank A. Adrian

unread,
Feb 25, 2002, 1:14:35 AM2/25/02
to
attonie wrote:

> as i know, lisp is a interpretion language, thus the speed is slow, so
> is there any program can compile lisp program to machine code ?

As this is probably the most unartfully constructed troll I have seen in a
while, I will give an answer. ..

Since you KNOW that Lisp is an interpretation language, why would you even
suspect that a program to compile Lisp to machine code would (or even
could) exist? In fact, how do you KNOW that Lisp exists?

Seek within what you KNOW for what you DON'T KNOW, but BELIEVE. In there,
the answer shall lie.

faa

Alexander Schofield

unread,
Feb 25, 2002, 2:28:26 AM2/25/02
to
My what big teeth you have.
Give the guy a break, his English isn't so good, and I got the feeling
that he meant, 'as far as I know'. Lisp being interpreted only is a
pretty common misconception, even propogated by some textbooks talking
about only early Lisp. If he was a going to spread FUD, why do it in
the Lisp ng? Isn't it more likely he was seeking information? Perhaps
this is a good time to give useful information about CL, and end his
misconception instead of giving this ng a hostile atmosphere.

--
Alexander Schofield

Alexander Schofield

unread,
Feb 25, 2002, 2:41:56 AM2/25/02
to
http://www.bagley.org/~doug/shootout/craps.shtml
Look at what those benchmarks show, CMUCL scored just behind C, C++, and
a couple ML implementations (but ahead of other ML's). It should be
noted that these were algorithms designed to work with all languages, so
Lisp didn't get an adequate chance to show its muscle.

CL is /not/ a purely interpreted language, it is one of the few
languages with true dynamic compilation. That is much more impressive
than it is in other languages because of macros, which none of the ML's
have. Plus, type declarations are optional, in ML they are most
certainly not.

> > attonie wrote:
> >
> > > as i know, lisp is a interpretion language, thus the speed is slow, so
> > > is there any program can compile lisp program to machine code ?

--
Alexander Schofield

Tim Bradshaw

unread,
Feb 25, 2002, 3:27:35 AM2/25/02
to
* Frank A Adrian wrote:

> Since you KNOW that Lisp is an interpretation language, why would you even
> suspect that a program to compile Lisp to machine code would (or even
> could) exist? In fact, how do you KNOW that Lisp exists?

This isn't fair. `As I know' was fairly obviously `As far as I know'
and I'm fairly sure that this form of it is what some non-native
speakers produce - I know a Portuguese/Brazilian person who I think
produces this unless he's thinking hard.

Also, given that a lot of courses which `teach' (or mention) Lisp are
horribly inaccurate in just this way I think this person should be
given the benefit of the doubt - they may just have been mislead and
genuinely looking for enlightenment.

(Or they may be a troll, OK I admit it).

--tim

Marco Antoniotti

unread,
Feb 25, 2002, 10:39:43 AM2/25/02
to

Tim Bradshaw <t...@cley.com> writes:

> * attonie wrote:
> > as i know, lisp is a interpretion language, thus the speed is slow, so
> > is there any program can compile lisp program to machine code ?
>
> As far as I know there is one current common lisp (clisp) which
> doesn't compile to native machine code but to a virtual `bytecode'
> machine like Java. There is also a rather old system, originally
> Kyoto Common Lisp, now GNU Common Lisp (gcl) which compiles to C (and
> thence to native code).

Just to clarify. The latest and more supported Kyoto Common Lisp
derivative is ECL.

Cheers

--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488
719 Broadway 12th Floor fax +1 - 212 - 995 4122
New York, NY 10003, USA http://bioinformatics.cat.nyu.edu
"Hello New York! We'll do what we can!"
Bill Murray in `Ghostbusters'.

Will Fitzgerald

unread,
Feb 25, 2002, 9:51:12 PM2/25/02
to

"Erik Naggum" <er...@naggum.net> wrote in message
news:32235294...@naggum.net...

> * att...@etang.com (attonie)
> | as i know, lisp is a interpretion language, thus the speed is slow, so
> | is there any program can compile lisp program to machine code?
>
> You must be thinking of Scheme, a toy Lisp. Common Lisp, a real Lisp,
> has always had compilers. Matter of fact, even in 1959, Lisp had a
> compiler. It is just that the toy Lisps that are used in education and
> other forms of confusion are implemented by people who want to prove
some
> academic point -- and these all use Scheme. There is significant merit
> to learning about computers from a higher-level point of view than, say,
> machine instructions and stuff, and Scheme offers a way to look at
Lambda
> calculus. More of this is visible with interpreted code than with
> compiled machine language, so for purpose of study, Scheme is usually an
> interpreted Lisp.
>

Just to be clear, there are compilers for Scheme, including:

MzScheme
Kawa (Scheme to JVM bytecode)
Skij (Scheme to JVM bytecode)
Stalin
Chicken
Bigloo
Scheme-to-C
Gambit Scheme
etc.

See: http://www.schemers.org/Documents/FAQ/#implementations

In fact, I think there are more implementations of Scheme compilers than
Common Lisp compilers. Which is not to say Scheme is preferable to CL (or
vice versa); it's just that Scheme (too) has compilers.

Will Fitzgerald

Frank A. Adrian

unread,
Feb 27, 2002, 1:10:46 AM2/27/02
to
Alexander Schofield wrote:

> My what big teeth you have.
> Give the guy a break, his English isn't so good, and I got the feeling
> that he meant, 'as far as I know'. Lisp being interpreted only is a
> pretty common misconception, even propogated by some textbooks talking
> about only early Lisp. If he was a going to spread FUD, why do it in
> the Lisp ng? Isn't it more likely he was seeking information? Perhaps
> this is a good time to give useful information about CL, and end his
> misconception instead of giving this ng a hostile atmosphere.

Well, I've been around `this group for a good many years. Most people
coming in here with a conception of Lisp as an "interpreted-only" language
have either not done ANY research (try a google search on Lisp compiler and
you'll find plenty of hits) or *is* trolling. As such, I felt somewhat
justified in responding as I did. As for the perception that this NG is a
"hostile" place, well, not all of the world is pretty, but I daresay I've
not even been close to being the thorniest thistle about here. In any
case, if my coments were cause for offense, rather than insight, I do
apologize for the form in which I presented it. The semantics, however,
stand.

faa

0 new messages