News for hackers. Stuff that matters.
Re:Back to old tricks, or, baby steps in Rust by Twisol on Saturday July 04, 2020 @02:39PM (#23734071)
> The only place where I couldn't find a zero cost abstraction was enum encoding, where enums are of different sizes.

Unfortunately, variable-sized types interact poorly with arrays -- you can no longer access any element in constant time. UTF-8 has essentially the same issue.

Did you end up abstracting over the byte array at all? I would imagine that some kind of `BytecodeBuffer` could give pretty reasonable ergonomics over a raw buffer without sacrificing efficiency or correctness.

Re:Back to old tricks, or, baby steps in Rust by masklinn on Sunday July 05, 2020 @03:11AM (#23737091)
> Unfortunately, variable-sized types interact poorly with arrays

Unsized types interact badly with everything, really. That's why you usually shove them behind a pointer.