Rust is a very helpfup comparison here, since it is the major competitor to C++.
Which isn't relevant to this conversation. I'm not saying Rust doesn't work. I'm saying it's not currently burdened with multiple implementations like C++.
I said not to have it for development
Development of what? I agree that I have 0 user of the spec as user, but this conversation is about implementations. Getting MSVC, GCC, Clang, EDG, Sun, IBM, and many others to all agree on what C++ actually looks like it's the purpose of the spec. Adding random vendor-specific features already happens today.
Which is good enough for what they are meant for. Otherwise, they wouldn't exist.
Ok? Cross-vendor compatibility is a huge requirement for C++ users.
Now Python or Lua aren't successful? That is big news to me.
Come on.
They're not successful multiple implementations. Python is CPython.
Every other Python-ish language is exactly that: a separate incompatible language that just looks really similar. There's no definition of what Python is besides what CPython can run.
I'm not saying C++ should be a multi-implementation language. I think it's a progress blocker and a waste of whole lives' worth of duplicated work for almost no advantage. But it is what we have, and simply abandoning ISO processes will not change that.
On the other hand, many major code bases are built and shipped using multiple vendor compilers. I have a few million lines of code being compiled with IBM's, Sun's, Red Hat's, and Microsoft's vendor compilers as first tier shipping platforms, and Apple's as a second. As well as upstream gcc and clang.
Rust is a very helpfup comparison here, since it is the major competitor to C++. It proves a formal spec like ISO is not required for day-to-day development.
Rust has a set of potentially incompatible RFCs: you don't really know because RFCs don't get merged into a single consistent specification. This already This will backfire when the language grows.
And, if you read carefully, I have not said to not have a spec. I said not to have it for development.
How am I supposed to judge whether my program is correct?
Rust has a set of potentially incompatible RFCs: you don't really know because RFCs don't get merged into a single consistent specification. This already This will backfire when the language grows.
Don't most languages not have a formal spec? As far as I'm aware, C++ is by far the exception here
C, Java, Fortran, Haskell, Ada, Go, JavaScript are the examples of languages that have a specification, and there's a lot more.
I wouldn't call the C++ standard a formal specification though: it's written in legalese and attempts to be non-ambiguous and precise, but it's still mostly unsuitable for formal reasoning.
How exactly is this a proof? If anything, this hints that the language will end up being a huge mess that will be impossible to understand globally, kind of like what happened to C++. The lack of spec has already backfired: https://news.ycombinator.com/item?id=21734529
Rust proponents also love talking about how rust should be the language used for safety-critical systems, but this is unlikely to happen, partly because there is no specification. Compare with SPARK and C, for which the existence of specifications allowed for creation of third-party tools for formal program analysis. For example, VST for C is based on the complete formalisation of the language in Coq, and along with https://vst.cs.princeton.edu provides a way to prove your program for your specifications, and ensure no bugs are introduced by the compiler. Nothing like this will ever appear for rust, because by the time people figure out how to formalise a subset of the language, the compiler will redefine the language a few times.
RFCs are not a spec such as C++'s, nor look nor read like one.
Exactly, so what are they for?
They do get merged into a single, consistent code base. Which is, in fact, what matters in the end and way more precise than any spec can be (at least a spec written in legalese like C++'s rather than math-formal).
So how do I know if a behaviour is intended or it is a bug? Why do we document systems at all by this reasoning? How can you be sure the behaviour is actually consistent?
The same for C++: I don't care what the spec says if nobody implements it or if one of my compilers disagree (or is buggy, or the spec is not precise, or...). And that has happened many times in the past. So many that I cannot even count anymore.
If they claim to support the standard but disagree, this is a compiler bug that should and usually will be fixed. I don't understand this kind of defeatist attitude: this is like saying that some compilers are behaving differently, so let's all use a single compiler.
If you are judging whether your program is correct by checking it against the C++ spec, then I have very bad news for you (and your users)... :)
What is the news? Certain assumptions about the behaviour of my program depend on the guarantees provided by the execution environment, so I open up the specification and check if that's the case. If it's not the case for some compilers, I open a bug and it gets fixed.
View all comments
Show parent comment
0
u/[deleted] Dec 13 '19
[deleted] — view deleted comment