News for hackers. Stuff that matters.
Re:Reenix: Implementing a Unix-Like Operating System in Rust... by soviettoly on Monday April 27, 2015 @10:04PM (#9450230)
"This boot-loader, unfortunately, did not support loading any kernel images larger than 4 megabytes. This turned into a problem very quickly as it turns out that rustc is far less adept than gcc at creating succinct output. In fact, I was hitting this problem so early I was barely able to make a “Hello World” before having to stop working on rust code."

This really caught me. I have not played around with rust that much but having the executable be over 4MB, with such a small program such as just a Hello World is kind of nuts. I know that they still have lot of compiler optimization, but I just thought that was a very interesting portion of the read.

Re:Reenix: Implementing a Unix-Like Operating System in Rust... by scialex on Monday April 27, 2015 @10:16PM (#9450271)
The actual kernel binary was smaller but the loader s limit was based on the amount of memory the kernel laid out in memory takes, including anonymous sections.

Also turning on optimizations in rust and the linker helped a lot but were not enough in the end.

Re:Reenix: Implementing a Unix-Like Operating System in Rust... by mafribe on Tuesday April 28, 2015 @02:45AM (#9450787)
I guess you are the author of linked paper. Well done.

I wonder if you have any opinions on how useful higher-kinded types (HKTs), one of the most requested features for Rust, would have been in implementing this OS. For example the absence of HKTs means that Rust can't have smooth and general handling of monads that is comparable to Haskell's. Would Haskell-style monads or Arrows have been helpful?

Re:Reenix: Implementing a Unix-Like Operating System in Rust... by scialex on Tuesday April 28, 2015 @10:14AM (#9452478)
Thanks.

I believe HKT would have been useful but am not really sure how much HKT would have helped me overall. They would likely have been most useful (if at all) in the VFS/S5FS/VM stages that I was unable to fully get to.

Honestly, I have not used haskell enough to definitively say whether monads/arrows would have been useful.

Re:Reenix: Implementing a Unix-Like Operating System in Rust... by mafribe on Tuesday April 28, 2015 @10:46AM (#9452717)
I guess the only way to find out is to await the emergence of low-level languages with HKTs and then run suitable experiments.
Re:Reenix: Implementing a Unix-Like Operating System in Rust... by pjc50 on Tuesday April 28, 2015 @04:53AM (#9451082)
Ah, so all memory used by the kernel must be listed in sections loaded by the bootloader? As opposed to the normal situation where the kernel just starts grabbing it from the hardware?
Re:Reenix: Implementing a Unix-Like Operating System in Rust... by keeperofdakeys on Tuesday April 28, 2015 @06:54AM (#9451356)
I know no specifics of the situation, but llvm optimisations can be manually toggled through rustc. Maybe there are more special-case optimisations that could help.
Re:Reenix: Implementing a Unix-Like Operating System in Rust... by peteretep on Tuesday April 28, 2015 @01:26AM (#9450641)

    > having the executable be over 4MB, with such a small
    > program such as just a Hello World is kind of nuts
Presumably it's a pretty small class of program for which this is a Real World Issue.
Re:Reenix: Implementing a Unix-Like Operating System in Rust... by elihu on Tuesday April 28, 2015 @03:33AM (#9450891)
Unfortunately, the kinds of people who care about that sort of thing overlap heavily with rust's intended user base.

Also, end users might not care that much about binary size, but distribution maintainers do -- they want to fit as much functionality they can within a reasonable-sized iso download. If including a rust program in the base OS means omitting a dozen C programs that would have fit in the same space, that's a hard sell.

I am optimistic that these kinds of issues will be worked out as the language stabilizes and the tools improve.