3 ms·
> Why is this quoting the top-level lambda expression arguments? I suspect mostly because the implementation stumbled into the dynamic binding/lexical binding/
by bsder 5y ago
> Why is this quoting the top-level lambda expression arguments?
I suspect mostly because the implementation stumbled into the dynamic binding/lexical binding/FEXPR traps that hit all the early Lisps.
> Here it becomes clear that, in its most bare essential form, beneath the macros and abstractions, LISP actually has an unpleasant nature where name bindings (or assignments) look like a venus fly trap.
Ayup.
A lot of these problems were addressed by the late John Shutt in his thesis about vau calculus in the Kernel programming language:
FEXPRS: https://en.wikipedia.org/wiki/Fexpr https://en.wikipedia.org/wiki/Fexpr
John Shutt's vau calculus thesis: http://www.wpi.edu/Pubs/ETD/Available/etd-090110-124904/unrestricted/jshutt.pdf http://www.wpi.edu/Pubs/ETD/Available/etd-090110-124904/unre...
John Shutt's Kernel Language--"Revised-1 Report on the Kernel Programming Language" https://core.ac.uk/download/pdf/47187352.pdf https://core.ac.uk/download/pdf/47187352.pdf
The "magic" is that the "$vau" operative closes over the environment when it is defined so that it can execute later in that environment--this is the "static/lexical environment". However, when you actually execute the "$vau" operative, you also pass in the "execution/dynamic" environment so that the code that the "$vau" operative runs can choose to do what it wants with the arguments--do nothing, evaluate them in the lexical environment, or evaluate them in the dynamic environment.
It's a powerful concept, but difficult to compile so got kind of relegated from the Lisp/Scheme languages.
For something which seems to implement it properly, see the "Oh" UNIX shell:
https://github.com/michaelmacinnis/oh https://github.com/michaelmacinnis/oh
https://www.youtube.com/watch?v=v1m-WEZz46U https://www.youtube.com/watch?v=v1m-WEZz46U
I would mumble that the fact that "list" is defined as "cons pairs with a final nil()" is also a pain in the ass. I understand why it was originally done this way, but it makes the idea of a "sequence" abstraction so very much more painful. It's one of the reasons why Clojure dropped it.
- akkartik 5y agoI love chatting about Kernel :D Here's my most recent post: https://lobste.rs/s/d0hogq/problem_with_macros#c_nozcrm https://lobste.rs/s/d0hogq/problem_with_macros#c_nozcrm Thanks for showing me Oh! It really has f-exprs?! I didn't immediately see it in https://github.com/michaelmacinnis/oh/blob/main/doc/manual.md https://github.com/michaelmacinnis/oh/blob/main/doc/manual.m...
- bsder 5y agoSee the video @ 28:51: https://youtu.be/v1m-WEZz46U?t=1731 https://youtu.be/v1m-WEZz46U?t=1731 It's such a shame, but "Kernel" and "Oh" sort of drives home the fact that good ideas also need good marketing to propagate. "Oh!" is also a poster child for "videos suck for searchability and discoverability--post a transcript and your slides." It's particularly bad with "Oh" because he has some truly nifty hacks. The pipeline that is reconfiguring itself as a filter while it's filtering is stunning. The "Transmit the code in one place and execute it in another" is also clever. The thing that dragged me to Kernel was that I needed a small language to be able to debug embedded systems on the fly. So, the interpreter couldn't be hamstrung and I never had a compile step available. I needed both small code and small data. Kernel, the idea, fits the bill. Kernel, the implementations, for some reason all really obscure the point for reasons I'm not particularly clear on. Maybe once I've got it all clear in my head, I'll try to do an implementation in Rust. That should help keep things clean since you can't rely on "metacircular" tricks to implement things.
- akkartik 5y agoI'd love to chat more about it. Email address in my profile. I spent a few years getting inspired by Kernel when I built my fexpr-based Lisp: http://akkartik.name/post/wart http://akkartik.name/post/wart So I'd be happy to answer questions as you have them. Perhaps we can pore over Shutt's dissertation together.