Live data from Hacker News

Risp (in (Rust) (Lisp)) (2019)

stopa.io

1–10 of 15 posts

Re: Risp (in (Rust) (Lisp)) (2019)

#4
It's interesting, but here's the easiest way to evaluate if a Lisp/Scheme implementation article is interesting:

"Does it parse (2 . 3) vs (2 3) aka (2 3 . nil) correctly?"

That little dot which signifies a cons-pair makes implementing Lisp/Scheme oh-so-stupidly-much harder.

Suddenly your printing has to go all the way right before it can make decisions. Your recursions suddenly need to be robust against not being a list. etc.

Re: Risp (in (Rust) (Lisp)) (2019)

#5
post #2

Nicely written article. I too attempted a Lisp interpreter to learn Rust, but gave up when I couldn’t figure out how to implement a linked list in Rust.

The key is to use reference-counters. If you think about it, no lisp is really going to fit the single-ownership model. Many of them are implemented on GC'd languages for this reason. Rc is the standard Rust answer for GC, and in practice means you don't really have to deal with ownership issues for those values.

I implemented my own Rust lisp if you want an example: https://github.com/brundonsmith/rust_lisp

And here's a more general resource (not written by me) on this class of problems and the surrounding subject matter: https://rust-unofficial.github.io/too-many-lists/

Re: Risp (in (Rust) (Lisp)) (2019)

#6
post #4

It's interesting, but here's the easiest way to evaluate if a Lisp/Scheme implementation article is interesting: "Does it parse (2 . 3) vs (2 3) aka (2 3 . nil) correctly?" That little dot which signifies a cons-pair makes implementing Lisp/Scheme oh-so-stupidly-much harder. Suddenly your printing has to go all the way right before it can make decisions. Your recursions suddenly need to be robust against not being a…

> evaluate if a Lisp/Scheme implementation article is interesting

I guess Clojure doesn't count as interesting and/or a lisp then, as `(2 . 3)` would not be parsed correctly and instead throw a syntax error on that form.

I still thought the article was interesting and would have loved to see a section on macros. Maybe next time.

Re: Risp (in (Rust) (Lisp)) (2019)

#8
post #4

It's interesting, but here's the easiest way to evaluate if a Lisp/Scheme implementation article is interesting: "Does it parse (2 . 3) vs (2 3) aka (2 3 . nil) correctly?" That little dot which signifies a cons-pair makes implementing Lisp/Scheme oh-so-stupidly-much harder. Suddenly your printing has to go all the way right before it can make decisions. Your recursions suddenly need to be robust against not being a…

Aren't cons cells just an implementation detail? I have no problem calling "lisp" any language where s-expressions are imlemented by any other tree/list data structure, and thus it doesn't have the dot.

Re: Risp (in (Rust) (Lisp)) (2019)

#9
post #8
post #4

It's interesting, but here's the easiest way to evaluate if a Lisp/Scheme implementation article is interesting: "Does it parse (2 . 3) vs (2 3) aka (2 3 . nil) correctly?" That little dot which signifies a cons-pair makes implementing Lisp/Scheme oh-so-stupidly-much harder. Suddenly your printing has to go all the way right before it can make decisions. Your recursions suddenly need to be robust against not being a…

Aren't cons cells just an implementation detail? I have no problem calling "lisp" any language where s-expressions are imlemented by any other tree/list data structure, and thus it doesn't have the dot.

"Lisp" in fact refers to a set of details for implementing a programming environment. The requirements are wobbly, but not so wobbly that you can call anything "Lisp".

Re: Risp (in (Rust) (Lisp)) (2019)

#10
post #4

It's interesting, but here's the easiest way to evaluate if a Lisp/Scheme implementation article is interesting: "Does it parse (2 . 3) vs (2 3) aka (2 3 . nil) correctly?" That little dot which signifies a cons-pair makes implementing Lisp/Scheme oh-so-stupidly-much harder. Suddenly your printing has to go all the way right before it can make decisions. Your recursions suddenly need to be robust against not being a…

Note that "correctly" means that (2 3 . nil) comes out as (2 3).
Post reply on HN