4 ms·
There are macros in other languages but nowhere will they merge with the language as effortlessly as in the case of Lisp's syntax. The way Lisp is structured m
by lordgroff 4y ago
There are macros in other languages but nowhere will they merge with the language as effortlessly as in the case of Lisp's syntax.
The way Lisp is structured means that almost certainly if you're missing language feature X you can bolt it on, stacking the new features on top of each other to make whatever abstraction you see fit.
It's the kind of thing that makes a Lisp head amused when someone talks about the genius of C# and LINQ (as an example). If you need an abstraction in Lisp, you can almost certainly build it in an ergonomic fashion that just doesn't have a parallel in other languages.
It's one of those powers you don't fully appreciate until you have it and then every other language seems hilariously inadequate in comparison. With great power cones great responsibility and it can all crumble with a lack of discipline (hence why I'm also a fan of ridiculously restrictive languages like Go), but honestly the sort of meta programming possible in Lisp has no equal I know of.
- michaelsbradley 4y agoMaybe try Nim. It's a statically typed compiled language and sports a macro system that allows for direct manipulation of the AST. If you don't need to write full blown macros, Nim also offers templates, which are a simpler form of Nim's macros: simpler to write, but not quite as expressive. https://nim-lang.org/docs/manual.html#macros https://nim-lang.org/docs/manual.html#macros https://nim-lang.org/docs/manual.html#templates https://nim-lang.org/docs/manual.html#templates