From: Christian Lynbech
Subject: translating C or Java to lisp?
Date: 
Message-ID: <ofn13bv49a.fsf@chl.ted.dk.eu.ericsson.se>
Has anybody ever thought (or otherwise heard) about projects to
translate C or Java into lisp?

This is mostly out of curiosity, but also based on that hard real life
fact that people around our CL based project are very sceptical about
our choice of lisp. 

We want to apeace some of the opposition by opening up some API's and
while FFI callbacks or Franz' jLinker certainly are possible routes,
it could be an interesting option to just suck in the foreign code
directly.

Translating java to lisp seems quite doable while C poses more of a
challenge since you would possibly need something quite clever in
order to handle all the pointer stuff at a reasonable speed (my hunch
is that simply simulating the heap would not be fast enough).


------------------------+-----------------------------------------------------
Christian Lynbech       | Ericsson Telebit, Skanderborgvej 232, DK-8260 Viby J
Phone: +45 8938 5244    | email: ·················@ted.ericsson.dk
Fax:   +45 8938 5101    | web:   www.ericsson.com
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - ·······@hal.com (Michael A. Petonic)

From: Vebjorn Ljosa
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <cy3ofnrmmw4.fsf@ljosa.com>
* Christian Lynbech <·················@ted.ericsson.dk>
| Has anybody ever thought (or otherwise heard) about projects to
| translate C or Java into lisp?

I think the C compiler on Symbolics Lisp Machines worked by compiling
the C code into Lisp, and then running the regular Lisp compiler on
the generated Lisp code.

There were some articles about this a while back.  Maybe Google can
find them for you.

-- 
Vebjorn Ljosa
From: Scott McKay
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <sX%t7.58981$vq.11301180@typhoon.ne.mediaone.net>
"Vebjorn Ljosa" <·····@ljosa.com> wrote in message
····················@ljosa.com...
> * Christian Lynbech <·················@ted.ericsson.dk>
> | Has anybody ever thought (or otherwise heard) about projects to
> | translate C or Java into lisp?
>
> I think the C compiler on Symbolics Lisp Machines worked by compiling
> the C code into Lisp, and then running the regular Lisp compiler on
> the generated Lisp code.
>

It compiled directly into the Lisp Machine's native instruction set.

You should have seen how many bugs turned up in mature C and
FORTRAN turned up when run on a tagged, "safe" architecture...
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3ofnr8fec.fsf@kappa.unlambda.com>
"Scott McKay" <···@mediaone.net> writes:

> "Vebjorn Ljosa" <·····@ljosa.com> wrote in message
> ····················@ljosa.com...
> > * Christian Lynbech <·················@ted.ericsson.dk>
> > | Has anybody ever thought (or otherwise heard) about projects to
> > | translate C or Java into lisp?
> >
> > I think the C compiler on Symbolics Lisp Machines worked by compiling
> > the C code into Lisp, and then running the regular Lisp compiler on
> > the generated Lisp code.
> >
> 
> It compiled directly into the Lisp Machine's native instruction set.
> 
> You should have seen how many bugs turned up in mature C and
> FORTRAN turned up when run on a tagged, "safe" architecture...

For instance, NULL isn't 0 in Lisp Machine C.  (I think address 0 is
NIL, but not NULL.)  NULL is something like (cons nil 0) or somesuch.

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Carl Shapiro
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <ouyadzbjblj.fsf@panix3.panix.com>
"Scott McKay" <···@mediaone.net> writes:

> "Vebjorn Ljosa" <·····@ljosa.com> wrote in message
> ····················@ljosa.com...
> > * Christian Lynbech <·················@ted.ericsson.dk>
> > | Has anybody ever thought (or otherwise heard) about projects to
> > | translate C or Java into lisp?
> >
> > I think the C compiler on Symbolics Lisp Machines worked by compiling
> > the C code into Lisp, and then running the regular Lisp compiler on
> > the generated Lisp code.
> >
> 
> It compiled directly into the Lisp Machine's native instruction set.

There was something else called "ZETA-C" which translated C into Lisp.
This had nothing to do with the Symbolics native C compiler which was
developed later.
From: Tim Bradshaw
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <ey3d747qsfw.fsf@cley.com>
* Vebjorn Ljosa wrote:
* Christian Lynbech <·················@ted.ericsson.dk>

