Live data from Hacker News

Using Rust for an Undergraduate OS Course

rust-class.org

51–60 of 72 posts

Re: Using Rust for an Undergraduate OS Course

#51
post #46

Earlier quoted context omitted.

c++ smart pointers under the hood? its actually cool.. to bake some of this directly in the language.. can prevent some memory copying by playing with raw pointers indirections under the hood in the lang runtime, etc.. But you already has to think like this when you use smart pointers in C++.. "who owns this reference?" etc.. But in C++ this is a library.. not a syntax.. point to rust for this

You already have to think like this when you use smart pointers in C++! But C++ compilers don't help you with that! The Rust compiler does. Using Rust, you get surprised how often you get ownership wrong, because the compiler tells you every time. The same analogous code in C++ will still be wrong, but you wouldn't know, since the compiler tells you zilch.

hello sanxiyn! (fyi all, sanxiyn is one of the rust compiler developers, unless i'm mixing up names :) )

Re: Using Rust for an Undergraduate OS Course

#52
post #45
post #6

> Go. Go is a systems programming language Not those kinds of "systems". It is funny, it seems initially it was meant to be those kind of "systems", and then it pivoted as we like to say, to become a "distributed-server-network-backend systems" not "hardware-kernel-OS" kind of systems. And then creators kinds of winged it and remarked how "well, that's what we meant when we said systems". As for Rust, yeah, there are…

Other than the word "systems", was there any other indication that the Golang team meant to target OS kernels?

Not sure about OS kernels, but their intent was to attract C++ programmers, although, they ended up mostly attracting python programmers.

Re: Using Rust for an Undergraduate OS Course

#53
It's a good start, but I'd honestly feel cheated if given such a course. I agree that the C tide may need to change, but using a language pre-stabilization AND that has literally no job opportunities is a real drag. So, the same goes for Go as well. And the fact that python or any other such language was even an option scared me just a little. I believe in Rust, and hope it succeeds, but don't feel this was a good avenue for it at this time.

Re: Using Rust for an Undergraduate OS Course

#54
post #6

> Go. Go is a systems programming language Not those kinds of "systems". It is funny, it seems initially it was meant to be those kind of "systems", and then it pivoted as we like to say, to become a "distributed-server-network-backend systems" not "hardware-kernel-OS" kind of systems. And then creators kinds of winged it and remarked how "well, that's what we meant when we said systems". As for Rust, yeah, there are…

I am more into D and Rust than Go nowadays, but I think Go can be used for writing an OS if one so desires.

The language is quite similar to Oberon in features. You just need to provide a syscall package for bare hardware.

If powerful single user graphical OSs were written in Oberon, why not Go?

Re: Using Rust for an Undergraduate OS Course

#55
post #45
post #6

> Go. Go is a systems programming language Not those kinds of "systems". It is funny, it seems initially it was meant to be those kind of "systems", and then it pivoted as we like to say, to become a "distributed-server-network-backend systems" not "hardware-kernel-OS" kind of systems. And then creators kinds of winged it and remarked how "well, that's what we meant when we said systems". As for Rust, yeah, there are…

Other than the word "systems", was there any other indication that the Golang team meant to target OS kernels?

You mean, if we assume that the word "systems" doesn't have a well defined meaning, that especially the Go team would know all too well when it used it?

Re: Using Rust for an Undergraduate OS Course

#56

This just doesn't make a lot of sense to me, given that almost all systems programming in the real world is done in C and C++, and given the complexity of OS kernels, we're not going to see a general purpose commercial grade one written in Rust either ever (if it falls out of popularity) or for ten to fifteen years (if it becomes very popular). This isn't like application or web programming - in comparison to web tec…

Most of the real world uses C and C++, because of the vicious cycle he mentions on the post.

You don't need C's lack of safety everywhere for doing an OS. There were OS written in Mesa, Modula-2, Modula-3, Object Pascal, Oberon, Ada and many others.

C's strings and vectors are recipe for security exploits without any benefit for kernel programming. Or lack of type safety between compilation units.

It is a very good thing students learn C and C++ aren't the only way to write an OS. Sometimes the world seems to forget other languages have been used for the same purpose.

Re: Using Rust for an Undergraduate OS Course

#57
I'm also teaching an OS class, and IMHO using some new shiny thing is not the right way to approach it, because the students will be put in an ideal imaginary world, and neither will face the real-world practice, nor understand how it all came to be the way it is now. I think, it may be a good follow-up course (like "System Programming in Rust") after the "normal" C-based course.

I also don't agree with the notion that other option is "to teach students to write C code riddled with security vulnerabilities, memory leaks, and race conditions". This is exactly what such kind of course should teach them not to do, clearly pointing these problems and explaining how to deal with them. But not having exposure to that in the learning environment will only make them repeat these mistakes in the real world.

Btw, I'm a Lisp programmer and not a C fan.

Re: Using Rust for an Undergraduate OS Course

#58
post #6

> Go. Go is a systems programming language Not those kinds of "systems". It is funny, it seems initially it was meant to be those kind of "systems", and then it pivoted as we like to say, to become a "distributed-server-network-backend systems" not "hardware-kernel-OS" kind of systems. And then creators kinds of winged it and remarked how "well, that's what we meant when we said systems". As for Rust, yeah, there are…

Systems programming does not mean operating systems.

To me it means "infrastructure" - things like web servers, database servers, or the wide range of distributed systems that are currently written in Java (eg, Hadoop).

Re: Using Rust for an Undergraduate OS Course

#59
post #32

Earlier quoted context omitted.

> it seems initially it was meant to be those kind of "systems" From the announcement talk: "And it's a systems language in the sense that we intend it to be used to write things like web servers" http://www.youtube.com/watch?v=rKnDgT73v8s I don't think that Google ever wanted to develop a new OS kernel.

> From the announcement talk From the announcement blog (and that was the widely circulated quote in tech news not the video transcript): --- Go combines the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++. [...] And the compiled code runs close to the speed of C [...] Go is a great language for systems programming with support for mu…

This is possible the worst example of selective quoting I've seen on HN.

From the bit you left out:

Want to write a server with thousands of communicating threads?

It's always been clear what kind of apps Go is targeted at, and it's never been operating systems.

Post reply on HN