5 ms·
Scheje: A little Scheme implementation on top of Clojure
- jascii 4y agoSomeone might get the impression that lisps mostly get used to write lisps :P
- AtlasBarfed 4y agoIs this a lisp war or a collective lisp prank? Or just an intellectual circlej... uh, exercise?
- jascii 4y agoThere's actually a long tradition of writing lisps in lisp. The language really lends itself to explorations into experimental language features. Of Course, C's tend to be written in C too, so there's that..
- dgb23 4y agoProgramming languages tend to get programmed in programming languages. The cool part is really how concise this kind of code is in a lisp (from OP): https://github.com/turbopape/scheje/blob/master/src/scheje/interpreter.cljc https://github.com/turbopape/scheje/blob/master/src/scheje/i... It's kind of magical! If someone explained this code in say a programming lecture, they would be compelled to dress like a wizard.
- Jtsummers 4y agoNot dressed as a wizard, but there is a wizard on the cover of this book which has an entire chapter on writing an interpreter like that: https://mitpress.mit.edu/sites/default/files/sicp/full-text/book/book-Z-H-25.html#%_chap_4 https://mitpress.mit.edu/sites/default/files/sicp/full-text/...
- jgwil2 4y agoOr a fez.
- kkylin 4y agoLike this? https://ocw.mit.edu/courses/6-001-structure-and-interpretation-of-computer-programs-spring-2005/resources/7a-metacircular-evaluator-part-1/ https://ocw.mit.edu/courses/6-001-structure-and-interpretati...
- ARandomerDude 4y agoSomebody needs to write a Clojure in Scheme counterpart to this so we can go full circle!
- screap 4y agohttps://github.com/lokke-org/lokke https://github.com/lokke-org/lokke :)
- zackmorris 4y agoClojure in Common Lisp came up a couple of days ago: https://github.com/ruricolist/cloture https://github.com/ruricolist/cloture Discussion: https://news.ycombinator.com/item?id=31655574 https://news.ycombinator.com/item?id=31655574 It should be straightforward to run it in Scheme, which extends Lisp from what I understand, although I only used Scheme in college. I'm not even entirely sure why Schema and Lisp are separate languages, although I've seen some Lisp examples that seemed a bit too low-level to be of practical use. I find that level of attention generally useless when macros and inlined functions provide leverage for free. Although I'm generally against domain-specific languages, so I would like to know if Scheme is a DSL of Lisp or if either can be implemented completely in the other via macros (or both). I'm trying to get to higher-level functional languages likes F#, Haskell and Clojure/ClojureScript. Although once functional languages allow impurity via mutable variables, they effectively throw the baby out with the bathwater since that forces large swaths of the codepath to fall back to being imperative. ClojureScript especially has a nice functional-imperative bridge where the code just blocks on input/output and lets the Javascript runtime run, rather than getting too lost in monads (from what I can tell, I haven't actually written any ClojureScript yet). I feel that this was the fundamental insight that's been missed in pretty much every other language, the lack of which led to the function coloring mess of async/await that we'll spend the next few decades stripping from legacy code.