News for hackers. Stuff that matters.
Re:Let's Embed a Go Program into the Linux Kernel by st_goliath on Sunday April 28, 2024 @05:12AM (#40187169)
I'm a bit surprised the bulk of the comments here seem to fixate onto Go specifically, seemingly missing the actual point of the article:

The article demonstrates the Usermode Driver API, showing how a Linux driver can offload work into userspace (with or without access to a working filesystem).

I mentioned this yesterday in the context of the in-kernel codec discussion[1], where the questions "can't this be done in userspace" or "why not sandboxing" were dismissed pretty quickly.

[1] https://news.ycombinator.com/item?id=40174516#40184307

Re:Let's Embed a Go Program into the Linux Kernel by unnouinceput on Sunday April 28, 2024 @09:28AM (#40188436)
Exactly!. It can be written in any language, Cobol if you want, it does not matter. Once compiled the "gas" does the actual magic, not Go.
Re:Let's Embed a Go Program into the Linux Kernel by deepsun on Sunday April 28, 2024 @09:29AM (#40188445)
So why not Java? It has way more software written in it. :)
Re:Let's Embed a Go Program into the Linux Kernel by hu3 on Sunday April 28, 2024 @10:13AM (#40188730)
Their rationale for Go is explained in the article.

> Strictly speaking, any program will do, but we need to ensure that the program in question has no dependencies on the file system. Linking it statically provides benefits. Go programs are statically linked by default, and to illustrate that the following approach works with any kind of program, we have chosen to embed a Go program into the kernel.

Please refrain from inciting language flamewars.

Re:Let's Embed a Go Program into the Linux Kernel by pjmlp on Sunday April 28, 2024 @10:31AM (#40188864)
More to the point, Sun did actually play with the idea of having Java in Solaris.

Android Things had drivers in Java, and Android has a few, although only as userspace.

Re:Let's Embed a Go Program into the Linux Kernel by jerf on Sunday April 28, 2024 @12:19PM (#40189662)
There were also some Java CPUs, which directly executed bytecode, in which case a "Java driver" would just be the lowest, system-level language available: https://en.m.wikipedia.org/wiki/Java_processor
Re:Let's Embed a Go Program into the Linux Kernel by fullspectrumdev on Sunday April 28, 2024 @11:22AM (#40189267)
I recall stumbling across this years ago while working on a Solaris project - the possibility of writing drivers in Java.

It seemed so patently absurd at the time!

Re:Let's Embed a Go Program into the Linux Kernel by chrsig on Sunday April 28, 2024 @10:56AM (#40189063)
It's a sophisticated bike shed. Much more of the population has a working knowledge of go than about the linux kernel's Usermode Driver API

...So what color is their gopher?