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

lisp to c++/STL translator

185 views
Skip to first unread message

larry

unread,
Aug 31, 2001, 12:54:05 PM8/31/01
to
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.

Software Scavenger

unread,
Aug 31, 2001, 7:21:19 PM8/31/01
to
larry...@hotmail.com (larry) wrote in message news:<7b8f89d6.0108...@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.

Thomas A. Russ

unread,
Aug 31, 2001, 6:14:00 PM8/31/01
to
larry...@hotmail.com (larry) writes:

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 t...@isi.edu

Martin Cracauer

unread,
Sep 4, 2001, 10:14:35 PM9/4/01
to
cubic...@mailandnews.com (Software Scavenger) writes:

>larry...@hotmail.com (larry) wrote in message news:<7b8f89d6.0108...@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 <crac...@bik-gmbh.de> http://www.bik-gmbh.de/~cracauer/
FreeBSD - where you want to go. Today. http://www.freebsd.org/

Martin Cracauer

unread,
Sep 4, 2001, 10:08:38 PM9/4/01
to
larry...@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.

Eric Moss

unread,
Sep 5, 2001, 11:12:44 AM9/5/01
to

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

Reini Urban

unread,
Sep 8, 2001, 9:26:39 AM9/8/01
to
Eric Moss <eric...@alltel.net> wrote in message news:<3B9640EC...@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.

Software Scavenger

unread,
Sep 8, 2001, 12:56:40 PM9/8/01
to
crac...@counter.bik-gmbh.de (Martin Cracauer) wrote in message news:<9n41qb$26k0$1...@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.

Raymond Wiker

unread,
Sep 8, 2001, 2:29:10 PM9/8/01
to
cubic...@mailandnews.com (Software Scavenger) writes:

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
Raymon...@fast.no

Thomas F. Burdick

unread,
Sep 9, 2001, 5:55:15 PM9/9/01
to
Raymond Wiker <Raymon...@fast.no> writes:

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.

Michael A. Koerber

unread,
Sep 10, 2001, 8:17:33 AM9/10/01
to

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!
m...@ll.mit.edu

pww19...@gmail.com

unread,
Apr 22, 2015, 3:47:42 AM4/22/15
to
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
在 2001年9月1日星期六 UTC+8上午12:54:05,larry写道:
Title: The core of the core of the big data solutions -- Map
Author: pengwenwei
Email:
Language: c++
Platform: Windows, linux
Technology: Perfect hash algorithm
Level: Advanced
Description: Map algorithm with high performance
Section MFC c++ map stl
SubSection c++ algorithm
License: (GPLv3)

Download demo project - 1070 Kb
Download source - 1070 Kb

Introduction:
For the c++ program, map is used everywhere.And bottleneck of program performance is often the performance of map.Especially in the case of large data,and the business association closely and unable to realize the data distribution and parallel processing condition.So the performance of map becomes the key technology.

In the work experience with telecommunications industry and the information security industry, I was dealing with the big bottom data,especially the most complex information security industry data,all can’t do without map.

For example, IP table, MAC table, telephone number list, domain name resolution table, ID number table query, the Trojan horse virus characteristic code of cloud killing etc..

The map of STL library using binary chop, its has the worst performance.Google Hash map has the optimal performance and memory at present, but it has repeated collision probability.Now the big data rarely use a collision probability map,especially relating to fees, can’t be wrong.

Now I put my algorithms out here,there are three kinds of map,after the build is Hash map.We can test the comparison,my algorithm has the zero probability of collision,but its performance is also better than the hash algorithm, even its ordinary performance has no much difference with Google.

My algorithm is perfect hash algorithm,its key index and the principle of compression algorithm is out of the ordinary,the most important is a completely different structure,so the key index compression is fundamentally different.The most direct benefit for program is that for the original map need ten servers for solutions but now I only need one server.
Declare: the code can not be used for commercial purposes, if for commercial applications,you can contact me with QQ 75293192.
Download:
https://sourceforge.net/projects/pwwhashmap/files

Applications:
First,modern warfare can’t be without the mass of information query, if the query of enemy target information slows down a second, it could lead to the delaying fighter, leading to failure of the entire war. Information retrieval is inseparable from the map, if military products use pwwhashMap instead of the traditional map,you must be the winner.

Scond,the performance of the router determines the surfing speed, just replace open source router code map for pwwHashMap, its speed can increase ten times.
There are many tables to query and set in the router DHCP ptotocol,such as IP,Mac ,and all these are completed by map.But until now,all map are using STL liabrary,its performance is very low,and using the Hash map has error probability,so it can only use multi router packet dispersion treatment.If using pwwHashMap, you can save at least ten sets of equipment.

Third,Hadoop is recognized as the big data solutions at present,and its most fundamental thing is super heavy use of the map,instead of SQL and table.Hadoop assumes the huge amounts of data so that the data is completely unable to move, people must carry on the data analysis in the local.But as long as the open source Hadoop code of the map changes into pwwHashMap, the performance will increase hundredfold without any problems.


Background to this article that may be useful such as an introduction to the basic ideas presented:
http://blog.csdn.net/chixinmuzi/article/details/1727195

0 new messages