Common Lisp newLisp module?

Started by kanen, May 05, 2011, 12:11:36 AM

Previous topic - Next topic

kanen

Just curious...



Has anyone taken the time to port the basics of ANSI Common Lisp to newLisp as a loadable module?



I am considering writing a CL inside newLisp, so I can use "normal" Common Lisp expressions and functions in my newLisp code, but use newLisp specific things when it makes sense.



Yes, Lutz, I am aware this somewhat defeats the purpose of newLisp, but I want to do it anyway. :)



Seems like it would not be that hard to do.



<famous last words>



Imagine (from Land of Lisp http://landoflisp.com">//http://landoflisp.com) inside newLisp:



(defvar *small* 1)
(defvar *big*   100)

(defun guess-my-number ()
   "Documentation for guess-my-number."
   (ash (+ *small* *big*) -1))

(defun smaller () (setf *big* (1- (guess-my-number))) (guess-my-number))
(defun bigger () (setf *small* (1+ (guess-my-number))) (guess-my-number))
(defun start-over ()
   (defparameter *small* 1) (defparameter *big* 100) (guess-my-number))
. Kanen Flowers http://kanen.me[/url] .

cormullion

#1
I think that's a seriously odd thing to want to do! :)



I can see, vaguely, that you might want some of the 1000+ Common Lisp functions and features that you don't get with standard newLISP - named parameters, loop, macros, plists, implicit big numbers, format, lexical scope, dotted pairs, compiler, to name a few - but it seems such a lot of work to me. Why not, for example, translate the code in Land of Lisp to newLISP instead?



Anyway, I wish you much luck in your project!

kanen

#2
Excellent points.



I will probably first port the Land of Lisp to newLisp anyway. Could be a fun project.



I am very interested in a newLisp compiler, as I am certain many people are. I've been thinking for years about how much work would be involved to turn newLisp code into a .fasl style output or to create a binary file (withut appending code to the end of the newLisp binary).



Regardless of how it works out, I'm very much enjoying writing newLisp code and doing the New Lessons in Lisp, so the process is worthwhile to me personally, no matter how it ends up.
. Kanen Flowers http://kanen.me[/url] .

rickyboy

#3
<<<Ryon, please delete this post.  The post that follows is a copy.  Thanks, --Rick>>>
(λx. x x) (λx. x x)

rickyboy

#4
By the way, Land of Lisp is a fantastic book.  I love the "speaker tone" of the text and the very, very funny cartoons.  The cartoons always support and never detract from the topic at hand and I have literally howled and laughed out loud at a lot of them. (Hint: don't read this book around other people; they will think you are crazy. :)  So far, my favorite cartoon is the one where the LOOP command is represented as a street flasher, opening his overcoat to an unsuspecting passerby, and there is another guy that says "Look at his face!  Hahaha!".  That's just a very creative way to get the point across that, although LOOP is powerful and fast, it enables and facilitates, by its nature, some very freakin' ugly code.  :)
(λx. x x) (λx. x x)

m i c h a e l

#5
Hi Rick!


Quote from: "rickyboy"The cartoons always support and never detract from the topic at hand and I have literally howled and laughed out loud at a lot of them.


One of my favorite books on programming is "Object-Oriented Analysis and Design with Applications" by Grady Booch. Tony Hall did some fantastic cartoons in there that beautifully illustrated the concepts of OOP. Leo Brodie's Forth books are also greatly enhanced by his cartoons. Many of Forth's concepts would have been much harder to understand without them. Cartoons are sadly underutilized in most programming textbooks.



m i c h a e l

rickyboy

#6
Hi m i c h a e l!  And thanks! --Ricky
(λx. x x) (λx. x x)

tylerdmace

#7
Quote from: "kanen"I am very interested in a newLisp compiler, as I am certain many people are. I've been thinking for years about how much work would be involved to turn newLisp code into a .fasl style output or to create a binary file (withut appending code to the end of the newLisp binary).


+1



I have a feeling, however, that Lutz isn't going to share the same eagerness so we're probably going to need someone in the community to stand up and do this. Bueller? Bueller? Anyone?

cmpitg

#8
How about implementing newLISP inside ANSI Common Lisp? I'm (slowly) doing one with Emacs Lisp.
\"Life is a hack\"

My web log: http://cmpitg.wordpress.com\">//http://cmpitg.wordpress.com