Rewrite Everything in Rust
robert.ocallahan.org
Rewrite Everything in Rust
1–10 of 242 posts
Re: Rewrite Everything in Rust
#2http://blog.dkhenry.com/2016/02/17/deciding-to-rewrite-getad...
Re: Rewrite Everything in Rust
#3Anyone want to set up the infrastructure so it's easy to take a library or a .c file and start hacking, and see if you still get a working OS in the end? I suppose part of the problem is defining "working OS" -- I'm not sure I know of any great test suites that check to see that a GNU/Linux distribution continues to in GNUy/Linuxish ways, which is usually what you want for a large-scale rewrite project.
Re: Rewrite Everything in Rust
#4Re: Rewrite Everything in Rust
#5This may well be applicable to kernels and other constituents of an OS.
Re: Rewrite Everything in Rust
#6I have actually started to do this to see for myself how much work it would be http://blog.dkhenry.com/2016/02/17/deciding-to-rewrite-getad...
I think the way to tackle a rust glibc rewrite:
Step 0 - write a code generator that just generates rust code that call the C versions of glibc symbols ( based off of the publicly exposed API in the library files). Get test suite to run
Step 1 - Make that rust code generate a 100% drop-in replacement fro the C symbols (maybe this requires injecting version numbers)
Step 2 - write the `getaddrinfo` replacement in Rust
???
Step 4 - have all of glibc ported
EDIT: Does anyone know of any gotchas with linking that would cause this to happen? Seriously considering taking a day off to do step O.
Re: Rewrite Everything in Rust
#7https://news.ycombinator.com/item?id=11148129
They often have horrible security, but are very small programs when you use them as wifi temperature sensors or similar. They are good targets for rewrites and greenfield applications. Right now it seems like ardunio C++ or some scripting language is the target.
Re: Rewrite Everything in Rust
#8How practical is rust for small processor IoT applications? Like the ESP8266 we saw recently? https://news.ycombinator.com/item?id=11148129 They often have horrible security, but are very small programs when you use them as wifi temperature sensors or similar. They are good targets for rewrites and greenfield applications. Right now it seems like ardunio C++ or some scripting language is the target.
Re: Rewrite Everything in Rust
#9Rewriting the software in Rust would not solve these problems any more than rewriting it in C++ would. A rewrite would clean up the code, sure, but then you're left in the same situation, only with brand new bugs that nobody has time to fix.
We need to have incentives for maintaining this foundational software.
Re: Rewrite Everything in Rust
#10If a given piece of software has been largely written using certain patterns or conventions, then it is often possible for a syntactic rewrite engine to be able to match those patterns, then output idiomatic code patterns in the target language. This may well be applicable to kernels and other constituents of an OS.