From: larry
Subject: lisp to c++/STL  translator
Date: 
Message-ID: <7b8f89d6.0108310854.60f7cc@posting.google.com>
I'd like to use lisp at work, but of course the management wouldn't go
for it.
It would be nice to work in lisp and then have it translated into
READABLE
C++ code using STL for data structures and algorithms. Are there any
such translators out there? If not, this seems like a nice ambitious
collaborative project for everyone who writes in asking for
suggestions for real lisp projects to get started on.

From: Thomas A. Russ
Subject: Re: lisp to c++/STL  translator
Date: 
Message-ID: <ymivgj36fo7.fsf@sevak.isi.edu>
··········@hotmail.com (larry) writes:

> I'd like to use lisp at work, but of course the management wouldn't go
> for it.
> It would be nice to work in lisp and then have it translated into
> READABLE
> C++ code using STL for data structures and algorithms. Are there any
> such translators out there? If not, this seems like a nice ambitious
> collaborative project for everyone who writes in asking for
> suggestions for real lisp projects to get started on.

Well, it's not completely what you asked for, but you might want to take
a look at our Stella work:

   http://www.isi.edu/isd/LOOM/Stella/index.html 

You don't get to program in Common Lisp, although the language is
clearly a Lisp-like.  The biggest area where CL functionality is not
supported is in the object system.  That is because the language is
translated into either Common Lisp, C++ or Java using native objects, so
we were limited by the constraints of the C++ or Java object system.

(Making a virtue out of necessity, we did add the option to translate
 Stella objects as Lisp Structs for higher performance.  Since Java
 constrains us to a single inheritance language, defstruct coupled with
 defmethod provides sufficient inheritance and dispatching.)

Our plans are to make Stella available in general, under what we hope
are appropriate licensing terms (Mozilla Public License or GNU GPL).

We do our development in the Common Lisp translation, because that
allows us to take advantage of the dynamic linking and function
redefinition of the Lisp development environment (and the debugger).
Once we have our code debugged, we usually deploy it in Java.

The resulting translated code is fairly readable, with the exception of
code that has a lot of nested calls and some of our own
meta-information.  In particular, since we use the native object systems
of the target language, there are no problems with inter-operation.
Someone who doesn't look at the source code won't be able to tell the
difference between C++ or Java classes produced by the translator and
hand written ones.

-Tom.

-- 
Thomas A. Russ,  USC/Information Sciences Institute          ···@isi.edu    
From: Software Scavenger
Subject: Re: lisp to c++/STL  translator
Date: 
Message-ID: <a6789134.0108311521.3c1abb8e@posting.google.com>
··········@hotmail.com (larry) wrote in message news:<··························@posting.google.com>...

> I'd like to use lisp at work, but of course the management wouldn't go

Do it anyway.  Don't bother to translate the Lisp to C++.  While you
and your coworkers are working on the newest C++ version of your
application, you can be spending part of your spare time on an
equivalent Lisp version.  Since Lisp is so much more productive, you
can easily keep up with a large team of programmers, keeping the
features of your version in sync with theirs.  Imagine how much fun it
would be to have a secret version constantly keeping up with the
team's version and always much higher quality than it.  Just keep
doing it and be patient enough to keep doing the C++ too.  Before you
know it, you will have an opportunity, such as in a company
reorganization or whatever, to replace the C++ version with your Lisp
version.  If you play it smart enough, you will also be your boss's
boss, or your boss's boss's boss, or somewhere up there.

Lisp is a very powerful language, in more ways than one.  The secret
of business success is to keep working to gain power, and have the
patience and wisdom to know when and how to use that power.
From: Martin Cracauer
Subject: Re: lisp to c++/STL translator
Date: 
Message-ID: <9n41qb$26k0$1@counter.bik-gmbh.de>
··········@mailandnews.com (Software Scavenger) writes:

>··········@hotmail.com (larry) wrote in message news:<··························@posting.google.com>...

>> I'd like to use lisp at work, but of course the management wouldn't go

>Do it anyway.  Don't bother to translate the Lisp to C++.  While you
>and your coworkers are working on the newest C++ version of your
>application, you can be spending part of your spare time on an
>equivalent Lisp version.  Since Lisp is so much more productive, you
>can easily keep up with a large team of programmers, keeping the
>features of your version in sync with theirs.  

