Live data from Hacker News

Gokrazy – A Native Go Userland

gokrazy.org

11–20 of 32 posts

Re: Gokrazy – A Native Go Userland

#12
post #4

gokrazy is a very cool project and something I'd like to see more of. It's not a unikernel per se but it shares the idea of packaging your code and the OS together and shipping it as one. My dream would be a pure Go userspace library to do absolutely anything related to system management you'd need, like managing networking, connecting to Wi-Fi access points, performing upgrades and so on. But it's such a massive und…

I run into this often and share the same desire. I quite like Go, but unfortunately the interaction of "my interests" (such as the userspace library you suggested) and "things Go excels at" isn't very large. Having to do everything important through FFI or shell commands defeats the purpose of writing Go, imo.

There’s always Rust (^_^)

Re: Gokrazy – A Native Go Userland

#14

I’m too rudimentary of a developer. What’s a Userland? What is this doing that writing apps as Go executables doesn’t or can’t do?

Until someone more experienced than me comments: The userland is the collection of programs and functionality that run outside of the kernel. AFAIK you need some things (but I'm not sure which) apart from the kernel if you want to run your executables, and it looks like Gokrazy provides those.

Re: Gokrazy – A Native Go Userland

#15
Be interesting to have at least a few benchmarks to see if cutting so much of the regular distro code actually has a positive impact beyond the idea of it being more reliable. And that last bit does seem to remain an idea rather than a reality in that quite a lot of regular userland code (systemd comes to mind) helps stabilise a running linux box over time in a very real way. Personal exp incl having several headless Ubuntu boxes run for more than a year with zero issues despite being saddled with typical server lamp server stack.

All up for trying this though and can definitely see real bonus in terms of less resource use within Pi envs!

Re: Gokrazy – A Native Go Userland

#16
post #4

gokrazy is a very cool project and something I'd like to see more of. It's not a unikernel per se but it shares the idea of packaging your code and the OS together and shipping it as one. My dream would be a pure Go userspace library to do absolutely anything related to system management you'd need, like managing networking, connecting to Wi-Fi access points, performing upgrades and so on. But it's such a massive und…

I run into this often and share the same desire. I quite like Go, but unfortunately the interaction of "my interests" (such as the userspace library you suggested) and "things Go excels at" isn't very large. Having to do everything important through FFI or shell commands defeats the purpose of writing Go, imo.

If it is any help, I've written a $SHELL in Go and have been using it as my primary shell for around 5 years now. So while it's still largely Beta it is pretty stable these days.

It's intentionally not designed to be a drop in replacement for Bash though. I saw no point replicating all of the problems with Bash when writing a new shell. So it does a lot of things different -- better in most cases -- but that does also create a learning curve too (I mean you're literally learning a new language).

https://github.com/lmorg/murex

Re: Gokrazy – A Native Go Userland

#17

I’m too rudimentary of a developer. What’s a Userland? What is this doing that writing apps as Go executables doesn’t or can’t do?

Maybe the easiest way to visualize it is that there is no filesystem at all. No shell, no "libc", no "ssh into the machine", no "cp", "mv" "ls", etc.

They do provide a way to get one filesystem in place, but you can only interact with it using golang calls within your application.

Re: Gokrazy – A Native Go Userland

#18

It seems like a video output isn’t as much a priority. I’ve been looking at creating a raspberry pie powered arcade machine and I need it to be 100% reliable. A user land implementation seems like a good compromise over a bare metal application.

Why do you need that level of reliability - is it for potentially commercializing the machine? Sounds like a cool project :)

Re: Gokrazy – A Native Go Userland

#19
post #14

I’m too rudimentary of a developer. What’s a Userland? What is this doing that writing apps as Go executables doesn’t or can’t do?

Until someone more experienced than me comments: The userland is the collection of programs and functionality that run outside of the kernel. AFAIK you need some things (but I'm not sure which) apart from the kernel if you want to run your executables, and it looks like Gokrazy provides those.

To expand on this, it means that once the kernel is done booting, the first (and only) program it will start is the bundled go-written application. This differs from the usual chaining to the "init" (like systemd) process, which would then spawn a myriad of other programs.
Post reply on HN