Skip to main content
GameDev.net gamedev.net
🔒 Locked

'Simple' C Source For Lisp Interpreter?

Started by Extrarius Feb 26, 2003 at 10:40 PM 5 replies 1.8k views
Original Post
Extrarius
Extrarius
I''m looking for a nice easy to read source for a Lisp Interpreter. I need it to be ANSI-C compatable (or at least doesn''t use any OS specific functions and the non-standard ones it uses would be not too dificult to recreate) so I can port it to another OS & Processor (my TI-92+ calculator =-). The smaller the binary is, the better, and the less files it writes to(at runtime) the better (as the TI-92 is a calculator it doesn''t exactly have files. It does have variables that server the same function, but they are somehwat hard to write {not just simple fopen, fwrite, fclose calls}). It doesn''t need to implement all of Lisp, but the more the better =-) There is about 1MB total on the calculator, but only a small fraction(200K) of that is easily writable(800k is flash rom that can be used to store arbitrary applications, but any local variables etc in the code must be stored in the normal RAM to be quickly writable. don''t remeber for sure, but I dont think the code has to be in normal RAM to be runnable. if so, that means 200k total to store the interpreter and all its variables and the lsip code its running {I can keep all but the running lisp source in flash ROM if needed}). The reason I want to do this is so I can mess with Lisp ANYWHERE once I get my book =-) ---------- Almost typo-ified using Extrarius'' AUTOMATIC Typo Generator, but I decided to be nice =-)
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Shannon Barber
Shannon Barber
try google for "smallest LISP interpreter"

The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Extrarius
Extrarius
Okay, I found

(defun lisp ()
(progn
(format t "~S~%"
(eval
(progn
(format t ">")
(read t))))
(lisp)))

Know of an efficient Lisp -> C Compiler? The only one I can find is "CLiCC" and it says it doesn''t support eval. Even if it did I can''t find windows binaries of it and this PC doesn''t have a compiler.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Extrarius
Extrarius
[Bump] I really need to find either C source for a Lisp interpreter or a good Lisp-to-C translator to tranlate the above code.

----------
Almost typo-ified using Extrarius'' AUTOMATIC Typo Generator, but I decided to be nice =-)
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Null and Void
Null and Void
The only small Lisp interpreter I know of is librep. However, it''s probably too ''big'' (complex might be a better word), as it''s meant to run on a unix system (it relies on a couple other libraries, and is partly intended to be compiled into shared objects).

bishop_pass
bishop_pass
These aren''t working for you?

http://www.civilized.com/LispBook/

http://www.ceng.metu.edu.tr/~ucoluk/research/lisp/lispman/node34.html

http://archive.devx.com/sourcebank/directorybrowse.asp?dir_id=863
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in
Extrarius
Extrarius
The first one looks good. Thanks bishop_pass, I searched for a long time and didn''t find any of those.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.