3 ms·
That was done with C. It was designed to run on the PDP-11, and was a very good fit for that particular architecture. It would be better if hardware manufact
by DonaldFisk 11y ago
That was done with C. It was designed to run on the PDP-11, and was a very good fit for that particular architecture.
It would be better if hardware manufacturers designed their CPUs around high-level languages, not the other way around. Burroughs did with their mainframes, which ran Algol 60 natively and also had instructions for efficient COBOL execution. Later, Lisp machine manufacturers made machines specifically designed to run Lisp.
When hardware is designed without reference to the software which later runs on it, never mind the problems the software is designed to solve, it often leads to solutions tailored better for the problem, but which don't fit the hardware particularly well, not being attempted.
Many if not most problems involve processing different data, usually non-numeric, in different ways. MIMD hardware would be better for that.
- vvanders 11y agoDesigning around languages only works in a world where you have an infinite cache size. Most compilers/JITs are great at inlining. Where you run afoul of things is programs jumping around in memory and cache missing all over the place which is just about every high level language. Unless you have explicit value types and memory coherancy guarantees then you'll always see this tension. It's not like hardware vendors set out to build slow chips or don't know about high-level languages, it's just that hardware doesn't work that way.
- DonaldFisk 11y agoSo the choices are: (1) Hardware designers need to do much more to speed up general memory accesses, so that a CPU cache is no longer needed. (2) Programmers need to accept that if they use pointers (either explicitly like in C, or implicitly like in Lisp or Java), they will have to tolerate the performance hit. (3) Programming is made much more difficult by requiring programmers to take into account memory layout, which is almost like a return to the bad old days when you had (by today's standards) tiny memories. (4) Memory is distributed over multiple CPUs, each working on a different part of the problem. There aren't many problems where users (who today, are almost everybody) care about raw speed. What they do care about are response times.
- vvanders 11y agoI'll add 5: Split application into logic(branches, special-case, and all the gnarly stuff that CPUs don't like) and data processing(nice structured data that fits well into memory). This is essentially what Sony did on the PS3, and made for a very fast system. They just did a poor job of messaging it ahead to devs who were familiar with n-core systems. That way you can speed up the things that need to be fast and the slow stuff doesn't interfere with it. We aren't going to see any fundamental shifts in memory tech so I think this is the best mitigating solution. Relational Databases already kinda nail the structured part to a degree, I think where we fall over is mixing logic with the data we want to process. There's also a continuum of prototyping -> high performance that gets missed in some of these discussions. If I want to see if something works I can knock out a quick prototype in JS but if I want to ship a performant, solid product I'm going to use Rust/C++/etc.