> I think the C compiler on Symbolics Lisp Machines worked by compiling
> the C code into Lisp, and then running the regular Lisp compiler on
> the generated Lisp code.

I don't think so.  Or at least I don't think the Fortran compiler did
this, because I am almost sure it could do cons-free double precision
arithmetic, which was not easy, at least, from Lisp.

However I'm fairly sure that there was a whole more-or-less accessible
parser in there, though I'm not sure it was documented.

--tim
From: Kent M Pitman
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <sfwvghzrlrh.fsf@world.std.com>
Vebjorn Ljosa <·····@ljosa.com> writes:

> 
> * Christian Lynbech <·················@ted.ericsson.dk>
> | Has anybody ever thought (or otherwise heard) about projects to
> | translate C or Java into lisp?
> 
> I think the C compiler on Symbolics Lisp Machines worked by compiling
> the C code into Lisp, and then running the regular Lisp compiler on
> the generated Lisp code.

This makes sense in an environment where there is no other C implementation,
but it makes little sense when there is one.  Also, as Scott McKay points
out, it was really a compile-to-native compiler; if it had translated to
Lisp, it probably would have lost too much speed to keep pace.  I wrote a
Fortran to Lisp translator once for Maclisp, and it did adequately well
for people who had no other access to  the relevant Fortran programs, but
because it didn't compile to PDP10 but instead compiled to Maclisp, there
were all kinds of constructs that would fake out the compiler and produce
suboptimal code.  See my web site for a discussion of this in my paper on
the translator: http://world.std.com/~pitman/Papers/Fortran-to-Lisp.html

Christian's friends who are skeptical of Lisp are not going to be convinced
by a Lisp to C translator.  They'll just distrust it as if you were using
an "ACME" C compiler rather than a "standard" one like gcc.  They're probably
just making up excuses to distrust anything they don't use.

The right solution to this problem, IMO, is ffi.  If that doesn't work, my
guess is that nothing will.  People don't increase confidence in Pascal
implementations by making C to Pascal translators; they figure a way to
link C with Pascal.  Sometimes even that is not enough.  But that's because
these things all come down to individual personal opinions of people in
power.
From: Wade Humeniuk
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <9pb0bc$7v3$1@news3.cadvision.com>
> Christian's friends who are skeptical of Lisp are not going to be
convinced
> by a Lisp to C translator.  They'll just distrust it as if you were using
> an "ACME" C compiler rather than a "standard" one like gcc.  They're
probably
> just making up excuses to distrust anything they don't use.
>
> The right solution to this problem, IMO, is ffi.  If that doesn't work, my
> guess is that nothing will.  People don't increase confidence in Pascal
> implementations by making C to Pascal translators; they figure a way to
> link C with Pascal.  Sometimes even that is not enough.  But that's
because
> these things all come down to individual personal opinions of people in
> power.

Influenced by _advertising_.  Perhaps its time to get a good PR firm for
Lisp, catch a few choice cameos in a tech movie, write ups in programming
magazines.

Or perhaps one could just wait for maturity and reality to seep into the
younger crowd.

Nah,...

Just do it!  Brought to you by Nike Lisp.

Wade
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3zo7arflh.fsf@kappa.unlambda.com>
"Wade Humeniuk" <········@cadvision.com> writes:

> Influenced by _advertising_.  Perhaps its time to get a good PR firm for
> Lisp, catch a few choice cameos in a tech movie, write ups in programming
> magazines.
> 
> Or perhaps one could just wait for maturity and reality to seep into the
> younger crowd.
> 
> Nah,...
> 
> Just do it!  Brought to you by Nike Lisp.

I am reminded of the cheesy line in "Jurassic Park" where the young
girl sits down at an SGI workstation, frobs their 3D file browser, and
says something like "I know this!  This is *Unix*!".  Barf.

Call up Hollywood and ask them what the next big 'Hacker' film will
be.  Get some famous Lisper (KMP, GLS, or even Uncle John McCarthy) to
do a cameo.  Get pictures of them hacking on a LispM, perhaps a
Symbolics set up like in this picture
  http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-images/mac-ivory-3-lcd-4.jpg
or perhaps on a set with a Connection Machine glowing redly like in
  http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-images/cm-lispm.jpg

Would be fun to see Lisp in the movies though.

Although I get the funny feeling that the Lisp hackers would be
portrayed as a bunch of weird hippie-type creatures which smell of
patchouli and use old crufty computers. :-)

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Christopher Stacy
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <uu1xiqyev.fsf@spacy.Boston.MA.US>
>>>>> On 01 Oct 2001 17:32:58 -0800, James A Crippen ("James") writes:
 James> I am reminded of the cheesy line in "Jurassic Park" where the young
 James> girl sits down at an SGI workstation, frobs their 3D file browser, and
 James> says something like "I know this!  This is *Unix*!".  Barf.

 James> or perhaps on a set with a Connection Machine glowing redly like in

In Jurassic Park, wasn't that SGI machine the front-end for the CM-5 sitting there?
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m33d52m0o8.fsf@kappa.unlambda.com>
Christopher Stacy <······@spacy.Boston.MA.US> writes:

> >>>>> On 01 Oct 2001 17:32:58 -0800, James A Crippen ("James") writes:

>  James> I am reminded of the cheesy line in "Jurassic Park" where
>  James> the young girl sits down at an SGI workstation, frobs their
>  James> 3D file browser, and says something like "I know this!  This
>  James> is *Unix*!".  Barf.
> 
>  James> or perhaps on a set with a Connection Machine glowing redly
>  James> like in
> 
> In Jurassic Park, wasn't that SGI machine the front-end for the CM-5
> sitting there?

I don't recall.  You could very well be right though.  I guess I'll
have to see that movie again sometime.

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Scott McKay
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <6Mju7.66293$vq.12305260@typhoon.ne.mediaone.net>
"James A. Crippen" <·····@unlambda.com> wrote in message
···················@kappa.unlambda.com...
>
> Call up Hollywood and ask them what the next big 'Hacker' film will
> be.  Get some famous Lisper (KMP, GLS, or even Uncle John McCarthy) to
> do a cameo.  Get pictures of them hacking on a LispM, perhaps a
> Symbolics set up like in this picture
>
http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-
images/mac-ivory-3-lcd-4.jpg
> or perhaps on a set with a Connection Machine glowing redly like in
>
http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-
images/cm-lispm.jpg
>
> Would be fun to see Lisp in the movies though.
>
> Although I get the funny feeling that the Lisp hackers would be
> portrayed as a bunch of weird hippie-type creatures which smell of
> patchouli and use old crufty computers. :-)
>


The movie "Real Genius" -- which I would still recommend
15 years after its making -- features a Symbolics 3600.  I think
they edited in some random crap onto the screen, though.  And
it is indeed being hacked by a hippie with Asperger's syndrome.

