4 ms·
What good meta programming gives you is that a lot of language features can become library features. A good example of be Julia’s differential equation support
by orbifold 7y ago
What good meta programming gives you is that a lot of language features can become library features. A good example of be Julia’s differential equation support or its XLA support. A language like Swift needs to modify its compiler to do similar things.
- cageface 7y agoThis is often not a good thing. You now have to version the library separately from the language itself and deal with dependency issues. Also you get competing and incompatible implementations of things everyone needs. This is exactly why people bag on JS for needing 600 node modules to build anything.
- ddragon 7y agoHaving to handle library versions and long library dependencies isn't a result of a programmable language, it's the result of having better tools for sharing and integrating code without having to reinvent and maintain independently everything for every tool, and that's generally a good thing (even if it has extra steps to solve over having everything imaginable already in the base language). And incompatible implementations are not really exclusive to metaprogramming either. Pytorch, Tensorflow, Numpy and the Python standard libraries are not compatible by default, each has to deliberately create (or not) tools to convert from one type to the other (or build entirely on top of the other). You can argue about the Lisp Curse, in which having a lower entry barrier to make your own tool makes it easier for each create it's own "perfect" one (which is flawed/lacking to everyone else), while languages in which the sunk cost is higher would make people gravitate towards something already created and improve it with their own use case. That's definitely true, but since that's something cultural then it can probably be handled in some way (for example deciding global common interfaces for interoperability, blessed packages for each domain and the most popular extensions of the language being promoted as official language feature after enough deliberation).