6 ms·
It's not called out on the web page but the novel concept here is the usage of regions for memory safety. Microsoft's Verona[0] is also taking this approach. Pe
by rubiquity 6y ago
It's not called out on the web page but the novel concept here is the usage of regions for memory safety. Microsoft's Verona[0] is also taking this approach. People seem to really like Rust but it's important to keep experimenting and see if we can get the same benefits but with better ergonomics.
0 - https://github.com/microsoft/verona/blob/master/docs/explore.md https://github.com/microsoft/verona/blob/master/docs/explore...
- dgb23 6y ago> People seem to really like Rust but it's important to keep experimenting and see if we can get the same benefits but with better ergonomics. Is my intuition correct that one could implement this type of memory handling in Rust as well?
- thechao 6y agoI’m drawn to regions because they seem to intuitively match how I write my high performance systems software. In those sorts of SW, I really need precise and cheap ownership rules, but without any restrictions in topology. It’d be super if regions were a mathematically robust way of describing that engineering solution.
- tomp 6y agoFrom my reading of the docs, Vale is not memory safe. It offers some tools to assist with memory management, but is fundamentally closer to the safety level of C++ rather than Rust.
- rafaelvasco 6y agoNot being fully memory safe but assisting in it, is the way to go for the broad scope of applications imo;
- vlang1dot0 6y agoI don't really agree. The vast majority of applications are fine being written in whatever flavor of high-level, garbage collected, memory safe language you want. There are many nice options with pretty much any set of feature and style choices you could want. The rest of these applications have either hard realtime or hard performance requirements or both. What I don't see in these apps, is for memory safety issues to be 'ok'.* It's 2020, using a memory safe language should be table stakes for new projects at this point. ---------- * The one exception I can think of is single player video games where the worst that can happen is basically just a crash to desktop. Multiplayer games are a different story especially with the trend toward paid DLC where these kinds of issues could result in anything from exploits in multiplayer matches (hurting the community and thus the game overall) or players circumventing DLC restrictions (resulting in a loss of profit).
- zozbot234 6y agoI'm not entirely sure what's supposed to be "novel" about region-based memory management. It was featured already in Cyclone, a C-like memory-safe language that was a heavy inspiration for Rust. Rust ultimately went for borrowck and lifetimes as opposed to general regions because of ergonomics. Regardless, it's always interesting and worthwhile to see alternate approaches being revisited - for instance, explicit regions might help with some scenarios that currently require unsafe{} in Rust.
- moonchild 6y agoFWIW cyclone also had unique pointers. I don't know if explicit regions help very much with safety, but you can certainly go places with a more expressive type language. E.G. ats - http://www.ats-lang.org/ http://www.ats-lang.org/
- simias 6y agoI don't think I understand the difference between regions and Rust's concept of lifetimes. In my mind they were two sides of the same coin, but you seem to argue otherwise. Note that my knowledge of regions comes mainly from Cyclone, not Vale or Verona, are those different concepts with the same name?
- Verdex 6y agoMy theory is that in order to replace C/C++ in the systems language space we are going to need several different types of languages. Rust is pretty nice, but the options for allocation and it's ownership type system make it a mismatch for certain types of applications (probably games and OS's but we'll see how that plays out). I think regions are neat. And I'm looking for an opportunity both for playing around with it myself and for the programming language community at large getting more exposure to them. More ideas exposed to more people leads to better ideas of how to fit everything together and how to leverage what features to solve some problems better.
- aldanor 6y agoGames often use arena-based allocation systems, slotmaps etc to manage myriads of instances. I don't see how any of that is a problem in Rust?
- steveklabnik 6y agoIt is not. The usual arguments against Rust for games are more cultural. Rust makes a tradeoff of being a bit harder up front, for less time debugging later. Many people say that games specifically would prefer the opposite tradeoff. We'll see as things continue to develop here.
- vvanders 6y agoHonestly most of the iterative parts of gamedev I worked on was either already up in the tooling/editor or in a scripting language. I think Rust for core engine and Lua for game logic would be a pretty solid combo.
- megameter 6y agoIt's mostly the ergonomics of Rust being fine-grained that present a problem. While it's gotten better with revision, fundamentally, you start in an assume-nothing mode in Rust and then boilerplate appears to say "actually, this one is mutable". This incurs friction on nearly every line of state manipulation and when you're doing game-style allocation, you mostly don't care. You have a tremendous amount of mutable state; some of it you blow away every frame, the rest you may want to lock sometimes. What Vale does that is attractive is to make simplifying assumptions that address this problem domain closer to the level of granularity that it deserves.
- baby 6y agoSo you’re saying that code you wouldn’t be able to write with rust would crash at runtime in Vale right?