9 ms·
Scheme SRFIs make Scheme a much bigger language while also making it painful to use because you have to research which SRFI are implemented in your scheme varia
by hajile 1mo ago
Scheme SRFIs make Scheme a much bigger language while also making it painful to use because you have to research which SRFI are implemented in your scheme variant then map those SRFI numbers to what they actually do then you usually need read the raw SRFI because that's the only documentation around.
R7RS is going on 14 years old and there's still no R7RS-large either. They really need to just take the critical SFRIs, give them names and proper documentation, then call them R7RS-large and move the current work to a future R8RS.
- anthk 1mo agoIndeed. Scheme it's amazing for embedded (such as s9) and its small size. Also, the SICP it's cool to do with Chicken Scheme and this ~/.csirc (and chicken install srfi-203 and srfi-216): (import scheme) (import (srfi 203)) (import (srfi 216)) (define (displaynl x) (display x) (newline)) (define pi (* 4 (atan 1.0))) Even if Chicken has Hypergiant to play with 3D objects, Common Lisp has Kandria, Sketch, Kons-9... From Scheme, after finishing SICP as an Scheme exercise (and CS course), just jump into Common Lisp, and finish both Gentle Introduction to Symbolic Computation and Paradigms of Artificial Intelligence, where you will implement a micro-Scheme in Common Lisp itself as an exercise. SBCL allows you to create working stuff with very few dependencies (uiop and the like from QuickLisp/Ultralisp). With Scheme/Chicken you will get lost in a maze of eggs and SRFI's. And, on CS/academics, if you finish SICP both GITC and PAIP on on Common Lisp will be a breeze and it will give you superpowers with these three books.
- bigfishrunning 1mo agoI guess you mean s7 -- I find s7 scheme fits into a lua shaped hole for scripting larger applications quite well without having to use lua (which is a personal preference). I used s7 scheme for scripting a C program years ago, and moved on to writing programs with chicken scheme. I really think in an alternate universe chicken scheme could fit into the python niche, because the eggs feel very "batteries included". Super excited for this release!
- mywrathacademia 1mo agoAre there official solutions/answers to SICP?
- anthk 1mo agoGithub has several repos, there's one which works for Guile (and Racket for the 2nd lesson), but you can just use Chicken Scheme 5 for all of them. Here are the commands to build the addons needed for Chicken Scheme 5 and SICP compat. You need gcc, make and similar tools on your Unix machine. Install "build-essential" on Ubuntu, Debian and derivatives will just work. chicken-install -s srfi 203 chicken-install -s srfi 216 chicken-install -s trace Then at ~/.csirc (define (displaynl x) (display x) (newline)) (define pi (* 4 (atan 1.0))) (import scheme) (import (srfi 203)) (import (srfi 216)) Displaynl and "pi" are just for convenience.
- mywrathacademia 1mo agoThanks. I’ll look into that. What about SICP solutions that work with MIT Scheme? That’s the implementation of Scheme used in SICP. Also, what are the differences between the major Scheme implementations?
- anthk 1mo agoSorry, 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.