Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by pcwalton on Monday April 27, 2015 @08:42PM
(#9449984)
Allocators are being worked on. It's not a fundamental language design issue. It didn't make it for 1.0, but the infrastructure to eventually supporting custom allocators has been part of the design of the standard library for quite a while.
Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by digi_owl on Monday April 27, 2015 @08:19PM
(#9449909)
Well TTYs are apparently they own kind of hell.
We are talking about a system that can trace a lineage back to the Morse telegraph...
Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by fl0wenol on Monday April 27, 2015 @10:59PM
(#9450377)
With bits like schedulers and device drivers in an interrupt-based system a lot of ideas we'd like to about runtime state as modeled by your language of choice (the stack, lexical scope, memory, thread context, reference counts) become exposed and the implementation details have to be known, or you have to be comfortable tuning/self-restricting use of features around such a tricky, dragons-be-here scenario.
This isn't a problem specific to TTYs, but indeed they are their own special little hell no matter how you choose to tackle them.
Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by errordeveloper on Tuesday April 28, 2015 @01:25AM
(#9450636)
I like OSv, just because it doesn't have TTYs.
Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by userbinator on Tuesday April 28, 2015 @05:39AM
(#9451185)
I ended up having to just update a pointer so that the interrupt subsystem could know which TTY to send input to." (discouraged in rust).
Why would that be discouraged, and what would be the "Rust way"? That sounds like the simplest, most straightforward way to do it.
Re:Reenix: Implementing a Unix-Like Operating System in Rust...
by steveklabnik on Tuesday April 28, 2015 @09:18AM
(#9452042)
You don't _generally_ do arbitrary pointer arithmetic in Rust. You can, with the 'raw pointer' type, but this paper attempted to use all of Rust's higher-level features. Raw pointers need `unsafe` to dereference, and unless you're doing something like this, aren't generally needed, so are 'discouraged' in a certain sense.
...
"About the only somewhat difficult challenge was that I was unable to find any clean way to switch between different virtual terminals. I ended up having to just update a pointer so that the interrupt subsystem could know which TTY to send input to." (discouraged in rust).
It's a good exercise to try to take a language with promise and use it for a systems task to understand what's possible. But sometimes some languages need to be systems languages, and others need to be application languages, because there are different assumptions and default cases we want to make easy/possible for developers.