| ▲ | maplant 6 hours ago | ||||||||||||||||||||||
I think people underestimate how pragmatic meta programming can be because there are some obvious downsides. Arguably one of things that made Rust so popular was its inclusion of procedural macros. But beyond that the thing I don't understand about the modern hate towards macros is that they are simply very fun. | |||||||||||||||||||||||
| ▲ | bccdee 29 minutes ago | parent | next [-] | ||||||||||||||||||||||
Yeah I strongly agree. I think the issue is that metaprogramming is complicated, so people (especially early in their careers) tend not to do it themselves, and only notice it when it's making their lives difficult. But there are a lot of cases where a little bit of judicious metaprogramming makes life MUCH easier. If you treat metaprogramming as a first-class tool, countless rough edges will smooth themselves out for you—everything from `#derive[Clone]` to `#derive[Serialize]`. | |||||||||||||||||||||||
| ▲ | shpongled 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
As someone who is "into" programming languages (and making toy implementations of them), I think some of the most important macros are along the lines of Rust/Haskells `derive/deriving` for quickly enabling serialization, printing etc. Using a language without such capability quickly becomes frustrating once you move to any kind of "real" task. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | nine_k 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||
Ruby, Python, and Typescript use metaprogramming rather heavily. They lack the homoiconic property of lisps, but they can do both higher-order functions and monkey-patching. Meta-heavy code usually offers a nice DSL, but is proportionally harder to drill down through. | |||||||||||||||||||||||
| |||||||||||||||||||||||
| ▲ | pjmlp 3 hours ago | parent | prev [-] | ||||||||||||||||||||||
And yet we have done it across most modern languages, with a lesser experience as Common Lisp or Scheme. | |||||||||||||||||||||||