Yeah, it’s kind of a funny question, but I was just wondering…
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
Just curious,
Chris
Yeah, it’s kind of a funny question, but I was just wondering…
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
Just curious,
Chris
For a Lisp interpreter in Ruby, here’s a recipe.
First of all, it’s much easier to write a Ruby
interpreter in Lisp; do that, and then turn the
universe inside-out.
Hal
----- Original Message -----
From: “Chris Pine” nemo@hellotree.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, January 22, 2003 12:51 AM
Subject: Lisp in Ruby?
Yeah, it’s kind of a funny question, but I was just wondering…
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
In article 1c5d01c2c1e2$d76279c0$6401a8c0@MELONBALLER,
“Chris Pine” nemo@hellotree.com writes:
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
10 minutes Lisp (or lambda calculus) interpreter in Ruby:
def eval(exp, env)
case exp
when Array
case exp.first
when :lambda
lambda {|x|
env2 = env.dup
env2[exp[1]] = x
eval(exp[2], env2)
}
else
eval(exp[0], env).call(eval(exp[1], env))
end
when Symbol
env[exp]
else
exp # constant
end
end
p eval([:succ, 1], {:succ => lambda {|x| x + 1}})
–
Tanaka Akira
http://www.ruby-lang.org/raa/list.rhtml?name=rouge
No Joy available, I guess. But you can have a joy of implementing it
by yourself in Ruby
matz.
In message “Lisp in Ruby?” on 03/01/22, “Chris Pine” nemo@hellotree.com writes:
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
“Chris Pine” nemo@hellotree.com writes:
Has anyone written a Lisp interpreter in Ruby?
`rouge’ by Masahiro Sakai.
Massimiliano
wow, Joy is really neat. i don’t know how useful it could really be in general
purpose programming (although i’m sure it is Turing Complete) but none the
less it is a lot of fun. really this is the first language i’ve seen in ages
that is as profound/fundemental as lisp and prolog. very cool. thank you.
if i find the time i may just play with implementing a Ruby version myself,
unless of course you take it on first.
On Tuesday 21 January 2003 11:51 pm, Chris Pine wrote:
Yeah, it’s kind of a funny question, but I was just wondering…
Has anyone written a Lisp interpreter in Ruby? Or even better, a Joy
interpreter?
–
tom sawyer, aka transami
transami@transami.net
.''.
.''. . *''* :_\/_: .
:_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'.
What is Joy, anyway?
I’ve never heard of it.
----- Original Message -----
From: “Hal E. Fulton” hal9000@hypermetrics.com
http://www.latrobe.edu.au/philosophy/phimvt/joy.html
It’s kind of like Lisp written backwards, and without any parenthases. It
looks pretty cool to me. Doesn’t seem like it ever caught on, though.
Personally, I don’t really get Lisp… I’ve never found a good tutorial
for it and haven’t bothered with the bad ones. (Yes, it’s very cool that
you can build a Lisp interpreter in Lisp so easily, but do you really think
the reason I’m not using another language is so I can build Lisp
interpreters faster?! Then why is this always on page 8 of every Lisp
tutorial?)
Uh… why do you think it would be so tricky? Languages like Lisp are known
for their simple interpreters, I thought. I would have guessed you could
just subclass Array and call it LispList or something, add a few methods…
but, like I said, I don’t really understand Lisp yet (or Joy, though I think
it looks much more interesting, at least on the surface), so maybe I just
don’t know what I’m talking about.
Chris
http://www.latrobe.edu.au/philosophy/phimvt/joy.html
It’s kind of like Lisp written backwards, and without any parenthases. It
looks pretty cool to me. Doesn’t seem like it ever caught on, though.
I’ll check that out. If I had invented a backwards Lisp, I’d have
called it Psil. Maybe short for “Parentheses Still Infect Lisp.”
Uh… why do you think it would be so tricky? Languages like Lisp are
known
for their simple interpreters, I thought. I would have guessed you could
just subclass Array and call it LispList or something, add a few
methods…
but, like I said, I don’t really understand Lisp yet (or Joy, though I
think
it looks much more interesting, at least on the surface), so maybe I just
don’t know what I’m talking about.
Actually, I’m probably the one who doesn’t know what he’s
talking about. And my post was 66% in jest anyway, so
just ignore it.
Cheers,
Hal
----- Original Message -----
From: “Chris Pine” nemo@hellotree.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, January 22, 2003 9:34 AM
Subject: Re: Lisp in Ruby?
Good Lisp Tutorial - http://www.psg.com/~dlamkins/sl/contents.html
On Thu, 23 Jan 2003 00:34:14 +0900 “Chris Pine” nemo@hellotree.com wrote:
Personally, I don’t really get Lisp… I’ve never found a good
tutorial for it and haven’t bothered with the bad ones.
Best regards,
Yuri Leikind
Don’t ever slam a door; you might want to go back.
That gave me a chuckle this morning, and for that I thank you. I’m actually
learning Lisp right now just for fun…
I just went to the Joy site and there is a paper there called “Joy: Forth’s
Functional Cousin”. I worked with Forth several years ago and really didn’t
like the feel of it. Forth and Postscript both have the developer loading
things on the stack and popping them off by hand, which is what Joy seems
to do as well. I love the look of Lisp, which seems very logical and
elegant to me. Joy doesn’t give me any Joy, at least not at first glance.
I could be completely wrong, of course, in which case I can be safely
ignored.
Joey
On Thu, 23 Jan 2003 00:55:55 +0900, “Hal E. Fulton” hal9000@hypermetrics.com wrote:
I’ll check that out. If I had invented a backwards Lisp, I’d have
called it Psil. Maybe short for “Parentheses Still Infect Lisp.”
–