News for hackers. Stuff that matters.
Re:C Is Not a Low-level Language (2018) by topspin on Thursday December 26, 2019 @10:41PM (#21888979)
Intel and HP attempted to deliver what this paper advocates. They designed an entirely new processing element and compiler architecture that promised to deliver high performance with less complexity. It was called EPIC and manifested as Itanium. Billions of dollars and the best minds at the disposal of an industry wide consortium couldn't make it work; one year ago the last Itanium shipped. The market has spoken.

You can run unmodified, compiled OS/360 code from the 1960s on a z15 machine built this year. The market values the tools and code it has invested in far more than any idealized computing model you care to speculate about.

The flaws in contemporary CPUs that device manufacturers perpetrated on their customers for almost 20 years are not the fault of C and its users. They are the fault of reckless manufacturers that squandered their reputation in the name of performance and, ironically, helped perpetuate the lack of innovation in programming techniques called out in this paper.

Re:C Is Not a Low-level Language (2018) by ngneer on Thursday December 26, 2019 @11:21PM (#21889154)
So true. The Spectre and Meltdown flaws have nothing to do with the abstract machine that a processor implements. You might as well claim that the vulnerabilities are the result of the ISA (which itself was born to smooth over differences among machines). Rather, these vulnerabilities are the case of a confused deputy. There is nothing to say you should not speculate, just do not do so across security boundaries leaving breadcrumbs for an adversary to discover.
Re:C Is Not a Low-level Language (2018) by daxfohl on Thursday December 26, 2019 @11:17PM (#21889140)
Though nowadays if AWS or Azure or GCP finds a way to run some proprietary database more efficiently using a new kind of language and cpu architecture, the scale there somewhat changes the playing field.
Re:C Is Not a Low-level Language (2018) by sharpneli on Friday December 27, 2019 @03:25AM (#21889954)
Sure, if they find.

The issue with Itanium was not that market didn’t care of superior performance. The issue was that Itanium is slow. Market didn’t care for theoretical beauty over actual performance.

It is not the first time Intel does something similar. In the 80’s they tried to introduce an ”object oriented” processor. It was ridiculously slow and no-one cared about it.

Re:C Is Not a Low-level Language (2018) by thereisnospork on Friday December 27, 2019 @04:01AM (#21890076)
I'm not in the field, but I'd wager we're due for a shift in the current software-hardware relationship. With the end of Moore's law continuing to improve practical computing performance will requisite making more efficient use of transistors. Or maybe processors will go 3D and we'll have a few decades of relative status quo - I'm hardly Nostradamus
Re:C Is Not a Low-level Language (2018) by daxfohl on Friday December 27, 2019 @08:41AM (#21891258)
Plus even at AWS scale, I imagine HW homogeneity of the fleet is more important than efficiency of a single application, unless it's insanely more efficient for a top 10 service. Homogeneity improves predictability, load balancing, operations, security, and all sorts of other things.
Re:C Is Not a Low-level Language (2018) by oconnor663 on Friday December 27, 2019 @09:29AM (#21891478)
On the other hand, AWS offers AMD machines and ARM machines in addition to the typical Intel stuff. If there was some new architecture that offered a 50% speedup, and all you had to do was recompile your code, I assume they'd support it in a heartbeat.
Re:C Is Not a Low-level Language (2018) by daxfohl on Friday December 27, 2019 @02:17PM (#21893633)
In the context of the article, the changes would by necessity be far more invasive than "recompile your code". The premise is that C cannot be an effective implementation language. A full rewrite would be required.
Re:C Is Not a Low-level Language (2018) by ma2rten on Friday December 27, 2019 @10:32AM (#21891850)
They also have GPUs.
Re:C Is Not a Low-level Language (2018) by aap_ on Friday December 27, 2019 @03:55AM (#21890061)
Not to forget the i860 and Pentium 4. Intel really has a great track record of total failures.
Re:C Is Not a Low-level Language (2018) by commandlinefan on Friday December 27, 2019 @10:18AM (#21891772)
> The market has spoken.

The market “demands” cheap, turnkey, easily replaceable programmers who don’t really know what they’re doing, and justifies this with “I made a website last weekend, programming is easy, you’re just pretending its hard to keep out competition”. Until software engineering is treated as actual professional engineering, time, money and resources will continue to be wasted frivolously.

Re:C Is Not a Low-level Language (2018) by burlesona on Friday December 27, 2019 @11:18AM (#21892140)
Having previously worked in a “professionalized” field (architecture) before a career change to software engineering - please no.

Having a credentialing body that has to review and certify you just kills wages and innovation, and makes it take an outrageously long time to enter the field. But, more importantly, it will not prevent bad programmers from existing and shipping bad software.

Further, software engineering most assuredly is treated as actual professional engineering in most of the industry. That there are many companies that don’t treat it that way just means there are a lot of poorly led or non-software companies out there, which is no different than any other field.

Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @03:13PM (#21894162)
Informatics Engineering is a professionalized field in some countries.

What happens in Portugal is that although most people tend not to do the admission exam, all universities that give engineering degrees (including in computing) need to be certified by the order, and signing legal contracts for projects as Engineer does require the exam approval.

Re:C Is Not a Low-level Language (2018) by dharmab on Friday December 27, 2019 @11:30AM (#21892218)
Did you know that there was a PE exam for software engineering?

It was discontinued because less than 100 people applied for it over the course of several years.

Re:C Is Not a Low-level Language (2018) by ThrowawayR2 on Friday December 27, 2019 @11:49AM (#21892357)
No one took the exam because it was effectively impossible.

To become a PE, first the candidate has to pass one of the Fundamentals of Engineering exam to become an engineer-in-training. Except, whoops, there wasn't ever a software specific FE exam; the most relevant one is the EE/Comp. E. exam. Take a look at the list of topics: https://ncees.org/wp-content/uploads/FE-Ele-CBT-specs.pdf Most developers aren't going to pass that even with a CS degree.

Secondly, you need 4-8 years of supervision by a licensed engineer. Again, whoops, there are barely any software developers with a PE license, so who would they get to supervise them?

Only then do you get to take the PE exam for software engineering. Frankly, the situation was so absurd that one has to suspect that NSPE didn't want to certify software developers as PEs.

Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @03:14PM (#21894174)
Country specific, others still have such exams in place.
Re:C Is Not a Low-level Language (2018) by sdegutis on Friday December 27, 2019 @11:39AM (#21892289)
There is a growth process in any profession. Nobody starts out as an expert just like nobody starts out as an adult. Wages to such are not a waste, but money well spent on training. There are degrees of skill, and jobs to match each level. And at the end of the day, the best quality education comes through real life experience.
Re:C Is Not a Low-level Language (2018) by palerdot on Friday December 27, 2019 @02:01PM (#21893478)
How does it matter? What 'unqualified programmers' (in your speak) say has no bearing on the outcome/quality of actual software that is being created elsewhere by the 'professionals', right?

Unlike other professions, software is ambigously placed in between art and commerce. Perhaps, the only art form that drives commerce heavily compared to music/painting etc. Just like there are no certifying bodies for qualified painters/sculptors/musicians (even if they exist, they are not stopping actual artists creating and sharing stuff), creating a certifying body for software will not take anyone anywhere.

Re:C Is Not a Low-level Language (2018) by dpflan on Friday December 27, 2019 @11:08AM (#21892067)
Is there movement towards professionalizing software engineering? What factors are for and what are against?

I like the idea of professionalizing but also understand it can be constraining to the labor market, but could increase “quality” of products?

Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @03:19PM (#21894210)
Speaking for Portuguese market, it is not a movement, it already exists since about 30 years already.

https://pt.wikipedia.org/wiki/Engenharia_Inform%C3%A1tica#Co...

Quality of assurance of 5 year studies, with assessement of university study plans.

[dead]
Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @03:20PM (#21894227)
Indeed, to use the title "Engineer" one has to earn it, by taking an university degree in Informatics Engineering and having the respective assemment.
Re:C Is Not a Low-level Language (2018) by Gibbon1 on Saturday December 28, 2019 @05:43AM (#21898255)
> Informatics Engineering

Coding isn't and never will be Engineering.

Re:C Is Not a Low-level Language (2018) by ksec on Saturday December 28, 2019 @02:34PM (#21901152)
While they might be true to some extent, I argue there are lots of Engineering Principles that should be taught and required for coding, before call themselves Engineers.

Software Development right now has a little too much BroScience.

Re:C Is Not a Low-level Language (2018) by treeman79 on Saturday December 28, 2019 @04:38PM (#21901934)
Got into programming because it was fun and interesting. I’ve watched what was “correct” change many times over the years. Or every few months months in JavaScript land.

Thought of being told what is correct is just wrong. It would crush so many people. So much innovation would be stifled.

Had a test question in college asking what is better, white on black or black on white for text. Knew I was wasting my time with “formal” education.

Re:C Is Not a Low-level Language (2018) by ksec on Sunday December 29, 2019 @05:37AM (#21905210)
I agree. But it isn't being right or wrong as in other engineering discipline, where there are scientific evidence for those facts.

The principles I was thinking of is the act of trade offs, cost, performance, time and TCO. And it isn't about which set of trade offs is right, it is about knowingly and justify those trade offs. Throughput Vs Latency, CPU vs Memory etc. A lot of these seems to be learned while they are on the job and from mistakes. I wish there are more of these thoughts being taught.

Re:C Is Not a Low-level Language (2018) by pjmlp on Saturday December 28, 2019 @09:09AM (#21898964)
If what one understands by coding is laying bricks and doing plumbing, surely.
Re:C Is Not a Low-level Language (2018) by Gibbon1 on Saturday December 28, 2019 @03:11PM (#21901429)
The vast majority of programmers don't rise to the professionalism of a plumber.
Re:C Is Not a Low-level Language (2018) by pjmlp on Saturday December 28, 2019 @04:31PM (#21901885)
One more reason not to be allowed to self entitle themselves as Engineer.
[dead]
Re:C Is Not a Low-level Language (2018) by pjmlp on Saturday December 28, 2019 @05:29AM (#21898208)
Unfortunately some people are happy to taint the profession.
Re:C Is Not a Low-level Language (2018) by commandlinefan on Friday December 27, 2019 @01:31PM (#21893197)
> your gate-keeping

Yep, that's _exactly_ what the "I made a website last weekend, so programming isn't hard, programmers just pretend it's hard" types say.

Re:C Is Not a Low-level Language (2018) by jokoon on Friday December 27, 2019 @09:03AM (#21891349)
> the lack of innovation in programming techniques called out in this paper.

What kind of innovation? Compiler optimizations? New language paradigms?

Am I right to think computers should adopt a more parallel architecture and design, and to expand on techs like OpenCL and CUDA, and generalize those technique to everything done by a computer, because we've hit a frequency limit?

We often see software being either sharded, distributed, load balanced, etc, but it seems that there is much more performance being possible if we start building chips that enforce the division of a task on the programmer. Of course it seems like it is a very big paradigm shift, which might be too expensive and complicated, but since bleeding edge techs like deep learning cannot be properly accomplished with traditional computers, I tend to believe the computer model of today is outdated.

Re:C Is Not a Low-level Language (2018) by ThrowawayR2 on Friday December 27, 2019 @09:19AM (#21891436)
> "Am I right to think computers should adopt a more parallel architecture and design, and to expand on techs like OpenCL and CUDA, and generalize those technique to everything done by a computer, because we've hit a frequency limit?"

https://en.wikipedia.org/wiki/Amdahl%27s_law

"...Amdahl's law is often used in parallel computing to predict the theoretical speedup when using multiple processors. For example, if a program needs 20 hours using a single processor core, and a particular part of the program which takes one hour to execute cannot be parallelized, while the remaining 19 hours (p = 0.95) of execution time can be parallelized, then regardless of how many processors are devoted to a parallelized execution of this program, the minimum execution time cannot be less than that critical one hour. Hence, the theoretical speedup is limited to at most 20 times {\displaystyle \left({\dfrac {1}{1-p}}=20\right)}{\displaystyle \left({\dfrac {1}{1-p}}=20\right)}. For this reason, parallel computing with many processors is useful only for highly parallelizable programs..."

So, in answer to your question, no.

Re:C Is Not a Low-level Language (2018) by dnautics on Friday December 27, 2019 @10:06AM (#21891699)
Re:C Is Not a Low-level Language (2018) by comicjk on Friday December 27, 2019 @10:16AM (#21891758)
In my field, computational chemistry, you are definitely right: when we have more parallelism available, we go for increased accuracy and scope, not reduced latency. The latency is set by human schedules (a coffee break, overnight, etc). So Amdahl's Law does not apply.
Re:C Is Not a Low-level Language (2018) by dragontamer on Friday December 27, 2019 @04:54PM (#21895065)
> Am I right to think computers should adopt a more parallel architecture and design, and to expand on techs like OpenCL and CUDA, and generalize those technique to everything done by a computer, because we've hit a frequency limit?

Intel Skylake has 8x execution ports with 6x way dispatch PER CORE. Typical code can achieve more than 1-instruction per clock tick, maybe 3 or 4 instructions/clock if you really work hard at your optimization. With 6x instructions/clock as the hard limit due to the uOp cache.

That's a normal CPU. Modern CPUs are incredibly parallel. They just "pretend" to be serial, so that the typical programmer doesn't have to think of those parallelization issues. A combination of compiler (aka: dependency cutting), and CPU (aka: Tomasulo's Algorithm) works together to achieve this parallelism (out-of-order, superscalar, pipelined).

----------

EPIC / VLIW are "leaky abstractions", which bleed the parallelism into the assembly language. But you don't get a lot of parallelism out of EPIC / VLIW, not compared to SIMD anyway.

So if you really have a huge amount of parallelism available, SIMD seems to be a superior methodology (and modern compilers can auto-vectorize loops when the compiler detects the parallelism).

I'm just not sure where EPIC / VLIW techniques come in handy. Its not parallel enough to compete with SIMD, but its still more complicated than traditional CPUs.

Re:C Is Not a Low-level Language (2018) by dnautics on Friday December 27, 2019 @10:13AM (#21891745)
A lot of what is done in a computer is branching logic code, and that's not so easy to deploy on opencl or cuda which are to a first approximation arithmetic engines.
Re:C Is Not a Low-level Language (2018) by dragontamer on Friday December 27, 2019 @02:49PM (#21893936)
> Intel and HP attempted to deliver what this paper advocates. They designed an entirely new processing element and compiler architecture that promised to deliver high performance with less complexity. It was called EPIC and manifested as Itanium. Billions of dollars and the best minds at the disposal of an industry wide consortium couldn't make it work; one year ago the last Itanium shipped. The market has spoken.

Because SIMD seems to be easier in practice when you actually need performance.

Every high-performance application seems to dip into explicit SIMD-parallelism: H264 / H265 encoders, GPU-based deep learning... video game shaders and raytracing, etc. etc. All of which get more performance from SIMD than VLIW / EPIC.

I think the market has spoken: if you are aiming for explicit instruction level parallelism, why not go for 32-way parallelism per clock tick (NVidia Volta or AMD RDNA architectures) instead of just 3 or 4 parallel assembly statements (aka a "bundle") that EPIC / VLIW Itanium can do?

----------

Another note: normal CPUs these days are approximately 6-way parallel. The Skylake i9-9900k can execute 6-uops per clock tick from the uop cache (ex: 2x Load instructions, 2x Additions, 1x XOR, 1x 512-bit SIMD statement). In addition to pipelines, reorder buffers, and other such tricks to "extract" more parallelism from instruction streams.

EPIC / VLIW just happens to sit in an uncomfortable spot. Its "different enough" that it requires new compiler algorithms and new ways of thinking. But its not "dramatic enough" such that it creates huge parallelism like SIMD can easily represent.

Back in the 90s and 00s, it was probably assumed that SIMD-compute was too hard to program, while traditional CPUs couldn't scale very easily.

EPIC / VLIW was wrong on both counts. OpenCL and CUDA made SIMD far easier to program, while traditional CPUs became increasingly parallel. And that is the history IMO.

Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @08:10AM (#21891117)
Intel and HP only failed, because AMD exists and was allowed to design chips that provided an alternative to Itanium.

Without AMD, the market would not have spoken anything.

Re:C Is Not a Low-level Language (2018) by topspin on Friday December 27, 2019 @01:12PM (#21893030)
> AMD exists and was allowed to design

What authority do you propose to gate who is and is not allowed to design semiconductors?

The x86 ISA started at 8 bits, sharing design elements with an earlier 4 bit device. It was successfully extended first to 16 and then 32 bits. Extension to 64 bits was inevitable. The fact that a hungry competitor fulfilled this inevitability before the market forced Intel to do so is an interesting detail and little more. The fact that this obvious evolution was all that was necessary to wipe out Itanium is telling.

Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @02:44PM (#21893887)
The authority of patents and license agreements that Intel had with AMD, partially forced by a court agreement, without them x64 would never happened in a legal way.

Intel 80x86 architecture was successfully to 16 and then 32 bits, by Intel.

Re:C Is Not a Low-level Language (2018) by topspin on Friday December 27, 2019 @06:25PM (#21895742)
> Intel 80x86 architecture was successfully to 16 and then 32 bits, by Intel.

Intel would have been forced to extend x86 to 64 bits sans AMD. The market wanted address space. It did not want a "better" ISA, a new programming paradigm and all the other junk. The part of Intel still listening to customers understood this and Project Yamhill (Intel's 64 bit extension to x64) was underway at least a year before the first AMD x86_64 device appeared and after the first Itanium devices were sold. They knew they had a product the market didn't want and started moving to 64 bit x86 before AMD even delivered their first K8.

Re:C Is Not a Low-level Language (2018) by pjmlp on Saturday December 28, 2019 @05:45AM (#21898260)
Market would have taken whatever was available to buy.
Re:C Is Not a Low-level Language (2018) by jashmatthews on Friday December 27, 2019 @09:23AM (#21891455)
You think Intel would have just stopped manufacturing x86 chips?
Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @02:42PM (#21893865)
Intel would have been able to drive the market into Itanium, since x64 would not exist.
Re:C Is Not a Low-level Language (2018) by haileris on Friday December 27, 2019 @01:11PM (#21893013)
this is not how economics works
Re:C Is Not a Low-level Language (2018) by pjmlp on Friday December 27, 2019 @02:43PM (#21893876)
Indeed, economics require competition, which only happened thanks to AMD x64 alternative.
Re:C Is Not a Low-level Language (2018) by ip26 on Friday December 27, 2019 @10:54AM (#21891969)
They also built it upon the promise of a "sufficiently smart compiler" which never manifest, and ensured there was no second source to provide market competition.
Re:C Is Not a Low-level Language (2018) by api on Friday December 27, 2019 @11:30AM (#21892221)
EPIC also had numerous problems. The most severe I think was that it exposed the innermost workings of the chip.

That sounds like an awesome idea, but it's actually a major issue because once you expose something you freeze it in time forever.

Pretty much all modern processors larger than in-order embedded cores are basically virtual machines implemented in hardware. The actual execution units are behind a sophisticated instruction decoder that schedules operations to achieve maximum instruction level parallelism and balance many other concerns including heat and power use in modern designs.

The presence of this translation layer frees the innermost core of the chip to evolve with almost total freedom. Even if fundamental innovations were discovered like practical trinary logic or quantum acceleration of some kind, this could safely be kept behind the instruction decoder.

EPIC on the other hand by exposing the core freezes it. I predict that if EPIC would have taken over eventually you'd have... drum roll... an instruction decoder for each EPIC "lane" or whatever that did exactly what today's instruction decoders do. It probably would have ended up evolving into a synchronous multithreaded vector processor with cores that look not unlike today's cores complete with pipelines and instruction schedulers and all the rest of that stuff.

I can imagine one scenario where EPIC and other designs that show their guts could work, but it would require the cooperation of operating system vendors. (Stop laughing!)

OSes could implement the instruction decoder layer in software, transpiling binaries from a standard bitcode like WASM, JVM bytecode, LLVM intermediate code, and/or even pre-existing instruction sets like X86 and ARM to the underlying instruction set of the processor core. Each new processor core would require what amounts to a driver that would look not unlike an LLVM code generator.

Have fun getting OS vendors to do that. Another major problem would be that CPU vendors would be incentivized to distribute these things as opaque blobs, making it very hard for open source OSes to support new chip versions. It would be a bit like the ARM / mobile phone binary blob hell, which is one of the factors making it hard to ship open source phone OSes or make open phones.

Keeping the instruction decoder on the silicon basically just avoids this whole shitshow. It lets the CPU vendors keep their innovations closed as they wish without imposing that closed-ness on the OS or apps.

The final issue with kernel compilation is that the performance probably wouldn't be much better than what we get now. We'd trade the overhead of an instruction decoder in silicon for a lot of JIT or AOT compilation and caching in the OS kernel. The performance and power use hit might be just as large or larger.

Re:C Is Not a Low-level Language (2018) by imtringued on Friday December 27, 2019 @06:00PM (#21895559)
>That sounds like an awesome idea, but it's actually a major issue because once you expose something you freeze it in time forever.

Here is an example that should be pretty familiar. When you have an auto-vectorizing compiler and it generates AVX instructions then you will have to recompile your program when AVX2 or AVX512 are out.

With EPIC this problem is extended across the entire program. The ADD instruction is twice as fast? You now have to recompile everything to use ADDv2.

Re:C Is Not a Low-level Language (2018) by a1369209993 on Friday December 27, 2019 @05:47PM (#21895460)
> OSes could implement the instruction decoder layer in software, transpiling binaries from a standard bitcode like WASM, JVM bytecode, LLVM intermediate code, and/or even pre-existing instruction sets like X86 and ARM to the underlying instruction set of the processor core. Each new processor core would require what amounts to a driver that would look not unlike an LLVM code generator.

We already have that; the bitcode is called "source code" and the instruction decoder is called a "compiler".

Re:C Is Not a Low-level Language (2018) by pjmlp on Saturday December 28, 2019 @05:12PM (#21902165)
> Have fun getting OS vendors to do that

That is exactly what IBM and Unisys mainframes do with their language environments, and has been picked up on Windows Store, Android and watchOS as well.

Re:C Is Not a Low-level Language (2018) by campfireveteran on Friday December 27, 2019 @12:13AM (#21889389)
Yeap. One of my roommates from college worked at HP during the Itanium development.. it was great on paper but customers didn't want it or need it. The bigger picture is throwing everything away every few model years isn't "innovation," it's planned-obsolescence consumerism and pointless churn. Turing completeness and standardization > whiz-bang over-engineering.
Re:C Is Not a Low-level Language (2018) by kick on Friday December 27, 2019 @01:56AM (#21889687)
The bigger picture is throwing everything away every few model years isn't "innovation," it's planned-obsolescence consumerism

x86* is a terrible architecture, though. The world would be a much better place without it.

Turing completeness and standardization > whiz-bang over-engineering

Turing completeness and standardization are fine, but there were and are better things to standardize on. "Something with a reasonable amount of thought going into it" is not "over-engineered."

Claiming "planned-obsolescence" would be reasonable if people weren't going through all of this work to maintain fifty years of (near) compatibility with an architecture originally used in a calculator.

Re:C Is Not a Low-level Language (2018) by eej71 on Friday December 27, 2019 @10:37AM (#21891881)
You aren't wrong that x86 is terrible. But it's only terrible because it has survived so long and offered so much value through so many periods of change. I believe that any architecture that lives long enough will become "terrible".

It's not a bug. It's the scar tissue of hard won success. Long live x86!

Re:C Is Not a Low-level Language (2018) by gpderetta on Friday December 27, 2019 @04:37AM (#21890228)
x86 is a terrible architecture. If we changed it overnight the world be an extremely marginally better place (if we ignore backward compatibility). In reality on large powerful machines the ISA matters very little. Where the ISA matter (low end mobile, embedded), x86 has never been a thing.
Re:C Is Not a Low-level Language (2018) by magduf on Friday December 27, 2019 @11:11AM (#21892084)
x86 is a lousy architecture, but x86-64 isn't as bad; at least it has a good number of registers unlike x86.

It's easy to prove x86 is lousy by seeing its success in embedded and mobile devices: it hasn't had any, despite trying (Atom). ARM reigns supreme here.

x86 manages to hold on because of 1) backwards compatibility with proprietary software (namely Windows), and 2) inertia. We don't really notice it that much because we've covered over it with abstraction layers: almost no one writes assembly code any more.

We would be better off if we switched to something better, but we wouldn't notice it much; we might see a slight amount of power savings, and OS developers would be happier. But the benefits just aren't worth the costs. It's unfortunate, though: the major chipmakers should be able to just develop a nice, clean-sheet architecture which retains the good parts of x86 (like the PCIe bus and enumeration, things missing on ARM) and cleans up the bad things, and users shouldn't have to do anything other than make sure to select the Linux distro that matches that architecture. The presence of binary-only proprietary software that only works on x86(/64) is probably the biggest reason we're stuck with it: a competing CPU maker can't just come up with something new and have it "just work" (after getting their compiler changes merged into GCC and LLVM of course).

Re:C Is Not a Low-level Language (2018) by nwallin on Friday December 27, 2019 @12:43PM (#21892796)
> x86 is a lousy architecture, but x86-64 isn't as bad; at least it has a good number of registers unlike x86.

Funny thing.

Whether you boot a modern x86 system in 32 bit mode or 64 bit mode doesn't change the number of registers you're using. You're still using the 32-128 physical registers on the core. That's why x86_64 code isn't particularly faster (sometimes slower) than the same code compiled for x86_32 mode.

People have this zany idea that assembly language is a low level language. It's not. When the CPU executes 32 bit x86 code it "compiles" it to uops that are totally unrecognizable to us and use dozens to hundreds of registers.

The thing about embedded kinda exposes your mental bias. When you scale up the x86 instruction decoder from Intel Atom scale to Xeon scale, the instruction decoder gets a little bit more complicated, but it's given a ton more tools to use. So sure, Atom sucks at embedded, but x86 is still king at desktop and beyond, and ARM will never be able to challenge it.

If ARM wanted to challenge x86 in terms of single threaded performance, it would need to do the same thing x86 does: have a super complicated instruction decoder that maps the 32 logical registers defined by the ISA to its 128 physical ones, reschedules everything, renames stuff where appropriate, identify loads that can be elided, etc. And all of the advantages of having a simple ISA go out the window, because the ISA is an illusion.

Unfortunately Intel's Architecture Code Analyzer is dead. LLVM MCA is almost as good. I recommend you play around with it a bit some time. CPUs kinda don't give a crap if you're speculating four loop iterations ahead and you're just using the same few registers over and over again for multiple purposes.

Re:C Is Not a Low-level Language (2018) by magduf on Friday December 27, 2019 @01:15PM (#21893053)
>When the CPU executes 32 bit x86 code it "compiles" it to uops that are totally unrecognizable to us and use dozens to hundreds of registers.

Yes, but the x86 code itself can't address hundreds of registers, only a handful, because it assumes that's all there is (because that's all there was in the actual x86 processors way back). So the fact that you're using a complicated instruction decoder to get around this and make use of much more capable hardware underneath seems to me to be a big source of inefficiency: surely you would have more performance if your ISA could directly use the hardware resources, instead of needing a super complicated instruction decoder.

>So sure, Atom sucks at embedded, but x86 is still king at desktop and beyond, and ARM will never be able to challenge it.

ARM is already challenging it. They have ARM-64 servers now. Here's a place selling them, from a quick Google search: https://system76.com/servers/starling

>If ARM wanted to challenge x86 in terms of single threaded performance, it would need to do the same thing x86 does: have a super complicated instruction decoder that maps the 32 logical registers defined by the ISA to its 128 physical ones, reschedules everything, renames stuff where appropriate, identify loads that can be elided, etc.

Ok, then why not just make a new (or at least extended) ISA that makes direct use of all those things, instead of needing a super complicated instruction decoder? We already have lots of different ISAs for embedded CPUS: ARM has all kinds of variants (ARMv7, ARMv9, etc.), and MIPS does too. For best performance, you have to compile for the exact ISA you're targeting. We don't do this for desktop stuff mainly because Microsoft isn't going to make 30 different versions of Windows, but for embedded systems it's perfectly normal because everything is compiled from source.

Re:C Is Not a Low-level Language (2018) by nwallin on Friday December 27, 2019 @03:16PM (#21894188)
> ARM is already challenging it. They have ARM-64 servers now. Here's a place selling them,

TBH that's not challenging x86, any more than Atom is challenging ARM in the embedded space. The fact that they're for sale doesn't mean they're good. Those server CPUs have terrible performance per core.

> Ok, then why not just make a new (or at least extended) ISA that makes direct use of all those things, instead of needing a super complicated instruction decoder?

Directly accessing all the parts which are hidden behind the ISA is called VLIW, and the performance is terrible every time someone tries to reinvent it. It sucked even when Intel released the Itanium, which ran Windows.

The problem is that many of the data dependencies are dependent on timings which aren't available at compile time. (Integer division, for instance, the latency is sensitive to the values of its operands. To say nothing of cache timing.) A super complicated instruction decoder knows what data it has and what it doesn't while it is making decisions about what uops to dispatch on the half dozen or so lanes it's managing. A sufficiently advanced compiler does not, so a VLIW has to wait for all data in the half dozen or so lanes to become available before it is allowed to dispatch the instruction. If you want to do "interesting" rescheduling/renaming, you need to bring back the super complicated instruction decoder. (AFAIK later Itaniums started down the path of a complicated instruction decoder, but the Itanium was canned long before its complexity started approaching contemporary x86 standards. It would have been interesting to watch that develop.)

I think you're fundamentally misunderstanding how much stuff the instruction decoder does. To be fair, I'm not doing it its full justice, (how can I? It won't fit.) but I think you're too quick to think all a CPU does is perform the assembly instructions which are fed to it. As the article states, modern computers aren't just fast PDP-11s.

Re:C Is Not a Low-level Language (2018) by als0 on Saturday December 28, 2019 @01:13PM (#21900559)
> ARM is already challenging it. They have ARM-64 servers now. Here's a place selling them, from a quick Google search: https://system76.com/servers/starling

From the site "Starling Pro ARM is currently unavailable.

We’ll loop you in when we have more to share. Want to be the first to learn when it arrives? Get exclusive access before anyone else."

Which is sadly the typical story with ARM servers - limited availability.

Re:C Is Not a Low-level Language (2018) by gpderetta on Friday December 27, 2019 @05:02PM (#21895129)
Less architetural registers means more expensive stack spills and reloads. 8 (7 really and often 6) registers is too little. 16 is about right for the vast majority of programs.

In theory memory can be renamed as well, but this was not done untill the very last intel and amd architectures and, IIRC, it still has to be conclusively confirmed.

Re:C Is Not a Low-level Language (2018) by imtringued on Friday December 27, 2019 @05:54PM (#21895506)
>It's easy to prove x86 is lousy by seeing its success in embedded and mobile devices: it hasn't had any, despite trying (Atom). ARM reigns supreme here.

By that logic everything is lousy. x86 is lousy because it couldn't replace ARM. ARM is lousy because it couldn't replace x86.

Re:C Is Not a Low-level Language (2018) by aswanson on Friday December 27, 2019 @09:29AM (#21891473)
I chuckled at that calculator portion of the comment. It's hilarious,when you think about it.