Hacker News new | ask | show | jobs
by bsder 1093 days ago
Why is this amazing? One would expect the language with more restrictions to compile to faster code, no?
2 comments

Some restrictions aids performance, but checking that pointers have not run wild like elphants in a porcelain shop requires extra checks, which takes time.
> elphants in a porcelain shop

Slander.

Elephants are gentle, careful creatures. Probably would make good proprietors of a porcelain shop.

Unlike bulls and china shops....

Don't you guys watch Mythbusters? https://www.youtube.com/watch?v=Xzw2iBmRsjs (Mythbusters bust 'bull in a china shop stereotype')
> Unlike bulls and china shops....

Steers are probably OK though

https://www.youtube.com/watch?v=iv-HjTkbBwk

Only if the restrictions are static and don't need to be checked dynamically, naturally. For dynamic arrays or dynamic indices it's not always possible to do that in Rust.