News for hackers. Stuff that matters.
Re:Moving Beyond Type Systems by wavemode on Friday May 31, 2024 @11:55PM (#40542748)
The difference is that a compiler knows all about the memory model of the language it's compiling. So it can enforce rules that guarantee you handle memory safely.

But it knows nothing about your other effects. The most it can do is force you to annotate that an effect is happening. It can't help you verify correct behavior of that effect.

Re:Moving Beyond Type Systems by jiggawatts on Saturday June 01, 2024 @03:17AM (#40543620)
The obvious next step is to give the compiler the information it needs. The effect types could contain constraints similar to how Rust traits work.
Re:Moving Beyond Type Systems by swiftcoder on Saturday June 01, 2024 @03:24AM (#40543647)
The compiler knew next to nothing about the memory model before we started annotating lifetimes. Annotating effects is a potentially reasonable next step.

(I say "potentially", because even just annotating lifetimes is already considered a DX nightmare by a lot of people)

Re:Moving Beyond Type Systems by gergo_barany on Sunday June 02, 2024 @06:52AM (#40553064)
> The compiler knew next to nothing about the memory model before we started annotating lifetimes.

Compilers for garbage compiled languages have always had to reason about the memory model. Compilers for languages with obligatory bounds checks have always had to reason about the memory model. Compilers for multi-threaded languages have always had to reason about the memory model. Even "good old C" compilers had to reason about the memory model when it came to volatile variables. Rust didn't invent the concept of a memory model, and Rust's lifetimes are only a small part of its memory model.