473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Lisp in Python as a library (not crossposted)

Apparently there is some kind of toy Lisp interpreter written in Python:

http://www.biostat.wisc.edu/~annis/c...sp/pylisp.html

However, how about extending the idea? I.e., making all the Python
functions callable from Lisp, and having all the objects in Lisp
actually be Python objects (using some classes like cons cells etc.):
-----------------------------
lst = readlisp("""(defun sum (x y) (+ x y))""")

# lst == <cons cell at 0x123>

ns = mk_lisp_namespace() # this has lambda, defun, defmacro & friends

eval (lst,ns)

# ns["sum"] == <cons cell>

def sum2(x,y):
return x+y

ns["sum2"] = sum2

s = evallist("(sum2 2 3)",ns)

# s == 5

---------------------------------

Sounds like a nice way to bring us all the macro power our Lisp
friends glorify so much, and a way to end all the inter-newsgroup
flamewars once and for all :-).

--
Ville Vainio http://www.students.tut.fi/~vainio24
Jul 18 '05 #1
3 1628
On 21 Oct 2003 09:39:04 +0300, Ville Vainio
<vi********************@spamtut.fi> wrote:
Apparently there is some kind of toy Lisp interpreter written in Python:

http://www.biostat.wisc.edu/~annis/c...sp/pylisp.html


Danny Yoo did a basic Scheme or Lisp intrpreter in Python a few
years ago - it may be on the Useless Python website...???
Are you listening Danny?

Alan G.

Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld
Jul 18 '05 #2
In article <3f****************@news.blueyonder.co.uk>, Alan Gauld
<al********@btinternet.com> writes
On 21 Oct 2003 09:39:04 +0300, Ville Vainio
<vi********************@spamtut.fi> wrote:
Apparently there is some kind of toy Lisp interpreter written in Python:

http://www.biostat.wisc.edu/~annis/c...sp/pylisp.html


Danny Yoo did a basic Scheme or Lisp intrpreter in Python a few
years ago - it may be on the Useless Python website...???
Are you listening Danny?

Alan G.

Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld

I wish all the lisp versus python wars would go away, but if they really
want to do 'my language is bigger than your language' then cross
language translation is the way to go. Then they can argue about code
size efficiency etc in some reasonable way. Assuming both languages are
Turing complete probably eliminates most of the arguments anyway.
--
Robin Becker
Jul 18 '05 #3
* al********@btinternet.com (Alan Gauld) in comp.lang.python:
Danny Yoo did a basic Scheme or Lisp intrpreter in Python a few years
ago - it may be on the Useless Python website...???


It can be found here :

<http://www-hkn.eecs.berkeley.edu/~dyoo/python/pyscheme/index.html>

--
DW
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
34
by: nobody | last post by:
This article is posted at the request of C.W. Yang who asked me to detail my opinion of Lisp, and for the benefit of people like him, who may find themselves intrigued by this language. The...
37
by: seberino | last post by:
I've been reading the beloved Paul Graham's "Hackers and Painters". He claims he developed a web app at light speed using Lisp and lots of macros. It got me curious if Lisp is inherently faster...
118
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely...
852
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
14
by: Paddy3118 | last post by:
This month there was/is a 1000+ long thread called: "merits of Lisp vs Python" In comp.lang.lisp. If you followed even parts of the thread, AND previously used only one of the languages AND...
1
by: Martin Rubey | last post by:
Dear all, I'm trying to call from common lisp functions written for Sage (www.sagemath.org), which in turn is written in python. To do so, I tried...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.