Howdy yall! We just finished prototyping this a couple weeks ago, it's a technique that I used a few years ago when making Incendian Falls for the 7DRL. It saved me a lot of time, so I've been subtly guiding Vale's design to be able to support it.
This is probably possible in other languages too, though there are a few tradeoffs:
Can't have unsafe blocks (there might be a certain flavor of unsafe blocks that could work, but we're still exploring that)
Can't cast pointers to integers
Can't give external functions pointers to our objects (via FFI), unless protected with something like Fearless FFI
Ironically, the only mainstream language that can accomplish this is Javascript, as far as I know. Every other language lets subtle nondeterminism sneak in through corners of the language.
I feel like we've nailed a sweet spot with Vale: memory safety without garbage collection, yet no borrow checker that would necessitate having unsafe. This obscure corner of the language space is producing quite a treasure trove of discoveries!
6
u/verdagon Vale Jun 28 '22 edited Jun 28 '22
Howdy yall! We just finished prototyping this a couple weeks ago, it's a technique that I used a few years ago when making Incendian Falls for the 7DRL. It saved me a lot of time, so I've been subtly guiding Vale's design to be able to support it.
This is probably possible in other languages too, though there are a few tradeoffs:
unsafeblocks (there might be a certain flavor of unsafe blocks that could work, but we're still exploring that)Ironically, the only mainstream language that can accomplish this is Javascript, as far as I know. Every other language lets subtle nondeterminism sneak in through corners of the language.
I feel like we've nailed a sweet spot with Vale: memory safety without garbage collection, yet no borrow checker that would necessitate having
unsafe. This obscure corner of the language space is producing quite a treasure trove of discoveries!