News for hackers. Stuff that matters.

embedded3

Re:Tales of the M1 GPU on Wednesday November 30, 2022 @12:01PM (#33803629)
>The rust code was running circles around their Swift ones even when we tried to keep implementations the same.

I've done Advent of Code a few years -- even Javascript implementations, if using a good (optimal) algorithm, are highly performant, so I'm suspicious of the claim. In most AoC problems, if your code is observably different between languages, it's the fault of the algorithm, regardless of language. But perhaps you are referring to well-profiled differences, even if there are no observable differences.

That said, in projects other than AoC I've compared Swift to C++ and it's hard to deny that a low-level language is faster than Swift, but Swift itself is certainly fast compared to most dynamically typed or interpreted languages like Python, JS, Ruby, etc. which are vastly slower than anything in Swift.

Re:Tales of the M1 GPU on Wednesday November 30, 2022 @04:19AM (#33798560)
> What Rust does is flip this. The default is the safe path. So instead of risking forgetting smart pointers and thread safe containers, the compiler keeps you honest.

For what it’s worth, the same is true of Swift. But since much of the original Rust team was also involved with Swift language development, I guess it’s not too much of a surprise. The “unsafe” api requires some deliberate effort to use, no accidents are possible there. It’s all very verbose through a very narrow window of opportunity if you do anything unsafe.

Re:Tales of the M1 GPU on Tuesday November 29, 2022 @12:53PM (#33790796)
Apple has pushed OS updates to help the Asahi team, though they did not publicize this, of course.