DEV Community

Discussion on: Where do you stand on "magic" within languages and frameworks?

Collapse
 
armousness profile image
Sean Williams

I only like magic when it's fully expressible within the language itself. For example, Rust has a println! macro that lets you put terms in the format string, and the terms are typechecked. However, Rust's macro system is available to the programmer, so you could reimplement println! if you were so inclined.

I guess the broader point here is, languages should focus more on allowing robust metaprogramming. Nearly all magic is metaprogramming, but this means in most languages you're stuck with the magic the language developers/maintainers thought you deserve.