4 ms·
Sorry, I hit the nested comment limit. On MIT Scheme, it used to recommend some older version, specially the first edition, but on Chicken 5 with the SICP relat
by anthk 2mo ago
Sorry, I hit the nested comment limit. On MIT Scheme, it used to recommend some older version, specially the first edition, but on Chicken 5 with the SICP related SRFI's loaded and maybe scm-sicp you can hit an almost 100% compatibility.
On differences, I already said that there's local library overlapping from the own subdialect implementations, such as Chicken Eggs and Guile ice-9 modules, but if you start them with R5RS
or RSR7 standard compatibility flags the differences fade away, altough there are rough edges:
https://doc.guix.gnu.org/guile/latest/en/html_node/R6RS-Incompatibilities.html https://doc.guix.gnu.org/guile/latest/en/html_node/R6RS-Inco...
It's like ANSI C vs C99 but worse.
So I use Scheme for small scripts with S9 (R4RS standard) plus Unix and NCurses related addons.
For learning SICP, I use Chicken 5 with 203 and 216 eggs plus the ~/.csirc and call it done. Most of the R5RS stuff from SICP will run fine under S9 too with tons of patience (and you can maybe adapt the postscript generating Scheme code from the "Computer Abstraction" books for the frame language and just spit out some PS file). It's just basic geometry
with vectors in the end, something SICP will teach you throughly.
If you finish SICP with Chicken you for sure will be able to even adapt the threading Scheme code from the chapters for an R4RS compliant Scheme like S9 as it already has some Unix/thereading support.
Just generate some wrapping functions and call it done :).
It's, for sure a great exercise for Lisp and CS, and far easier to do,
for example, than making a ANSI C compiler being C99 compatible.
Or, as a modern example, backporting modern Rust/Java functions to
older compilers.
On S9 Scheme (s9fes) you could just hack away most of the exercises at blinding speed...
I prefer Common LIsp for bigger tasks (altough you can learn a lot of CS with Gentle Introduction to Symbolic Computation and Paradigms of Artificial Intelligence Programming too), but SICP it's 'harder' and it will put you on God low-level mode making the CL exercises at light speeds despite the design differences between Scheme and CL:
Common Lisp:
(defun hello () (princ "hello"))
(hello)
Scheme:
(define (hello) (display "hello"))
(hello)
The reason on picking CL over Scheme: If the code runs under SBCL, CCL and ECL call it done, it will almost run on every Common Lisp compiler/interpreter, even the commercial ones. Quicklisp (and UltraLisp)
will handle the dependencies itself and CLHS (Common Lisp Hyper Spec) will have everything doccumented on your hands. The editor? Emacs+Slime or Lem, with both have functions to look up functions and autocomplete, with help about a function or library in the spot.
Far better than Scheme in the end for big projects.
Both will teach you iteration vs recursion, anonymous functions (lambdas), closures and so on.