4 ms·
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
by r12343a_19 4y 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.
- AaronFriel 4y agoGarbage 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.
- insanitybit 4y agoLinux's eBPF is JIT compiled and has its memory managed fwiw. There are lots of virtual machines in kernels, they're an excellent fit.
- AaronFriel 4y agoSure, 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.
- pjmlp 4y agoYou can start here, for bare metal deployments, https://www.ptc.com/en/products/developer-tools/perc https://www.ptc.com/en/products/developer-tools/perc
- AaronFriel 4y agoI 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.
- pjmlp 4y agoA 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.
- AaronFriel 4y agoThe context of this thread is adding syscall to the kernel to allow C userland programs to be safer. Even if the kernel were written in Java - which is, again, absurd to ask of the OpenBSD developers - it would still be a viable syscall to add for user mode programs written in memory unsafe languages.
- pjmlp 4y agoOnly way to make C "safer", is to follow Solaris footsteps, hardware memory tagging.
- senkora 4y agoYou 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).
- AaronFriel 4y agoD'oh! You're absolutely right. Fixed my comment, thank you!
- pjmlp 4y agoNope, "Eric Bier Demonstrates Cedar" https://www.youtube.com/watch?v=z_dt7NG38V4 https://www.youtube.com/watch?v=z_dt7NG38V4 Or, for another example, https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kernel.Mod.txt https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne... It is only incompatible with UNIX school of thought.
- MuffinFlavored 4y agoWhy not Rust?
- kavulox 4y agoHow would rust do anything to help?
- insanitybit 4y agoEven if we had memory safety I think immutable userland mappings would be a valid and interesting technique to implement.
- hurraopenbsd 4y agoOpenBSD still has not switched to advanced technologies like file system journaling, so Java is probably a stretch.