6 ms·
Meh. Part of what makes rust appealing over C++ for my current project is that the latter has at least three major target compilers with subtle differences in h
by dhosek 6y ago
Meh. Part of what makes rust appealing over C++ for my current project is that the latter has at least three major target compilers with subtle differences in how they implement things that mean that even staying within the bounds of the standard might result in different outcomes in the code (not to mention the whole mess around dependencies in C++ code). Multiple implementations of a language feels more like a bug than a feature to me.
- seoaeu 6y agoAs best I can tell, C and C++ are the only languages where people are actually happy that there are multiple implementations.
- dsfbjornjaja 6y agoHmmm what about CPython and PyPy?
- tonyarkles 6y agoAs a single data point, I’ve been using Python since 2005 and have never played with PyPy any beyond a quick peek after seeing a conference talk. On the other hand, I use gcc, clang, and MSVC++ on a regular basis. But... I think the reason I care about multiple C++ compilers is mostly because there’s no “one compiler that is ergonomic to use everywhere” and I end up writing better code because of it (eg gcc warning about something clang doesn’t care about). For Python, I mostly just care that it Just Works everywhere (modulo compiler setup for building C modules)
- wongarsu 6y agoAlmost all Python code is written for CPython, and if you run into performance issues you tweak it until it runs on pypy. I'm glad that pypy exists because it forces cpython to do something about performance, but for python overall it's a pretty niche tool.
- dsfbjornjaja 6y agoStill—multiple implementation has an impact on the reference implementation.
- anp 6y agoI think Javascript has many user who think they benefit from competing implementations. I’m not sure the sentiment there seems as strong as in the C++ community, but it definitely exists.
- jokethrowaway 6y agoI'm more annoyed by the inconsistent implementations than anything else (Mostly browsers as server side still sees node being the winner). Not to mention the terrible tooling to make multiple deployment targets possible (webpack, polyfills and whatnot)
- pjmlp 6y agoCount Ada, D, Java and .NET as well.
- e3bc54b2 6y agoWhat about Java? As far as I know, everyone was very happy OpenJDK existed and Oracle eventually relented too. Now we have even more interesting stuff like Graal. Disclaimer : I'm still new and learning Java.
- iudqnolq 6y agoOpenJDK is the original version of Java with a few features stripped out, not a reimplementation. See the History section of https://en.wikipedia.org/wiki/OpenJDK?wprov=sfla1 https://en.wikipedia.org/wiki/OpenJDK?wprov=sfla1
- blacktriangle 6y agoMultiple implementations are great when there's a standard to compare them to, ideally where that standard is backed by a set of tests. The problem is when you have multiple implementations of languages that are effectively defined by their reference implementation, then the alternatives are usually an exercise in frustration.
- lenkite 6y agoJava also has multiple implementations. Great to have a documented language standard!
- creata 6y ago> even staying within the bounds of the standard might result in different outcomes in the code If that's important, why not pretend that your project is in "Clang C++" rather than C++? Clang compiles to at least all the platforms that Rust does. > not to mention the whole mess around dependencies in C++ code Agreed. I feel like the proliferation of header-only libraries is a sign that something's seriously wrong here.
- v8dev123 6y agoIn that sense Democracy is also a bug then. In some ways it's a feature. It's a feature because it makes harder for reverse engineers to know which compiler generated the code. When they figure out the compiler, they can reverse the compiler logic.
- ben0x539 6y agoMaking the job of those engineers harder doesn't sound like a feature.
- v8dev123 6y agoI don't want people even competitors to steal my intellectual property so making job of those reverse engineers harder is a feature not a bug.
- rcxdude 6y agoThis seems like a really odd reason to care about multiple implementations: firstly because it's a steam hammer to crack a walnut (there are much more effective and cheap ways to obfuscate code than just using a different compiler), and secondly because it's not very effective: compiler identification is fairly straightforward, both for experienced reverse engineers and the tools that they use.
- v8dev123 6y agoCompiler identification is not fairly straightforward when you remove all metadata that gives you hints. It gets worse when you fake the metadata. My opinion echoed by many top people in reverse engineering industry. Modern C++ is obfuscated by default due to templates, inlined functions and of course OOP. For example, Marcus Hutchins famously echoed Boost is a cluster fuck of sadness. My point is not about obfuscation anyway but it does helps obfuscation to some extent. It's about reverse engineering the optimized code and recover the original non-optimized code which can have a lot of use-cases. https://www.msreverseengineering.com https://www.msreverseengineering.com had a course on this subject. Experienced ones can reverse everything but my point is that it increase the barrier.
- otabdeveloper4 6y agoMultiple implementations is a fact of life for popular and useful languages. (Not Rust yet.) Standards exist to make multiple implementations palatable. See Python for a stunning example where they botched the standardization effort and ruined the language for good.
- jonnytran 6y agoCan you elaborate on why you think they “botched” the standardization? I don’t know much about the topic, and I’m genuinely curious about what went right and wrong.
- rcxdude 6y agoI'm not very familiar with the details, but I can comment on the results that I see: there's a multitude of python implementations (Jython, ironpython, pypy, stackless python), but only CPython has widespread adoption and there's little overlap between the ecosystems: rarely will python code be written to run on multiple implementations. I think the largest reason for this is that the CPython ecosystem is basically built on a foundation native C code (not just in the standard library but in many of the commonly used packages), and that interface is only starting to get some standardisation, as well as being very tied to CPython implementation details which made it very difficult to implement on other platforms.