They won't be impressed.  Nobody cares for productivty as defined in
"what one man can do in a month".

>Imagine how much fun it
>would be to have a secret version constantly keeping up with the
>team's version and always much higher quality than it.  

And marked the team's a**h***e.

>Just keep
>doing it and be patient enough to keep doing the C++ too.  Before you
>know it, you will have an opportunity, such as in a company
>reorganization or whatever, to replace the C++ version with your Lisp
>version.  If you play it smart enough, you will also be your boss's
>boss, or your boss's boss's boss, or somewhere up there.

OK, in that case the "team's a**h***e" part really worked :-)

>Lisp is a very powerful language, in more ways than one.  The secret
>of business success is to keep working to gain power, and have the
>patience and wisdom to know when and how to use that power.

Playing such games takes up energy.  Energy you would have to spend on
doing all you work twice.

I wouldn't doubt that some persons can develop such energy, but what
for, what is the motivator? What is the use of being great if noone
admires it.  Certainly neither your team nor your boss in your
scenario.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <········@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer/
FreeBSD - where you want to go. Today. http://www.freebsd.org/
From: Software Scavenger
Subject: Re: lisp to c++/STL translator
Date: 
Message-ID: <a6789134.0109080856.62041dcb@posting.google.com>
········@counter.bik-gmbh.de (Martin Cracauer) wrote in message news:<·············@counter.bik-gmbh.de>...

> Playing such games takes up energy.  Energy you would have to spend on
> doing all you work twice.

Writing the same program in C++ and Lisp is not twice the work of
writing it in C++ alone.  Even if the languages were equal work, the
bulk of the work of writing a program is in learning the exact details
of how it works and/or how it should work and/or why it doesn't work.
From: Raymond Wiker
Subject: Re: lisp to c++/STL translator
Date: 
Message-ID: <867kv94jux.fsf@raw.grenland.fast.no>
··········@mailandnews.com (Software Scavenger) writes:

> ········@counter.bik-gmbh.de (Martin Cracauer) wrote in message news:<·············@counter.bik-gmbh.de>...
> 
> > Playing such games takes up energy.  Energy you would have to spend on
> > doing all you work twice.
> 
> Writing the same program in C++ and Lisp is not twice the work of
> writing it in C++ alone.  Even if the languages were equal work, the
> bulk of the work of writing a program is in learning the exact details
> of how it works and/or how it should work and/or why it doesn't work.

        Actually, if you write the program *first* in Lisp, then in
C++, it may take shorter time than writing it in C++ from scratch :-)

-- 
Raymond Wiker
·············@fast.no
From: Thomas F. Burdick
Subject: Re: lisp to c++/STL translator
Date: 
Message-ID: <xcvy9noowqk.fsf@famine.OCF.Berkeley.EDU>
Raymond Wiker <·············@fast.no> writes:

> ··········@mailandnews.com (Software Scavenger) writes:
> 
> > ········@counter.bik-gmbh.de (Martin Cracauer) wrote in message news:<·············@counter.bik-gmbh.de>...
> > 
> > > Playing such games takes up energy.  Energy you would have to spend on
> > > doing all you work twice.
> > 
> > Writing the same program in C++ and Lisp is not twice the work of
> > writing it in C++ alone.  Even if the languages were equal work, the
> > bulk of the work of writing a program is in learning the exact details
> > of how it works and/or how it should work and/or why it doesn't work.
> 
>         Actually, if you write the program *first* in Lisp, then in
> C++, it may take shorter time than writing it in C++ from scratch :-)

My experience with this was that (both times), it took longer than it
would have to write it in C++ from the start[*].  However, I ended out
with a better, more robust system.

