3 ms·
The syntax is probably the only thing left that other languages haven’t copied/implemented? Directly exposing the AST to the programmer is a truly unique Lisp f
by deterministic 4y ago
The syntax is probably the only thing left that other languages haven’t copied/implemented? Directly exposing the AST to the programmer is a truly unique Lisp feature as far as I know.
Maybe the ability to reprogram the Reader is another one that other languages haven’t copied?
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- sargstuff 4y agoWas. AST directly exposed (and can be manipulated during runtime) in python. So 'nada' ({ NIL, NUL, (), "", '' }) still 'lisp' exclusive/inclusive language feature. Python comes close, but NIL, NUL, (), "", '' are different implied types in python. Although, for non-lispers, python does get around () everything without having editor add in () before sending off to lisp REPL process.
- eslaught 4y agoAs the sibling noted, Python has a built-in AST parser [1] which I believe (not 100% sure) is used in libraries like Numba to JIT Python functions [2]. But fundamentally, the difference between built-in and provided as a library is not really as wide as it once was. Rust libraries use a third-party library for parsing code for procedural macros [3] which is pretty pervasive, and as I noted libclang for C++ is a thing (though definitely less common). So at least in my mind, the key difference in Lisp (for languages today) is not so much having this be a capability at all, it's more having it be expressed in terms of data structures lightweight enough that regular Joe programmer can pick them up and use them with relative ease. (Whereas, using Python's AST module and figuring out how to do code generation is definitely more than the average programmer is going to figure out.) Even the reader can be customized in some syntax-ful languages. Terra is not mainstream but it provides this [4]. There are probably others. [1]: https://docs.python.org/3/library/ast.html https://docs.python.org/3/library/ast.html [2]: https://numba.pydata.org/ https://numba.pydata.org/ [3]: https://crates.io/crates/syn https://crates.io/crates/syn [4]: https://terralang.org/api.html#embedding-new-languages-inside-lua https://terralang.org/api.html#embedding-new-languages-insid...
- deterministic 4y agoQuite a few languages can do the same. Including Haskell, OCaml etc. https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial https://wiki.haskell.org/A_practical_Template_Haskell_Tutori... https://ocaml.org/docs/metaprogramming https://ocaml.org/docs/metaprogramming