3 ms·
I recently stumbled upon Jai and Odin, two new languages which are not memory safe.
by ithkuil 4y ago
I recently stumbled upon Jai and Odin, two new languages which are not memory safe.
- ithkuil 4y agoAh and Zig is also not memory safe
- Jensson 4y agoAnd Rust, it isn't memory safe since you can go into unsafe anywhere, most languages doesn't allow unsafe code.
- jerf 4y agoMemory safety does not encompass code that is labelled and segregated as "unsafe", because by this definition all or nearly all languages are unsafe. There's always some way to execute some sort of assembly in the end.
- ithkuil 4y agoYou can write 100% safe code in rust. Just don't call into unsafe code or FFI into unsafe languages. Can you say the same with other languages like C/C++/zig/... ? Van you literally enforce with a compiler switch and/or linter that you're 100 using a safe subset of the language? You can view unsafe rust as a convenient way to go write in language that resembles rust what you'd otherwise write in C and call via a FFI
- jerf 4y agoWell, then, three languages scratched off my list. At least, assuming y'all are using the correct definition of "memory safe". There is no sensible reason in 2023 for a language to be memory unsafe. What tiny performance advantages can be eked out are completely and utterly trounced by the multi-decade history of the catastrophic errors made and security vulnerabilities created. Whatever performance optimizations could be made are either A: a bad idea anyhow or B: if not actually a bad idea, available through the use of "unsafe" blocks in an otherwise safe language anyhow.