←back to thread

466 points pieterr | 7 comments | | HN request time: 1.052s | source | bottom
Show context
alabhyajindal ◴[] No.42158703[source]
I really wanted to like SICP but Lisp throws me off. I love Haskell and Standard ML however! Did others have a similar experience? Might be interesting to read a book similar in spirit to SICP but using a different language as a vehicle (No, I don't want to do SICP in JavaScript).
replies(10): >>42158751 #>>42158826 #>>42159255 #>>42159370 #>>42160603 #>>42160635 #>>42160830 #>>42161196 #>>42162892 #>>42165123 #
1. dokyun ◴[] No.42160635[source]
SICP isn't a book about Lisp, however it uses some of Lisp's unique properties to demonstrate important concepts that other languages can't easily replicate. A book that's meant to be similar to SICP that doesn't use Scheme or Lisp would not be anything like SICP, or at least not teach the same things. Haskell and ML are in my experience much harder to understand than Scheme, so I'm wondering what your difficulty is?
replies(2): >>42160673 #>>42164320 #
2. ok123456 ◴[] No.42160673[source]
There's a SICP edition done in Javascript.
replies(1): >>42160850 #
3. dokyun ◴[] No.42160850[source]
Have you looked at it? It's an abomination. The point of SICP isn't Scheme or the syntax of Scheme, but what it represents. Whoever made the Javascript rewrite didn't understand that. You can't write a metacircular interpreter in Javascript, because Javascript is not homoiconic.
replies(2): >>42161431 #>>42162117 #
4. shawn_w ◴[] No.42161431{3}[source]
I'm pretty sure someone wrote a very basic, very literal scheme to JavaScript transpiler and just ran the book's code through it. The results look nothing like what any normal person would write.
5. wruza ◴[] No.42162117{3}[source]
You can't write a metacircular interpreter in Javascript, because Javascript is not homoiconic.

Is that a downside? I never wrote or used metacurcular interpreter in my life and still don’t know why I had to read about it. Is it an interesting implementation technique of lisp? Yes. Does anyone really need that?

You can rip off that part and everything that follows and that will be enough for a regular programmer. No one itt needs to know how to design metacircular interpreter on register machines.

replies(1): >>42166842 #
6. alabhyajindal ◴[] No.42164320[source]
I don't have a difficulty writing Lisp. It's just not my style. I don't like S-expressions. I understand this is not too big an issue and it's very likely I'll get more comfortable with it given enough time. It hasn't happened yet.
7. shawn_w ◴[] No.42166842{4}[source]
It allows the book to skip things like lexing and parsing and instead go straight to its main course: transforming, executing and compiling syntax trees.