Hacker News new | ask | show | jobs
by jonpalmisc 1612 days ago
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.
4 comments

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

You don’t have to. Go can make syscalls directly, and it even lets you drop into assembly directly similar to Rust, etc.
Gokrazy doesn't expect you do to anything through FFI or shell commands, though. The whole idea is you write your entire app in Go. The kernel, the Go runtime, and a little bit of gokrazy utility/glue code (e.g. bringing up the network and doing DHCP) are the entire platform.

Edit to add: it would actually be difficult to do FFI or shell commands within gokrazy since there's no dynamic loader to resolve external symbols when you try to execute a dynamically linked library or program. You'd have to add this feature if you wanted to call out to anything built with a dynamically loaded C runtime (which is damn near everything these days, with one notable exception being Go executables built without CGO).

There’s always Rust (^_^)