News for hackers. Stuff that matters.
Re:0.11.0 Release Notes by lmm on Friday August 04, 2023 @03:30AM (#36996634)
There are use cases where safety beyond memory safety is required. But there are no use cases where memory unsafety is desirable, yet alone required.
Re:0.11.0 Release Notes by quic5 on Friday August 04, 2023 @03:33AM (#36996663)
That is absolutely true. But but you can write memory-bug-free code in Zig but you cannot prevent heap allocations in most of the languages listed in the article, making it outright impossible to write certain software in them.
Re:0.11.0 Release Notes by grumpyprole on Friday August 04, 2023 @03:37AM (#36996701)
Sure one can write memory-bug-free code in x86 assembly too. But how can you prove it? ATS is an example of a low-level systems language where you can prove it.
Re:0.11.0 Release Notes by ObscureScience on Friday August 04, 2023 @04:14AM (#36996970)
As Zig promises "not hidden allocation", I assume you can build your allocator in Rust and then use it for all memory allocation in Zig.
Re:0.11.0 Release Notes by lmm on Sunday August 06, 2023 @06:16PM (#37027466)
A function that doesn't allocate doesn't mean it's safe. (Indeed if anything the opposite is more likely - copying is safe, if slow, writing to something that was passed in tends to be what breaks).
Re:0.11.0 Release Notes by ArtixFox on Friday August 04, 2023 @04:40AM (#36997182)
formalized subsets of x86 assembly exist. Coq can be used as a macro assembler. tools to work with llvm ir exist, x86 can be raised up to llvm ir and proved, kinda bad way tho.
Re:0.11.0 Release Notes by memefrog on Friday August 04, 2023 @06:51AM (#36998112)
You can't prove it in Rust either.
Re:0.11.0 Release Notes by jdrek1 on Friday August 04, 2023 @03:49AM (#36996790)
While that is true, there might be other requirements that prevent memory safe languages from being used. For example not having a heap available instantly disqualifies most of them. Or when you have simulations running where having constant OOB and other checks would be a massive slowdown. Now obviously your code should still be memory safe (because otherwise it's not correct anyway and you should fix the code), but not at the cost of runtime checks.
Re:0.11.0 Release Notes by memefrog on Friday August 04, 2023 @05:13AM (#36997414)
>there are no use cases where memory unsafety is desirable, yet alone required.

There are plenty of 'use cases' where Rust's guarantees (some vague but unenforceable promises around memory) are not worth the cost of using Rust (a very high cost). This is doubly true if you want to, say, not use any third-party libraries. If you use third-party libraries, you get essentially zero guarantees. And if you don't, you have to reinvent the world - and writing new data structures in Rust is a series of research projects, whereas doing so in C is trivial.

There are many situations where guaranteed 'memory safety' (a Rust propaganda term for 'having the guarantees we can provide but not the ones we can't provide') is not very important.

Re:0.11.0 Release Notes by throwawaymaths on Friday August 04, 2023 @10:05PM (#37008262)
> But there are no use cases where memory unsafety is desirable, yet alone required.

Operating system bootstraps?

DMA management/volatile driver access?

Doubly linked lists?