4 ms·
It's worth reflecting on why the most popular language in the world has syntax so inflexible that a simple operator like this requires begging some ubercorp for
by gambler 7y ago
It's worth reflecting on why the most popular language in the world has syntax so inflexible that a simple operator like this requires begging some ubercorp for a compiler change. Smalltalk had user-definable binary/infix operators in 1980. They didn't require you to muck around with the compiler at all.
Ironically, JavaScript has the extensibility mechanisms and object-oriented features inspired by Smalltalk that could allow for pretty much the same thing. However, most of the community doesn't seem to even realize that this is a possibility.
- TomMarius 7y agoIt's worth saying that mostly the same companies are building WebAssembly as a solution to this problem.
- jkoudys 7y agoIt's wasm. It could be written in Hindi numerals and unicorn emojis for all I care. So long as llvm can make sense of it.
- xkriva11 7y agoReally? If you would try to do an effective Smalltalk implementation in WebAssembly, you would immediately see that WebAssembly is making things even much worse.
- bjoli 7y agoYeah! As a hobbyI much around with scheme (mostly), Smalltalk (a couple of times a year) and factor (maintaining some old tools I wrote in it). The result is that if I whine, I whine about the choice of language, not about how a particular part of a language sucks. Extensibility like that should be built in, and then probably mostly discouraged. If you really need to scratch an itch, you will be able to do so without resorting to what usually ends up as ugly, non-composable hacks.