Hacker News new | ask | show | jobs
by r12343a_19 1312 days ago
I legit wonder if it's not time for OpenBSD to switch to Java.

I mean, there's so much work to keep C safe and make sure memory is managed well, etc.

What the project needs is a virtual machine! Clearly they don't care about performance when security is on the line (they did disable multithreading, no?). A good virtual machine will be a small performance loss compared to dealing with this stuff... forever.

Of course, you still have to deal with user land binaries.

4 comments

Garbage collection and just-in-time compilation in the kernel? I'm thinking you must be joking.

This mailing list article is about providing new or modified behavior in the kernel to guarantee behaviors - and security - to userland programs in any language.

Re: Disabling multithreading, I think you might be referring to disabling simultaneous multithreading (SMT) (edited: fixed thanks to a comment), also known as hyperthreading.

Nope,

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

Or, for another example,

https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...

It is only incompatible with UNIX school of thought.

You mean simultaneous multithreading (SMT), aka hyperthreading.

Symmetric multiprocessing (SMP) is when all processors have uniform distance from all memory, as opposed to non-uniform memory access (NUMA).

D'oh! You're absolutely right. Fixed my comment, thank you!
Linux's eBPF is JIT compiled and has its memory managed fwiw. There are lots of virtual machines in kernels, they're an excellent fit.
Sure, but this seems like a non-sequitur. eBPF has its memory managed in a very different sense than a garbage collector, eBPF programs cannot loop, and so on.

Java's virtual machine is so substantially different it's hard to know where to begin.

You can start here, for bare metal deployments,

https://www.ptc.com/en/products/developer-tools/perc

I don't understand why this non-sequitur keeps going! There seems to be a lot of point-missing here.

OpenBSD is a kernel and a general purpose operating system. It runs arbitrary userland software.

Rewriting the kernel in Java will not make C user code safer, and the cost to convert OpenBSD is so nontrivial as to make it an absurd suggestion. I mean, really truly absurd. As in, "am I even talking to real people who work with software?" absurd. If you think it's a good idea to rewrite a posix-compatible OS kernel in Java, by all means, go do so and make a patch against OpenBSD. It's a monumental undertaking, and I'm sure it'll be impressive!

On the other hand, rewriting userland software in Java (from C) will definitely make it safer, but users can already do this and are choosing not to. The goal of this change is to make it easier to write safer C.

A bare metal language runtime is a kernel....

I am fully aware UNIX clones will never use anything beyond C for most part, although there are some famous UNIXes like Apollo that did indeed trail another path.

Even if we had memory safety I think immutable userland mappings would be a valid and interesting technique to implement.
OpenBSD still has not switched to advanced technologies like file system journaling, so Java is probably a stretch.
Why not Rust?
How would rust do anything to help?