5 ms·
It has metaprogramming via macros: https://crystal-lang.org/reference/syntax_and_semantics/macros.html https://crystal-lang.org/reference/syntax_and_semantics/m
by 1337_d00dZ 6y ago
It has metaprogramming via macros: https://crystal-lang.org/reference/syntax_and_semantics/macros.html https://crystal-lang.org/reference/syntax_and_semantics/macr...
- block_dagger 6y agoTrue, but one of the selling points of Ruby to begin with is runtime metaprogramming. Sure, it should generally be discouraged, but when it's heavily utilized by ecosystems like Rails, it becomes a primary feature that macros do not adequately address.
- brigandish 6y agoAre you saying it's a primary feature for Rails or for Ruby? I can't think of an example where it's a primary feature for a user of Rails but I usually avoid it in favour of better tools so I might not know of them. Perhaps you know of some?
- sourdoughness 6y agoRails leans on meta programming for a lot of its magic (though less so than it used to in early versions). You don’t generally use it as a user of Rails, though.
- brigandish 6y agoThen I don't see how they're any better than macros in that situation.