Common Lisp newLisp module?

Pondering the philosophy behind the language
Locked
kanen
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

Common Lisp newLisp module?

Post by 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) inside newLisp:

Code: Select all

(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 .

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Common Lisp newLisp module?

Post by cormullion »

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
Posts: 145
Joined: Thu Mar 25, 2010 6:24 pm
Contact:

Re: Common Lisp newLisp module?

Post by kanen »

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 .

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Common Lisp newLisp module?

Post by rickyboy »

<<<Ryon, please delete this post. The post that follows is a copy. Thanks, --Rick>>>
Last edited by rickyboy on Sun May 15, 2011 10:00 pm, edited 1 time in total.
(λx. x x) (λx. x x)

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Common Lisp newLisp module?

Post by rickyboy »

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
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Re: Common Lisp newLisp module?

Post by m i c h a e l »

Hi Rick!
rickyboy wrote: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
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: Common Lisp newLisp module?

Post by rickyboy »

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

tylerdmace
Posts: 3
Joined: Sat Nov 28, 2009 10:55 am

Re: Common Lisp newLisp module?

Post by tylerdmace »

kanen wrote: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
Posts: 10
Joined: Thu May 05, 2011 1:10 am
Location: Hanoi
Contact:

Re: Common Lisp newLisp module?

Post by cmpitg »

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

Locked