logoalt Hacker News

modulovalue • today at 7:37 AM • 0 replies • view on HN

My goal is to safely reach native speeds on 128-bit wide SIMD registers and for that we need: - better bounds check elimination so we don't need the unsafe bounds pragma - dedicated loads so we can extract a SIMD value type directly from bytes with no overhead (Dart doesn't support slices like Rust, for example, and it's not that easy to retrofit them from what I've seen.) - a dedicated Uint8x16 type so the SWAR techniques over 32-bit wide integers are no longer needed - plus a few other minor optimizations

With that we should be pretty much be as fast as Rust, see: https://www.reddit.com/r/rust/comments/1yamcov/looking_for_f...

I don't think I'll be able to reach 192 GB/s if that's the limit of the M3 Air, but even if, unfortunately, validation is slowed down by any subsequent conversion to a String.

I should write about this because all languages suffer from this. I imagine that one day we will have languages that provide more extensive static ownership guarantees where we can have zero cost wrappers over regions of memory that we can easily treat as Strings instead of having to allocate memory and copy the bytes over to a materialized String.