5 ms·
First mistake to avoid; writing it in C.
by me2you 12y ago
First mistake to avoid; writing it in C.
- nine_k 12y agoWhat would you use, then? D? C++? (Rust is not ready yet, alas.) For a POSIX-compatible operating system, more exotic choices are probably not available.
- rtpg 12y agoIs Rust not ready? Maybe part of the challenge is writing it in Rust
- nine_k 12y agoImagine that you used std::thread::scoped for a few months in some critical places of your project. If you use a stable language, you can concentrate on the challenges of the actual OS design.
- tshepang 12y agoIn some cases, especially new projects (like a new OS), I think the pain of using an immature-and-powerful language is less than using a mature-and-weak one.
- zokier 12y ago> Rust is not ready yet, alas Was C ready when Ritchie & Thompson wrote Unix with it? > For a POSIX-compatible operating system, more exotic choices are probably not available Why limit to POSIX compatibility?
- nine_k 12y agoRitchie and Thompson also sort of wrote C, at least, some parts of it. I fully understand when Mozilla writes Rust and Servo using Rust. No need to limit things to POSIX compatibility, but merely achieving it is no mean feat — and POSIX is seriously C-oriented. Some people invent a new OS architecture, then implement POSIX on the top of it (see NT) — but this is an order of magnitude harder, I suppose. When you implement a POSIX-compliant OS, you suddenly have a lot of ready-made open-source software that both serves its primary purpose and as an "integration test suite". For a new OS, you have to write most basic userland things yourself. This is again a lot of effort.
- dragonwriter 12y ago> Ritchie and Thompson also sort of wrote C, at least, some parts of it. Given its open nature, there's no reason (except limits of time/skill) someone writing an OS in Rust couldn't also be advancing Rust and its libraries in the directions needed to support that effort, even if they are outside of Mozilla.
- nine_k 12y ago> except limits of time/skill I won't mind to be a billionaire with superhuman abilities and unlimited lifespan, too! Unfortunately, we mere mortals often have to limit the scope of our endeavors somehow.
- hga 12y agoOrder of magnitude strikes me as too high if you think about doing it ahead of time and factor it into your design. The harder part would probably be not letting POSIX compatibility cramp your design. For example, the use of fork() is in part an artifact of making a practical system run on very memory limited hardware (like 128KiB max for a program, half code, half data), there's no intrinsic need for it to develop solid software.
- nine_k 12y agoSome very smart and pretty motivated folks at GNU/Hurd project struggled for years with a similar, but a bit less ambitious, approach. You never know how deep a puddle is.
- MaysonL 12y agohttp://www.projectoberon.com/ http://www.projectoberon.com/ POSIX? We don't need no steenking POSIX...
- nine_k 12y agoToo bad this project did not develop further. Modula-2 and of course Oberon the language were rather fine for their times, and I'm glad to see some pieces of them reused in e.g. Go.
- kjs3 12y agoSays every pundit who's never tried to write an operating system.