7 ms·
I think multiple implementations is more or less a C/C++ thing. If you look at other platforms (Ruby, Python, PHP, Haskell, Java, Go, Rust, Scala, Lua, Perl) t
by camgunz 8y ago
I think multiple implementations is more or less a C/C++ thing. If you look at other platforms (Ruby, Python, PHP, Haskell, Java, Go, Rust, Scala, Lua, Perl) there's basically _the_ version and maybe some ancillary implementations.
In fairness, it's hard enough to build a language people use that solves real problems. Asking someone to do it more than once, or to do it once but create specific enough documentation and tests so someone else can also do it -- and then get someone else to do it -- is practically impossible.
- asfasgasg 8y agoThe difficulty, huge though it is, is secondary to the lack of utility. Even with C, for a long time there was only a single viable, mainstream compiler on any given platform. Clang being the main exception today.
- RossBencina 8y ago> Even with C, for a long time there was only a single viable, mainstream compiler on any given platform. I don't think this is even remotely true. On Windows in the 90's we had Borland, Watcom, Microsoft compilers. Today there is at least MSVC and icc. On Mac there was Think C, Metrowerks Code Warrior, and others. For embedded systems there are multiple commercial compiler vendors, as well as the open source tools.
- asfasgasg 8y agoIt's been a minute since Borland or Watcom were mainstream C compilers on Windows. Consider the year between ~2000-2015. Based on my recollection, it seems like MSVC was used at least 75% of the time, with the other compilers each having a small slice of the remaining quarter. Today, very seldom do you encounter a program that was compiled with anything other than MSVC, although with Clang that's starting to change. I don't know too much about the history of Mac compilers. You may be right. Back in the days, it was easier to make a competitive C compiler, because the accretion of advantages to the dominant compilers was not so large. Today, the moat is too wide and too deep. There's also no reason to build a new compiler, because nobody is going to pay you for it unless it's substantially better than the free ones, which by this point are pretty damn good.
- sanxiyn 8y agoI use many programs compiled with GCC on Windows. MinGW works.
- asfasgasg 8y agoI'm sure you can find someone who uses many programs compiled with TCC. That tells me little about the actual prevalence of programs compiled using various compilers.
- sanxiyn 8y agoI believe NumPy Windows binary is built with MinGW. NumPy is used enough that it is more than "very seldom".
- filmor 8y agoPython C extensions are (supposed to be) compiled with the same compiler as the Python interpreter you are building against was, which in case of the official python.org release is MSVC, see https://wiki.python.org/moin/WindowsCompilers https://wiki.python.org/moin/WindowsCompilers.
- tavert 8y agoAnd that choice of compiler has caused endless headaches for the NumPy and SciPy communities, see e.g. https://github.com/numpy/numpy/wiki/Numerical-software-on-Windows https://github.com/numpy/numpy/wiki/Numerical-software-on-Wi... and https://mingwpy.github.io/motivation.html https://mingwpy.github.io/motivation.html VLC's windows binaries are also built with mingw-w64 gcc last I checked, that is likely used even more widely than numpy.
- justincormack 8y agoGo and CGo both require gcc on Windows.
- JdeBP 8y ago
- kazinator 8y agoIt may not have been true on Wintel PC's, but on embedded platforms, it's very common to there be only one C compiler.
- lispm 8y ago> On Mac there was Wasn't Apple using their own MPW C compiler?
- consto 8y agoDon't forget that JavaScript also has multiple fairly popular implementations.
- camgunz 8y agoEhhhhhhhh kind of. Wake me up when node (or something like it) runs on SpiderMonkey, or Electron runs on JavaScriptCore, or you can pick Chakra on Lambda. The whole point is "there's a major version most people use, and sometimes there are competing versions that are significantly different that significantly fewer people use". That's definitely the case w/ JavaScript.
- Vinnl 8y agoYou have been able to run ChakraCore on Node for a bit now, with potentially more engines to follow. That can presumably later also have ramifications later for Electron and Lambda, both of which are built around Node.
- camgunz 8y agoHey I don't disagree that options exist. But I think Chakra on Node is extremely niche and almost no one uses it (despite being possible for over 2 years now). My entire thesis is that multiple equivalent equally (more or less) popular implementations is primarily (maybe only) a C/C++ thing. There are niche languages where this is the case, but they're very niche. There are also very niche implementations of popular languages or platforms, but no one uses them. We extol the virtues of multiple implementations because it makes the ecosystem healthier, but is that even really true? Is Python's ecosystem unhealthy because theres no full alternative to CPython? Is Java's? Is serverside JS? I generally think we haven't thought through the implications of the virtues of multiple implementations -- mostly I think the opportunity costs are bananas. Platforms that at all approach C/C++'s progress on this issue have longstanding standards committees and corporate-backed engineering teams. It's simply infeasible and a hugely bad decision to build multiple implementations if you don't have that, which, it turns out, almost no language devs do.
- mepian 8y agoCommon Lisp has at least four high-quality implementations (Allegro, Lispworks, SBCL, Clozure), and this is a fairly large language (thousand something pages of the ANSI specification + two chapters of AMOP) that is about as popular as Haskell if not less.
- taeric 8y agoThe days of having multiple implementations does seem to have waned heavily. In large, it seems companies taking ownership of languages destroyed this mindset. Though, I confess I have not made an official study of the topic to back that claim up.
- didibus 8y agoDo they all have a differentiator?
- mepian 8y agoAllegro and Lispworks are proprietary with product support provided by the vendors, SBCL and Clozure are opensource. Allegro and Lispworks have their own IDEs and some proprietary libraries bundled in (e.g. CAPI which is probably the best option for cross-platform GUI for this language), while SBCL and Clozure both rely on SLIME and Quicklisp. SBCL produces fastest x86-64 machine code, as far as I know. Clozure has superior macOS support, as it used to be owned by Apple before they spun it off and was generally Mac-centric throughout its history.
- malkia 8y agofor lua, there is reference lua, luajit, https://www.havok.com/wp-content/uploads/Havok_Brochures/Havok_Script_2015.pdf https://www.havok.com/wp-content/uploads/Havok_Brochures/Hav... and possibly some other.
- camgunz 8y agoLua has a special place in my heart for several reasons, but their suggested usage is to just include the source code in your application because they don't guarantee compatibility at all between minor versions. As far as they're concerned, Lua 5.0 is completely different from Lua 5.1. It has a certain charm and I personally think it's pretty cool, but each different Lua release is like the perfect case of, "there's really only the one implementation of this, use others completely at your own risk, p.s. they almost certainly aren't fully compatible". Hell LuaJIT might be more popular than Lua 5.3, and it _definitely_ isn't compatible with it.
- stcredzero 8y agoSmalltalk had multiple competing implementations.
- ppseafield 8y agoFor Rust and Go, they're very new languages, so multiple implementations are going to be hard to come by. Although there is gccgo. Some of those you listed though have a lot of different implementations. Ruby has the Ruby MRI, JRuby, among others. [0] Additionally it spawned a lot of Ruby-like languages on different platforms. Python has the standard Python (Pick 2 or 3), PyPy, MicroPython, unladen_swallow, Stackless Python, IronPython, Jython, among others [1]. PHP has had the reference implementation, Zend Engine, HipHop and HHVM (Both from Facebook), among others [2]. As another comment mentioned, Javascript has V8, SpiderMonkey, Chakra, and JavascriptCore, all with their own quirks. [3] [0] https://github.com/cogitator/ruby-implementations/wiki/List-of-Ruby-implementations https://github.com/cogitator/ruby-implementations/wiki/List-... [1] https://wiki.python.org/moin/PythonImplementations https://wiki.python.org/moin/PythonImplementations [2] https://en.wikipedia.org/wiki/PHP#Implementations https://en.wikipedia.org/wiki/PHP#Implementations [3] https://en.wikipedia.org/wiki/JavaScript_engine#JavaScript_engines https://en.wikipedia.org/wiki/JavaScript_engine#JavaScript_e...
- camgunz 8y agoNone of these (maaaaaybe with the exception of the JS engines) are the same as clang vs. GCC (vs. MSVC), which are mostly equivalent. There are significant compatibility differences between, for example, JRuby and YARV, or Python and PyPy. You can argue compiler extensions and so on, but I think that's out of scope. As far as spec'd C/C++, it's hard to find significant incompatibilities... actually are there any?
- pietroglyph 8y agoThis article specifically references not having to deal with cross-compiler differences as a monoculture advantage. So there are _differences_, perhaps not incompatibilities.
- camgunz 8y agoOP is pretty light on details, but GCC and clang keep up with standards amazingly well (who knows about MSVC). I'm sure there are bugs, but what even are they? Is there a list? It's definitely not at all like the difference between Python and Jython, or even Python 2 and 3. Or if you want an even better example, look at JS benchmarks for different kinds of loops. Every engine is different. How completely bananas is that. Differences like these are a whole other universe compared to differences in the major C++ compilers.
- kazinator 8y agoPascal thing, Lisp thing, POSIX shell thing, Awk thing, Javascript thing, Vi thing, ...