As you can tell, this exposure did a huge amount for `Bolix.  ;-)
From: Christopher J. Vogt
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <3BB9CCF8.D9749FE6@computer.org>
Scott McKay wrote:
> 
> "James A. Crippen" <·····@unlambda.com> wrote in message
> ···················@kappa.unlambda.com...
> >
> > Call up Hollywood and ask them what the next big 'Hacker' film will
> > be.  Get some famous Lisper (KMP, GLS, or even Uncle John McCarthy) to
> > do a cameo.  Get pictures of them hacking on a LispM, perhaps a
> > Symbolics set up like in this picture
> >
> http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-
> images/mac-ivory-3-lcd-4.jpg
> > or perhaps on a set with a Connection Machine glowing redly like in
> >
> http://kogs-www.informatik.uni-hamburg.de/~moeller/symbolics-info/symbolics-
> images/cm-lispm.jpg
> >
> > Would be fun to see Lisp in the movies though.
> >
> > Although I get the funny feeling that the Lisp hackers would be
> > portrayed as a bunch of weird hippie-type creatures which smell of
> > patchouli and use old crufty computers. :-)
> >
> 
> The movie "Real Genius" -- which I would still recommend
> 15 years after its making -- features a Symbolics 3600.  I think
> they edited in some random crap onto the screen, though.

And the color monitor was running the spheres demo :-)
From: Espen Vestre
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <w6heti3zbf.fsf@wallace.ws.nextra.no>
"Scott McKay" <···@mediaone.net> writes:

> I think they edited in some random crap onto the screen, though. 

but of course - in 72pt font, I presume?
-- 
  (espen)
From: Nils Goesche
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <lk1ykkxbu1.fsf@pc022.bln.elmeg.de>
·····@unlambda.com (James A. Crippen) writes:

> Would be fun to see Lisp in the movies though.

If you watch the (great!) Anime series ``Lain'', which is available on
DVD (RC 1), you will see at one point a page of Common Lisp code
appearing on some screen (very shortly).  I ran over it with slow
motion and saw that it was not only Common Lisp (and not Scheme or
something), but apparently specifically written for this series.  I
always wonder which Common Lisp hacker was involved in the making of
it.

Regards,
-- 
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3vghv6cj6.fsf@kappa.unlambda.com>
Nils Goesche <······@cartan.de> writes:

> ·····@unlambda.com (James A. Crippen) writes:
> 
> > Would be fun to see Lisp in the movies though.
> 
> If you watch the (great!) Anime series ``Lain'', which is available on
> DVD (RC 1), you will see at one point a page of Common Lisp code
> appearing on some screen (very shortly).  I ran over it with slow
> motion and saw that it was not only Common Lisp (and not Scheme or
> something), but apparently specifically written for this series.  I
> always wonder which Common Lisp hacker was involved in the making of
> it.

Keep in mind that not only has Common Lisp been fairly popular in
Japan amongst certain circles, but Symbolics sold their graphics
division to Nichimen, who still uses Lisp in their production 3D
worldbuilding environment, AFAIK.

So it wouldn't be surprising to hear that they guy who inserted the CL
code in there started out hacking with S-Products.  There's a number
of Hollywood type people who use Lisp for graphics too.

Anyone have more details?

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Vebjorn Ljosa
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <cy33d4zi8f8.fsf@ljosa.com>
* ·····@unlambda.com (James A. Crippen)
| 
| Keep in mind that not only has Common Lisp been fairly popular in
| Japan amongst certain circles, but Symbolics sold their graphics
| division to Nichimen, who still uses Lisp in their production 3D
| worldbuilding environment, AFAIK.
| 
| So it wouldn't be surprising to hear that they guy who inserted the CL
| code in there started out hacking with S-Products.  There's a number
| of Hollywood type people who use Lisp for graphics too.
| 
| Anyone have more details?

In a paper presented at JLUGM 2000, Shiro Kawai shares his experiences
with using Lisp for developing a production tracking database for a
studio.

Shiro Kawai, "Shooting A Moving Target---An Experience In Developing A
Production Tracking Database," in Proceedings of the Japan Lisp User
Meeting (JLUGM), May, 2000, <URL:http://jp.franz.com/jlug/en/jlugm2000/>.

-- 
Vebjorn Ljosa
From: Tim Bradshaw
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <nkj4rpibd05.fsf@davros.tardis.ed.ac.uk>
"Wade Humeniuk" <········@cadvision.com> writes:


> Influenced by _advertising_.  Perhaps its time to get a good PR firm for
> Lisp, catch a few choice cameos in a tech movie, write ups in programming
> magazines.

I think now is a good time.  Microsoft are talking about rewriting IIS
because it's been so badly trashed by vulnerabilities, many of which
are buffer overflows at heart.  This has to be a good time to push a
language which doesn't have these problems.  The recently-announced
NFS server written by a franz person is also pretty compelling: It's
an NFS server (Lisp can be used for system applications), it seems to
be faster than at least some existing windows NFS servers (hey, Lisp
is not slow!), and, finally, they say it took less effort to write and
deploy this thing than it did just to deploy the commercial one.

Of course you need an answer to Java which also doesn't have
bounds-check issues.

--tim
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3y9muklft.fsf@kappa.unlambda.com>
Tim Bradshaw <···@tfeb.org> writes:

> "Wade Humeniuk" <········@cadvision.com> writes:
> 
> 
> > Influenced by _advertising_.  Perhaps its time to get a good PR firm for
> > Lisp, catch a few choice cameos in a tech movie, write ups in programming
> > magazines.
> 
> I think now is a good time.  Microsoft are talking about rewriting IIS
> because it's been so badly trashed by vulnerabilities, many of which
> are buffer overflows at heart.  This has to be a good time to push a
> language which doesn't have these problems.  The recently-announced
> NFS server written by a franz person is also pretty compelling: It's
> an NFS server (Lisp can be used for system applications), it seems to
> be faster than at least some existing windows NFS servers (hey, Lisp
> is not slow!), and, finally, they say it took less effort to write and
> deploy this thing than it did just to deploy the commercial one.
> 
> Of course you need an answer to Java which also doesn't have
> bounds-check issues.

Uhh...  Lisp doesn't have a borken syntax like C?

Or, Lisp isn't implemented only by licensees of the trademark holder?

Lisp has multiple inheritance?

Lisp has a MOP?

Lisp (in the form of Scheme) bloody well *runs* on the Java VM?  Any
Lisp is better than no Lisp at all...

There are lots of reasons.  I'm sure we can come up with some.

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3k7yf8et6.fsf@kappa.unlambda.com>
Christian Lynbech <·················@ted.ericsson.dk> writes:

> Has anybody ever thought (or otherwise heard) about projects to
> translate C or Java into lisp?
> 
> This is mostly out of curiosity, but also based on that hard real life
> fact that people around our CL based project are very sceptical about
> our choice of lisp. 
> 
> We want to apeace some of the opposition by opening up some API's and
> while FFI callbacks or Franz' jLinker certainly are possible routes,
> it could be an interesting option to just suck in the foreign code
> directly.
> 
> Translating java to lisp seems quite doable while C poses more of a
> challenge since you would possibly need something quite clever in
> order to handle all the pointer stuff at a reasonable speed (my hunch
> is that simply simulating the heap would not be fast enough).

You could, once you have a parse tree, just convert all the pointers
into symbols which are approximate to pointers in many respects except
they have names.

So if you have something like

struct foo
{
  int a;
  int b;
};

struct foo fnord = { 1, 2 };
struct foo *bar = &fnord;

Then you could translate to something like

(defstruct foo
  (a :type (integer (- (expt 2 31)) (expt 2 32)))
  (b :type (integer (- (expt 2 31)) (expt 2 32))))

(let ((fnord (make-foo :a 1 :b 2))
     ((bar 'fnord))
  ...)

Within the let's scope you could do a `,bar to get fnord.  Or an 
(eval bar) or something.

