4 ms·
I don't think there's a real 'default' Scheme, like Chez is probably the implementation which generates the fastest code, but if I'm not mistaken it only implem
by tmtvl 2y ago
I don't think there's a real 'default' Scheme, like Chez is probably the implementation which generates the fastest code, but if I'm not mistaken it only implements the R6RS spec, Guile is quite performant and supports both R6RS and R7RS Small, Chicken has a bunch of libraries (the 'eggs'), but I think it's R5RS (I may be wrong), and of course GNU/MIT Scheme is what you want to follow along with MIT publications working in Scheme (like Structure and Interpretation of Computer Programs, Structure and Interpretation of Classical Mechanics, and The Art of the Propagator). There's also Gauche, which I believe is the most conformant implementation to the various Colour Dockets for R7RS Large (Gerbil may also be fully conformant).
- wbl 2y agoRacket is now built around Chez.
- pjmlp 2y agoWhich was a great idea, bootstraped languages always takes the usual "but you depend on XYZ" that haters always bring into the discussion. Additionally they allow to prove a point. For example, is writing compilers systems programming or not?
- gus_massa 2y agoYou can download a package to use R7RS Small in Racket. https://github.com/lexi-lambda/racket-r7rs https://github.com/lexi-lambda/racket-r7rs
- eru 2y agoThanks for the context! It's been a while since I did serious work in the Lisps. (I've moved on to the ML family.) > [...] GNU/MIT Scheme is what you want to follow along with MIT publications working in Scheme (like Structure and Interpretation of Computer Programs, Structure and Interpretation of Classical Mechanics, and The Art of the Propagator). Definitely, though I suspect if you need a language that's exactly what's written in the text, you are probably missing the point? At least for SICP, I haven't looked into the others as closely. (Part of) the point being learning wider concepts. I almost feel like you get more out of the book, if you do the exercises in a mix of JavaScript and Python. Not because those are better languages, just the opposite: because it forces you to understand the concepts well enough to translate them.
- Y_Y 2y agoIn SICM they frequently make use of a kind of implicit applicative lifting (I can't remember what they call it) where you apply a vector-of-functions as if it were a function itself. In psuedo-Haskell: lift :: Vec (a->b) -> (a->Vec b) lift [] a = [] lift f:fs = (f a):(lift fs $ a) so that you can write natural-looking multidimensional physics expressions like ((fx fy fz) r) without having to invoke macros or restructure the expression to please the compiler. I dearly wish you could do this in another scheme but so far I haven't found one. Iirc it's required for using the magnificent `scmutils` package too. For example, `guile-scmutils`[0] says: > Functionality not available in the port: > Scheme extension to allow applying vectors/structures as procedures. For example rather than 1 ]=> (pe ((up (literal-function 'x) (literal-function 'y)) 't)) (up (x t) (y t)) > you must use guile> (pe ((lambda (t) (up ((literal-function 'x) t) ((literal-function 'y) t))) 't)) (up (x t) (y t)) [0] https://www.cs.rochester.edu/~gildea/guile-scmutils/ https://www.cs.rochester.edu/~gildea/guile-scmutils/
- pona-a 2y agoClojure has a really nice `juxt` function for that, which I have an implementation of in my `.guile` file. (define (juxt . fns) (lambda args (map (lambda (fn) (apply fn args)) fns)))
- Iceland_jack 2y agolift = sequenceA @[] @(a ->)
- Y_Y 2y agoDid you do that by hand? I guessed you used the classic `pointfree` program, bit that gave lift = fix ((`ap` tail) . (. head) . flip ((.) . liftM2 (:))) As far as I know it's not possible to get this functionality in Haskell even with clever instance magic, but I'd love to be proved wrong.
- Iceland_jack 2y ago
- shawn_w 2y agoFor SICP, the best option is probably Racket with the sicp language package. I can't recommend MIT Scheme for anything these days; it's just missing too many things that I feel are required for real work in Scheme, and has too many idiosyncrasies and quirks. Even using it to run a standalone program written in Scheme is a pain.