4 ms·
C has macros. They are nothing like lisp macros. Please cite a non-lisp language with macros a powerful as lisp's.
by dreamcompiler 6y ago
C has macros. They are nothing like lisp macros. Please cite a non-lisp language with macros a powerful as lisp's.
- krebs_liebhaber 6y agoElixir. https://elixir-lang.org/getting-started/meta/macros.html https://elixir-lang.org/getting-started/meta/macros.html
- plinkplonk 6y agoJulia
- dreamcompiler 6y agoJulia is lisp in drag so it doesn't really count, but I'll give you the point.
- dTal 6y agoIn what sense is Julia a lisp in drag? I'm just starting in on it it doesn't seem any more lispy than any other dynamic language. In particular I've yet to see a car/cdr.
- JeremyBanks 6y agoRust?
- deleted 6y ago[deleted]
- mumblemumble 6y agoC macros and lisp macros (In particular, I'm thinking of hygienic macros à la Scheme) are two wildly different extremes. In between them lies a huge continuum of interesting things. There are Scala's macros. There are Haskell's language extensions. There are code generators like the ones used to implement much of gRPC, and there are compiler plugins like the ones used to implement aspect-oriented programming in C# and Java. Most of them arguably qualify as being somewhere between an 80% solution and a 90% solution for the practical problems that lisp might solve with macros. They're frequently not anywhere near as convenient to use or understand. But that's arguably a good thing in the long run, because it encourages communities to pool resources and work on a coordinated solution that can be shared by the community. My take on the curse of lisp, for what it's worth, is economies of scale. Lisp makes it too easy (and fun) to just keep your head down and work on your own thing, which hinders pooling of resources.
- loudlambda 6y agoScala, Nim, Clojure, Haxe
- dreamcompiler 6y agoClojure is a Lisp so it doesn't count.
- orbifold 6y agoHaskell, OCaml
- pmoriarty 6y agoThe major advantage of Lisp macros over macros in other languages aren't their power but the fact that using Lisp's macro system is virtually the same as using the rest of Lisp. Lisp macros look like Lisp and in manipulating code via macros you can leverage the rest of Lisp and Lisp's ecosystem. So writing Lisp macros is entirely natural for someone who already knows Lisp. You don't have to learn or use what is effectively a separate language, as you do with every other language that's not homoiconic. As Alan Perlis once said, "Beware the Turing tarpit, where everything is possible and nothing is easy."