logo-to-lisp translator 
Author Message
 logo-to-lisp translator

For some time I've been working on a logo-to-lisp translator.  I've
gotten it to the point where it can do some rudimentary things and it
seems to be fairly effective.  I see speedups from 5X to 50+X over UCB
Logo.

For example, the following code is a benchmark I use from time to
time.  In my translator, it runs in about 18 seconds.  In UCB Logo 4.6
it takes a half-hour.

to firstden :kinds
output ifelse :kinds = 1 [1] [ ~
         ifelse :kinds = 2 [5] [ ~
           ifelse :kinds = 3 [10] [ ~
             ifelse :kinds = 4 [25] [ ~
               if     :kinds = 5 [50]]]]]
end

to cctail :amount :kinds :total
output ifelse :amount = 0 [:total + 1] [ ~
         ifelse or :amount < 0 :kinds = 0 [:total] ~
           [cctail :amount - firstden :kinds :kinds ~
              cctail :amount :kinds - 1 :total]]
end

to countchange :amount
print shell "date
print cctail :amount 5 0
print shell "date
end

countchange 400

The following one-liner runs about 5X as fast in my translator as in
UCB Logo.

repeat 420 [setheading difference repcount 1 repeat repcount [fd 2 rt 1] pu home pd]

This code runs under UNIX / CMU Lisp with CLX.

The intent of this project is to emulate UCB Logo but give compiled
performance.  I used lisp because 1) I like it and 2) translating logo
to lisp is fairly easy.

If anyone is interested in looking at it, and are comfortable with
lisp and with code that's not even half finished and full of bugs,
please drop me a line.  I'm actually interested in maybe getting other
people to help with this.

--



Sun, 22 Sep 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. New Common Lisp and Lisp-to-C translator ANNOUNCEMENT

2. New Common Lisp and Lisp-to-C translator ANNOUNCEMENT

3. Translator logo to C/C++

4. LOGO-L> Numbers-->English translator

5. Modula-2 to Common LISP translator

6. Scheme to Common Lisp translator

7. Translators: C/Pascal to Scheme/Lisp...???

8. LISP to Scheme Translators

9. Wanted: Lisp to Ada translator

10. LISP to Python translator?

11. scheme to lisp translator?

12. lisp to c++/STL translator

 

 
Powered by phpBB® Forum Software