this post was submitted on 13 Nov 2023
1 points (100.0% liked)

Lisp

52 readers
3 users here now

founded 1 year ago
MODERATORS
 

What is so special about the SICP eval-apply loop? What is so enlightening about it?

top 4 comments
sorted by: hot top controversial new old
[–] raevnos@alien.top 1 points 10 months ago (2 children)

Using a metacircular interpreter for lispy languages - one that implements the same language it's written in, allows you to skip the often tedious parsing step by using the host's read to give you a syntax tree, letting you skip to the interesting bits of manipulating and transforming that tree and executing it (eval-apply in sicp terminology). Those bits are foundational stuff for writing an interpreter or compiler for any language, which lots of people find to be interesting projects.

[–] OkGroup4261@alien.top 1 points 10 months ago

I meant what is so universal for all languages? People say that eval-apply loop is the core of every language.

[–] lispm@alien.top 1 points 10 months ago

allows you to skip the often tedious parsing step by using the host's read

READ mostly gives a tree of tokens. This makes it a form of a tokenizer. After we call READ we don't know what the tokens mean: is FOO a variable, a macro, a function, a built-in special form, a type, ... This can only be determined by interpreting/compiling the token tree.

[–] timmem@alien.top 1 points 10 months ago

All the above comments are true but I think to really get a feel for the impact of the read-eval-print loop (REPL) you gotta go back to 1965 and look at how people had to interact with every other language, except LISP. REPL offered an unprecedented level of interaction with a program