5 ms·
The “wackiest” Lisp embedding I have seen is of femtolisp [1] into Julia [2] to drive the language parser [3]. In hindsight, this is a fairly sensible design de
by ninjin 8y ago
The “wackiest” Lisp embedding I have seen is of femtolisp [1] into Julia [2] to drive the language parser [3]. In hindsight, this is a fairly sensible design decision, but it did blow my mind when I first spotted it.
# julia --lisp
; _
; |_ _ _ |_ _ | . _ _
; | (-||||_(_)|__|_)|_)
;-------------------|----------------------------------------------------------
> (apply cons '(1 2))
(1 . 2)
[1]: https://github.com/JeffBezanson/femtolisp https://github.com/JeffBezanson/femtolisp
[2]: https://julialang.org/ https://julialang.org/
[3]: https://github.com/JuliaLang/julia/blob/d76a30a7178dd1e9b74430302bf06ec5b28e20c3/src/julia-parser.scm https://github.com/JuliaLang/julia/blob/d76a30a7178dd1e9b744...
- nickpsecurity 8y agoA lot of people liked Lisp concepts but couldn't stand the syntax. One thing I keep telling people to try is wrap it in a better syntax hiding the ugly parts. Seeing Lisp in Julia, a language mainstream developers might embrace, brought a big smile to my face. Need more attempts. :) Another language that tried this with a syntax change was Dylan. People interested in that can try OpenDylan.
- Syzygies 8y agoI've been coding for years using a preprocessor that eliminates most parentheses: Indentation implies parentheses. A pipe "|" opens a parenthesis that auto-closes at the end of that line or at the next ")". A dollar "$" opens a parenthesis that auto-closes when the indentation recovers. The result has a lighter, more poetic look than any language I know, and the parentheses that are left actually matter, so I pay attention to them. I've seen other proposals online, but they felt untested to me. Leave out either "|" or "$" and the above system gets clumsy. I check for the equivalent of "$" in other proposals exactly as I check for marrow in a stew recipe: Did they really think this through? One can't change existing habits. An idea that appeals to me: Write a Lisp preprocessor for Rust, and happen to use this syntax.
- drmeister 8y agoLisp without s-expressions is like bathwater without a baby. S-expressions enable homo-iconic macros and make compile-time computing super easy! I spent 35 years programming in C and C-like languages and then developed my own Common Lisp implementation (http://github.com/clasp-developers/clasp.git http://github.com/clasp-developers/clasp.git) - the only Common Lisp that interoperates with C++ and uses llvm as the backend. When I started with lisp I wrestled with the syntax and sweet-expressions and just decided to let it go. Now I've found language love all over again! In a world that runs on Javascript, nobody should be able to complain about a few measly parentheses. Obligatory relevant XKCD comic: https://xkcd.com/297/ https://xkcd.com/297/
- zem 8y agoyou get all the good properties of lisp with a syntax that leaves some parentheses implicit but unambiguous (meaning that a preprocessor can add them back as the first step).