4 ms·
I've heard a fair amount over the years of Lisp as a great code generating language. I wonder what sort of thinking took place in this intersection between writ
by th0ma5 6y ago
I've heard a fair amount over the years of Lisp as a great code generating language. I wonder what sort of thinking took place in this intersection between writing in a macro language and imagining what the generated language would do, and then the assembler...
- markus_zhang 6y agoCan you elaborate on the part "Lisp as a great code generating language"? Just curious. I tried to learn Scheme for SICP but then switched to the Python version.
- superdisk 6y agoLisp's big strength is that since the program itself is represented in the same form as the data structures, you can very easily generate executable programs by just slapping lists together. I'd recommend going back to the Scheme version-- I initially didn't understand the cool factor of Lisp either, until I used it for a while (and found macros).
- kccqzy 6y agoI definitely recommend you to finish the Scheme-based SICP. Plenty of stuff in the original SICP like metalinguistic abstraction is just awkward or impossible in Python.
- armitron 6y agoThere is no Python SICP. It pains me to see you waste your time with someone's inferior regurgitation/butchering of material written and presented by absolute geniuses that should be considered among the highest forms of art produced in the field.
- andreareina 6y agoIf python didn't have with blocks, I could replicate the behavior by manually writing out a try/except/finally. I cannot write something to do that for me automatically (ignoring eval/exec). Where functions allow abstraction over a sequence of instructions, code generation allow abstraction over syntax, allowing the invention of new language features.
- dunefox 6y agoTo repeat: really study the SICP version, it's so good. https://sarabander.github.io/sicp/ https://sarabander.github.io/sicp/
- jiyinyiyong 6y agoTry Elixir, it supports macros. Also Rust has Macros too. Although Lisp macros is different and may be more old fashion in some aspects, but it won't be hard to get the idea of code generating language, just pick one and try it.