It's messy, but it's a place to start.

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Janis Dzerins
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <874rpi8km8.fsf@asaka.latnet.lv>
·····@unlambda.com (James A. Crippen) writes:

> Christian Lynbech <·················@ted.ericsson.dk> writes:
> 
> > Has anybody ever thought (or otherwise heard) about projects to
> > translate C or Java into lisp?
> > 
> > This is mostly out of curiosity, but also based on that hard real life
> > fact that people around our CL based project are very sceptical about
> > our choice of lisp. 
> > 
> > We want to apeace some of the opposition by opening up some API's and
> > while FFI callbacks or Franz' jLinker certainly are possible routes,
> > it could be an interesting option to just suck in the foreign code
> > directly.
> > 
> > Translating java to lisp seems quite doable while C poses more of a
> > challenge since you would possibly need something quite clever in
> > order to handle all the pointer stuff at a reasonable speed (my hunch
> > is that simply simulating the heap would not be fast enough).
> 
> You could, once you have a parse tree, just convert all the pointers
> into symbols which are approximate to pointers in many respects except
> they have names.
> 
> So if you have something like
> 
> struct foo
> {
>   int a;
>   int b;
> };
> 
> struct foo fnord = { 1, 2 };
> struct foo *bar = &fnord;
> 
> Then you could translate to something like
> 
> (defstruct foo
>   (a :type (integer (- (expt 2 31)) (expt 2 32)))
>   (b :type (integer (- (expt 2 31)) (expt 2 32))))
> 
> (let ((fnord (make-foo :a 1 :b 2))
>      ((bar 'fnord))
>   ...)
> 
> Within the let's scope you could do a `,bar to get fnord.  Or an 
> (eval bar) or something.

Or

(let* ((fnord (make-foo :a 1 :b 2))
       (bar (make-array nil :initial-element fnord)))
  (aref bar))

bar is a zero-dimensional array, looks just like a pointer and no eval.

Note: is an empty list a list of integers?

-- 
Janis Dzerins

  If million people say a stupid thing it's still a stupid thing.
From: Christian Lynbech
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <of3d52qnrw.fsf@chl.ted.dk.eu.ericsson.se>
>>>>> "James" == James A Crippen <·····@unlambda.com> writes:

James> Christian Lynbech <·················@ted.ericsson.dk> writes:
>> Has anybody ever thought (or otherwise heard) about projects to
>> translate C or Java into lisp?

James> You could, once you have a parse tree, just convert all the pointers
James> into symbols which are approximate to pointers in many respects except
James> they have names.

Sure thing. It will require some rather tricky accessors to cater for
computed slot access.

Assume some code like

       (int *)(*(bar + 4)) /* probably not quite the C syntax, but I
                              hope you get the idea */

one would need a function that took a record and an offset and
extracted the relevant value. It would further require some knowledge
of how values was laid out, since arbitrary bytes can be interpreted
as values, such as extracting the low two bytes of an integer or
reading four bytes from a string as an integer.

Luckily, in real life, the majority of all code (also including lisp)
will be pretty straightforward application of basic constructs.

Anyway, I was (as stated) mostly curious. I think Kent Pitman is right
in that such a contraption would not alter the fear growing in the
faint hearts of non-lisp programmers.


------------------------+-----------------------------------------------------
Christian Lynbech       | Ericsson Telebit, Skanderborgvej 232, DK-8260 Viby J
Phone: +45 8938 5244    | email: ·················@ted.ericsson.dk
Fax:   +45 8938 5101    | web:   www.ericsson.com
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - ·······@hal.com (Michael A. Petonic)
From: James A. Crippen
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <m3u1xiklc9.fsf@kappa.unlambda.com>
Christian Lynbech <·················@ted.ericsson.dk> writes:

> Anyway, I was (as stated) mostly curious. I think Kent Pitman is right
> in that such a contraption would not alter the fear growing in the
> faint hearts of non-lisp programmers.

Indeed.  Any code generated from the C->Lisp translator would be
frightening, even after you'd indented it and stripped out all of the
LOOP cruft.

'james

-- 
James A. Crippen <·····@unlambda.com> ,-./-.  Anchorage, Alaska,
Lambda Unlimited: Recursion 'R' Us   |  |/  | USA, 61.2069 N, 149.766 W,
Y = \f.(\x.f(xx)) (\x.f(xx))         |  |\  | Earth, Sol System,
Y(F) = F(Y(F))                        \_,-_/  Milky Way.
From: Marco Antoniotti
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <y6c4rpj74t8.fsf@octagon.mrl.nyu.edu>
Wow!  Something must be changing in the world.

This is one of the first messages I remember asking how to translate
Java or C *into* CL :)

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'.
From: Eric Biefeld
Subject: Re: translating C or Java to lisp?
Date: 
Message-ID: <3BBCA29A.FC337A20@cs.cmu.edu>
I once heard of a LISP to C translator.  But the code it made was not all that
fast with lots of Gensyms so it was impossible to read.  It was some firms idea on
how to cheaply make a LISP compiler.

Christian Lynbech wrote:

> Has anybody ever thought (or otherwise heard) about projects to
> translate C or Java into lisp?
>
> This is mostly out of curiosity, but also based on that hard real life
> fact that people around our CL based project are very sceptical about
> our choice of lisp.
>
> We want to apeace some of the opposition by opening up some API's and
> while FFI callbacks or Franz' jLinker certainly are possible routes,
> it could be an interesting option to just suck in the foreign code
> directly.
>
> Translating java to lisp seems quite doable while C poses more of a
> challenge since you would possibly need something quite clever in
> order to handle all the pointer stuff at a reasonable speed (my hunch
> is that simply simulating the heap would not be fast enough).
>
> ------------------------+-----------------------------------------------------
> Christian Lynbech       | Ericsson Telebit, Skanderborgvej 232, DK-8260 Viby J
> Phone: +45 8938 5244    | email: ·················@ted.ericsson.dk
> Fax:   +45 8938 5101    | web:   www.ericsson.com
> ------------------------+-----------------------------------------------------
> Hit the philistines three times over the head with the Elisp reference manual.
>                                         - ·······@hal.com (Michael A. Petonic)