Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"But the bigger thing are pointers. AFAIK you can not do type punning in rust, and i don't know if you can do other pointer plays. (note that pointers are barely even mentioned in this blog post)"

I'll note that Ada developers have been writing high-performance or real-time code in C's domain for some time without relying too much on unsafe pointers. They mostly use references or restricted pointers. It has additional benefit of separating types from how many bits represent them where miles and kilometers might be 32 bit but compiler error if you mix them. Also, bounds-checks on arrays or pointers. Then, SPARK subset that verifies absence of common vulnerabilities has no pointers at all. People still manage to build useful things like the IRONSIDES DNS server.

http://www.adacore.com/knowledge/technical-papers/safe-and-s...

https://en.wikipedia.org/wiki/SPARK_(programming_language)

http://ironsides.martincarlisle.com/

These show the advantages of C's pointers are overstated in the general case. Actually a drawback if building high-integrity software. Worst case, we write just those few algorithms in C, unsafe Ada, unsafe Rust, assembly or whatever then wrap them in strongly-typed, safer functions with input validation when called. That's standard in safe languages. Probably how Rust people do it, too.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: