Operating System Development in Rust
github.com
github.com
It has been 6 days since the last CERT advisory for a buffer overflow security hole.
I'm not saying that security holes are nothing to worry about, as I am no less irritated by buggy programs than anyone else, but the alternative might be worse.
Why is that? I don't see why this has to be true.
A device maker which makes completely open machines is going to get out-competed with low-margin knock-offs, or generic branded copies from places like china. This is good for the consumer, but not good for a business's bottom-line. This is why there are very few branded computers these days (at least, desktop). You can count them on your fingers.
* Good will among the community
* More familiarity with Cell software development for clusters (although this was behind a VM)
* Import tax savings in certain territories due to the box being classed as a ‘computer’ instead of a ‘games system’.
Which do you think was most important? (hint: it’s the last one) Conversely, when the ability to run Linux was pulled a hypervisor exploit had been discovered. Now the cost equation tipped back the other way. The import tax hit was still there, but the machine had halved in price since launch so that wasn’t as painful. The community had moved away from PS3 clusters as they weren’t energy effective any more: not as painful. The major pain point from removing it was losing the goodwill of the community, but when balanced against the piracy implications they made their decision.
Personally I think they should have patched the hypervisor holes and kept the functionality, but you can see why they decided to remove it.
Walled gardens and eroded digital/computational liberties are here to stay, and even more so in the future. The trend has been that "hacking the device" has become harder and harder, and devices have became more and more closed and controlled. I don't expect this trend to change any time soon. I sure as hell wish it did, but why would it?
We are living in very interesting times indeed...
No such thing. There is no protection once someone has physical access to the hardware.
However, if Rust doesn't get adopted by an OS vendor in their SDK, it will join the ranks of Object Pascal, Extended Pascal, Modula-2, Modula-3, Ada, Oberon,Cyclone, ATS.
This just to mention the alternatives on my lifetime, while ignoring the Algol and PL/I variants that existed before C was even born.
My point was about Rust real use case, systems programming.
B) A browser is about the beefiest user space program of which I can think at the moment.
Of course, the expectation would be that the said OS vendor would give more emphasis to Rust.
For example, C++ earned its place by being bundled alongside C compilers and having things like CORBA, OpenDOC and Windows pushing for it.
> Anyone could write and maintain one for Rust, so what's the difference?
This is how the alternatives to C and C++ faded away of the IT market. The vendors could not keep up with the tools that the OS vendors had on their SDKs and many developers got fed up with writing FFI code.
Something about this doesn't sound right to me. I think the third-party factors are overwhelming. After all, the basic I/O and other low-level stuff is going to be there on any supported OS. But availability of compilers/VMs/interpreters, and good libraries for GL, Qt, audio, etc. are all at the top of my reasons for not going with a particular language that would otherwise be suited to the task.
I think Rust is in a better position than one would normally expect. People are looking at it for web dev, and web devs tolerate more diversity in their language of choice. The existence of Go, and the frequent (if misguided) comparisons to Go helps, since writing a web-facing app in Go is a sensible thing. I'm not sure if that will work out, but if it does I think it's a trump card. No web language ever died, except things like Cold Fusion and languages that were superseded by offerings from their own vendors.
On the other hand, I think Rust is better suited to game development. I don't know of Carmack being sweet on Rust in particular, but a few years ago he did start talking about how it would be nice if id could use safer languages (though his biggest complaint was about script writing.) More to the point, Rust is growing a collection of gamedev libraries. Piston is ambitiously trying to curate an entire ecosystem. This is a rare phenomenon among the pretenders. Piston is in no shape to take over the world today, but if it continues to grow and polish it could turn a number of heads.
I am a big fan of Wirth's languages.
That said, in many ways neither language is like the one I've compared it to, probably in enough ways that it's not a useful comparison for much other than this one metric (the TIMTOWDIness of the language). But, it's how my head is processing these two quite novel (to me) languages; which would make sense, as I've written more code in Python and Perl than probably anything else, so they're the known things I compare these unknown things to.
In fact, it has been my observation that the language has been getting progressively less functional since its early days. Not that I consider this to be bad.
Of course it's not exactly Haskell, but it's arguably closer to FP than it is to C, yet manages to be approachable to imperative programmers. I think this is fantastic.
This comment is very condescending. It makes it seem as if C programmers are ignorant and Haskell programmers are enlightened. Haskell is a garbage collected, lazy, pure language which makes it unsuitable for many of the domains C-style languages are used in. These are also qualities not shared by Rust, which may explain why there is less resistance in its uptake by C programmers.
Don't be so sure! [1] You could simply use Haskell as a metalanguage to generate a C program that does what you need, just like they did with copilot. No Haskell runtime needed.
libgreen while it existed scaled very poorly and consensus among rust developers seemed to be that, it cannot be improved without compromising some of the core features of rust like no-GC and zero-overhead calls to C libraries.
Whether goroutines need to be pooled depends on the application. For example, the default HTTP creates ones per connection and seems to be used without any problem in production at a lot of places. Creating them is much cheaper than creating OS threads. In fact, libgreen threads were faster to spawn than libnative ones in rust when it existed.
Rust and Go have different trade-offs when it comes to concurrency and each has its benefits and drawbacks.
Something like async..await is in the cards and I guess rust does have plans to implemented it sometime in future, but that will require compiler support and can't be done just in libraries like you claimed in the first comment of this thread. While it will not have same runtime characteristics of goroutines, it'll provide similar benefits to program structure.
All that said, rust definitely offers a lot. I'm only contending the claim that the language is flexible enough to implement something similar to goroutines purely as a library.
The only fundamental difference between Rust and Go here is in stack management. In Go, goroutines start off with a small stack, and they can grow because the language is now pervasively, precisely garbage collected and all of the pointers into the stack can be rewritten. In Rust, that wasn't an option because it isn't garbage collected; it used to use the old Go approach of split stacks, but the same problems were encountered. There was also significant backlash against the problems that continue to be an issue in Go and were an issue in Rust—the FFI (cgo in Go's case) was slow due to having to perform stack switches, most importantly.
Since libgreen did have massive stacks and one could not spawn 100s of thousands of tasks without changing system limits like overcommit, it was not really a comprehensive duplication of goroutines.
I love C. Love Go. Love the idea of Rust though I've never tried it, and I just want to know more.
Well, you could customize the stack size, and we did when running stress tests like that. You don't need to change system settings. The only difference is that you have to know how much stack your "goroutine" is going to need up front.
Want some simple concurrency? Here try boost::asio... or boost::thread... or... libev... or libuv.
Now every project has a different concurrency model woven into it. Why isn't there a good solution in the stdlib for this common need?
Because every concurrency/parallelism approach has tradeoffs, and there is no one right implementation for all cases, and rusts intended primary use case is low-level and broad enough that there's not even one approach that's probably good enough for most cases.
Or maybe this, if UEFI is palatable to you:
http://blog.theincredibleholk.org/blog/2013/11/18/booting-to...