3 ms·
My favorite metric for language complexity is: How many distinct Turing-complete languages exist in this language? On this metric, Go scores 1 (just Go itself)
by majewsky 10y ago
My favorite metric for language complexity is: How many distinct Turing-complete languages exist in this language?
On this metric, Go scores 1 (just Go itself), and C++ scores 3 (C preprocessor, C++ itself, C++ templates).
- bbatha 10y agoGo scores infinity actually. Go generate is a part of the language, which means that you can bring your own Turing-complete language to the party. Reflection especially with plugins, are essentially another language that is even more difficult to track down than macros (or templates). Though you can at least write Reflection using go.
- Vendan 10y agobut go generate isn't a part of the standard build process. If we go to that level, I can just say "most things that use C++ have a Makefile, so that's infinite too".
- gue5t 10y agoC preprocessor alone is not turing-complete; you have to repeatedly apply the preprocessor (until you get a fixpoint or decide the program won't halt) to perform arbitrary computation.