Earlier quoted context omitted.
The NetBSD people vehemently disagree. By ensuring your software works on various architectures, you expose subtle bugs in the ones you actually care about. Lots of 32-bit x86 code was improved during the migration to 64-bit, not because the move created new bugs, as because existing ones (i.e. code that relied on undefined behavior) couldn't get away with it anymore.
I wouldn't call their bugs. If the binaries worked correctly on x86 due to compiler specific guarantees then the code wasn't buggy. It just wasn't written for a generic C or C++ compiler.
Linus Torvalds on Why ARM Won't Win the Server Space
351–360 of 545 posts
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#352Earlier quoted context omitted.
This honestly depends on what undefined behavior we are talking about. Sometimes it will be guaranteed to behave a certain way on a compiler. A few will also be the same across compilers if your compiling for the same architecture. However, I do agree that cross compiling is good for finding bugs like this. And really if we are letting the compiler or architecture define undefined behavior, I find it better to break…
> This honestly depends on what undefined behavior we are talking about. Sometimes it will be guaranteed to behave a certain way on a compiler. That is implementation defined, not undefined, behavior.
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#353This will be Linus "640kb ought to be enough for everyone", except that Gates didn't actually said that, and Linus actually wrote this. Someone please tell him what LLVM bytecode is, probably he doesn't know because he uses GCC, Apple showed recently how that can leveredged in scale, with Apple Watch's architecture change overnight. ARM and RISCV are here.
Everyone's first thought (including the other two answerers here!) was that this would allow Apple to change processors entirely: if they wanted to make an Intel iPhone, for instance, they could just tell the App Store to start converting apps' bitcode to Intel machine code instead of ARM machine code for the new phones, and every app would instantly be "updated" for the new processor.
But in practice, this doesn't seem likely. Even with LLVM's unusually clean separation between frontend and backend, the frontend actually does know certain things about the processor it's targeting (mainly details about its memory layout, or special processor features it can use to make certain code faster). These things get baked into the bitcode, and in practice ensure you can't really mix-and-match frontends and backends as freely as you would like. So suddenly switching processors entirely probably isn't in the cards.
What's more likely is that it will allow Apple to make smaller improvements to their processors and then roll them out to existing apps. ...
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#354Re: Linus Torvalds on Why ARM Won't Win the Server Space
#355Earlier quoted context omitted.
Well nobody uses NetBSD so... Sure portability increases code quality, but at what cost to time to market which seems to be the primary concern for most developers these days?
NetBSD (and NetBSD code) is used pretty much everywhere. The internet pretty much runs on it.
Is there a major router vendor or something else that uses NetBSD in a big way?
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#356Earlier quoted context omitted.
This honestly depends on what undefined behavior we are talking about. Sometimes it will be guaranteed to behave a certain way on a compiler. A few will also be the same across compilers if your compiling for the same architecture. However, I do agree that cross compiling is good for finding bugs like this. And really if we are letting the compiler or architecture define undefined behavior, I find it better to break…
> This honestly depends on what undefined behavior we are talking about. Sometimes it will be guaranteed to behave a certain way on a compiler. That is implementation defined, not undefined, behavior.
The spec also does mention implemtation defined behavior. However, undefined things still need to be handled.
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#357Earlier quoted context omitted.
Node and Ruby applications do fail on ARM though, when it comes to native libraries and extensions. And now your whole distro is different than your development machine, which adds complexity. Do I really want to be debugging why node-gyp fails to compile scrypt on the ARM distro on the new Amazon A1 ARM instance (which it did in my case)? And if I solve that, what about the other 2451 dependencies? Let's pessimistic…
I'm suffering through this now -- I have a custom C++ Node exception that needs to run on both x64 and ARM. The ARM cpu is onboard a mobile robot, where I care about power draw. The good news is that Clang can cross-compile fairly easily. Much better than gcc. The bad news is that there are a surprising number of missing libraries on Ubuntu/ARM64. For example, Eigen3. And although the code is fairly compatible, there…
Unfortunately C++ code is only portable if it is free from undefined behavior. Fortunately there are many tools now to debug these kinds of errors: https://blog.regehr.org/archives/1520
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#358Earlier quoted context omitted.
The NetBSD people vehemently disagree. By ensuring your software works on various architectures, you expose subtle bugs in the ones you actually care about. Lots of 32-bit x86 code was improved during the migration to 64-bit, not because the move created new bugs, as because existing ones (i.e. code that relied on undefined behavior) couldn't get away with it anymore.
I wouldn't call their bugs. If the binaries worked correctly on x86 due to compiler specific guarantees then the code wasn't buggy. It just wasn't written for a generic C or C++ compiler.
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#359Earlier quoted context omitted.
On a related note, if Apple does switch to ARM chips for their laptops, that will make mainstream ARM server-side development more viable than any cross-platform story ever can. Or kill the Mac desktop. One or the other :)
I consider myself a pretty average Mac user, and I've already been turned off by the last couple rounds of Macs that Apple has shipped. Messing up the one remaining upside, x86 compatibility, would be be the straw that broke the camel's back. They still only have single digit market share in desktop computing, this could be the death blow for their platform.
Re: Linus Torvalds on Why ARM Won't Win the Server Space
#360Earlier quoted context omitted.
> I think I'll side with Linus on this one. I saw first-hand how non-existent the x86 Android market was, despite Intel pouring megabucks into the project. Doesn't that refute Linus' argument, not strengthen it? Almost all Android developers develop on x86. Intel thought, as Linus apparently does, that this would drive adoption of x86 on phones. It didn't. Intel even got competitive in power efficiency and it wasn't…
Phones are different than servers though. The primary customer of a phone is Joe Somebody who doesn't know or care about architectures, only battery life and cost. Well ARM wins there. The primary customer of servers is developers who care less about cost and more about time to market.