Hacker News new | ask | show | jobs
by noobermin 1337 days ago
We had a "sample" of this, at least according to the author, although it was in a less savory direction from those who care about memory safety and things like that: The M1 was optimized to run js shit faster apparently, which he claims is why the CPU is better for mobile machines (macbooks). Supposedly rust is too new for a new arch to design around it.

Tbh, and may be this is just the limits of my imagination, but I'm not sure what rust's guarantees would have on the ISA level, they usually concern safety on the application level. Systems programming in general still needs loads of unsafe blocks to actually work (see the debate a few weeks ago where Linus Torvalds critiqued a patch where rust folks wanted to change memory allocators in Linux so they could play nicer with safe rust code).

Like, ownership and move semantics are really a higher level concept and anything that happens within a single page the MMU will not care about with machines today, so this wouldn't be a small evolution but a completely different kind of arch. Again, may be I'm just to uninformed or lack the imagination.

1 comments

Here is the JS reference in the article.

> For example, they added a lot of great JavaScript features, cognizant of the ton of online and semi-offline apps that are written in JavaScript. In contrast, Intel attempts to optimize a chip simultaneously for laptops, desktops, and servers, leading poorly optimizations for laptops.

Now there is a JS feature in the M1. It's the FJCVTZS instruction "Floating-point Javascript Convert to Signed fixed-point, rounding toward Zero" which ensures this conversion follows the JS specification. [1]

And this does indeed improve JS performance for Arm CPUs. But why does JS behave this way? Because it was specified to follow what x86 does!

So to say that 'M1 is optimised for JS but x86 isn't etc' is just plain wrong.

Also: - Apple didn't do it Arm did. - It has nothing whatsoever to do with memory management.

[1] https://stackoverflow.com/questions/50966676/why-do-arm-chip...

Indeed, the few things I do already know of what the article talks about (very much including the javascript feature of the M1 you outline) are completely wrong, that makes the entire thing extremely suspect.

An other banger:

> Apple also does crazy things like putting a high end GPU (graphics processor) on the same chip.

They’re good but they’re not especially high-end, unless compared to other embedded GPUs like the ones in AMD’s APU, which… are rather comparable overall, and also single-die.

I find it very frustrating. There are nuggets of interesting and relevant historical info and the central message of 'ISA isn't the most important thing for high end CPUs' is something I'd broadly agree with.

But it's all mixed with factual errors and iffy opinions (the Patterson and Hennessy textbook really isn't 'horrible').