[*] One time I did this, I'm just guessing how long it would have
taken me to use C++ from scratch, but I'm pretty sure it would have
been less time.  The other time, I started at the same time as someone
who was doing the same project in C++ from the beginning, and we
generally develop about the same quality software at about the same
speed, in C++ anyway.  He took about 80% of the man-hours that I did,
but my system was more efficient (only from better locality of
reference), and handeled running out of resources and other aweful
situations with more grace.  Someone with a better handle on the STL
might be able to do the rewrite in C++ faster.
From: Martin Cracauer
Subject: Re: lisp to c++/STL translator
Date: 
Message-ID: <9n41f6$26bl$1@counter.bik-gmbh.de>
··········@hotmail.com (larry) writes:

>It would be nice to work in lisp and then have it translated into
>READABLE
>C++ code using STL for data structures and algorithms. Are there any
>such translators out there? 

Do you really mean readable? What are you going to do with the
readablity? It sounds to me that people should be able to make changes
to it.  If not, it's useless.  If yes, then you are hitting one the
worst situations in software devlopment, one group editing files that
generate files that others edit.  And a 50-man team merging the mess.

I won't even start on "readability" as defined by C++ and Lisp.  Not a
pun to either, but one language style written in another is another
deadly thing to do and a translator cannot go bejond it.

>If not, this seems like a nice ambitious
>collaborative project for everyone who writes in asking for
>suggestions for real lisp projects to get started on.

No, it would be a death-blow for the personal energy of another group
of people.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <········@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer/
FreeBSD - where you want to go. Today. http://www.freebsd.org/
From: Eric Moss
Subject: Re: lisp to c++/STL  translator
Date: 
Message-ID: <3B9640EC.7CC9EAC1@alltel.net>
larry wrote:
> 
> I'd like to use lisp at work, but of course the management wouldn't go
> for it.
> It would be nice to work in lisp and then have it translated into
> READABLE
> C++ code using STL for data structures and algorithms. Are there any
> such translators out there? If not, this seems like a nice ambitious
> collaborative project for everyone who writes in asking for
> suggestions for real lisp projects to get started on.

Google found the following summaries of Lisp->C packages, which may be
of use:

	http://xarch.tu-graz.ac.at/autocad/lisp/FAQ-link/msg00339.html

Like some of the other posters, I have found that programming is as much
a sociological phenomenon as a scientific one; probably more so, given
that rarely do programmers have programmers as their boss. That makes
the "spend your whole waking life doing the same thing independently" a
risky venture from the team-dynamics standpoint.

If any of the above-metioned lisp->c packages work for you, great.
Otherwise, try Bill Vrotney's LPP
(http://www.interhack.net/projects/lpp/), which is a C++ library that
lets you have dynamic typing, garbage collection, lists and some other
goodies. Pretty cool stuff--he told me that it's what kept him sane in a
C++ job, and gave him back some productivity. Who knows, your group may
even see it as a boon rather than a threat.

Have fun,

Eric
From: Reini Urban
Subject: Re: lisp to c++/STL  translator
Date: 
Message-ID: <9fdb4c8c.0109080526.248b145b@posting.google.com>
Eric Moss <········@alltel.net> wrote in message news:<·················@alltel.net>...
> Google found the following summaries of Lisp->C packages, which may be
> of use:
> 	http://xarch.tu-graz.ac.at/autocad/lisp/FAQ-link/msg00339.html

Oops. Google should have found
  http://xarch.tu-graz.ac.at/home/rurban/news/comp.lang.lisp/msg00339.html
instead.
This is a wrong symlink. I'll fix it by redirection ASAP.
From: Michael A. Koerber
Subject: Re: lisp to c++/STL  translator
Date: 
Message-ID: <3B9CAF5D.64B21632@ll.mit.edu>
larry wrote:
> 
> I'd like to use lisp at work, but of course the management wouldn't go
> for it.
> It would be nice to work in lisp and then have it translated into
> READABLE
> C++ code using STL for data structures and algorithms. Are there any
> such translators out there? If not, this seems like a nice ambitious
> collaborative project for everyone who writes in asking for
> suggestions for real lisp projects to get started on.

I don't know if this helps, but on source forge there was a ThinLisp
released a few months ago.  I've done nothing more than read about it,
but it could have the base functionallity you want.

mike
-- 
-------------------------------------------------------------------
Dr Michael A. Koerber       We child proofed our home 3 years ago 
MIT/Lincoln Laboratory      and they're still getting in!         
···@ll.mit.edu