by throwaway17_17 · 4y ago · 0 comments
(Also all the hype and fearlessness is obnoxious)
With such a strong focus on bounds checking, are there any 'systems programming' languages that you do find acceptable?
Unsafe blocks don't change the semantics of code, they just let you write code you couldn't write outside of them.
That's exactly why I get annoyed. How will it be fast if it branches on every access
> where the compiler could 'prove'
The compiler doesn't prove shit. It lets the optimizer do it. It's extremely easy to fool the optimizer
> there any 'systems programming' languages
The ones that don't make false claims (so not v or rust) and don't insert code I don't want
And random access `array[intval]` will always be performance crippled if intval is provided by external system at runtime.
Even if intval is guaranteed to be between 0..<array.length, you need to converted it to that type.
What I want is a check outside of the loop then every access inside a loop unchecked and fast. Which isn't what rust does. Then it throws your memory away if you did an oops and went out of bounds
That's exactly what iterators allow.
> What I want is a check outside of the loop then every access inside a loop unchecked and fast
That's what Iterators give you.