Hacker News new | ask | show | jobs
by bobnamob 497 days ago
Generally meta features like macros are _far_ more useful to library authors that need to do some sort of "reflection" on your application code.

Serialization libraries are frequently the largest beneficiary.

In my ideal world I don't need to write macros or use language meta/reflection features while (only) writing code to solve business problems, but to get to that ideal often the libs you use do need reflection capabilities

I'd argue that it's entirely reasonable for the average application/service developer to not appreciate the usefulness of macros. Not everyone needs to be a foundational library author, honestly we probably need fewer (looking at you npm/cargo micropackages)

1 comments

There's also the Lisp philosophy which emphasizes that you are your own libraries' author, too! Third-party libraries can only help you with common business code - anything specific to your domain, or your business, you have to model yourself. Using macros is fundamentally not different than using classes or functions to create an environment[0] where expressing your business logic is straightforward, and invalid states are not representable. Metaprogramming just lets you go further in this direction than "traditional" tools languages offer.

--

[0] - The correct term here is Domain-Specific Language, but by now it's badly overloaded and people have knee-jerk reactions to it...