Crun: Fully featured OCI runtime and C library for running containers
github.com
github.com
I suspect the conclusion (that Go is not ideal for this kind of low level component) is accurate. OTOH, I wish it could be a memory-safe language instead of C. I can only assume there is some decent reason why Rust isn't used here, though personally I wouldn't know.
Personally I'd prefer people didn't use golang not because of speed but because it's a terrible programming language.
It's a surprisingly divisive language. Go users seem to mostly be happy cranking stuff out but a lot of people hate it.
No generics, a culture of "if err != nil", type system not powerful enough, libraries not pure enough, too verbose, etc.
Sure I can code full applications in GW-BASIC or whatever programming language of similar age, and did, almost 40 years ago.
It doesn't mean I enjoy doing them today, beyond some nostalgic weekend hobby.
Then again, assuming that generics proposal doesn't end the same way as the error one, it won't be that bad.
Go will finally feel like using CLU (from 1975).
Early PHP was a terrible language that people nonetheless built a ton of cool things with, for a variety of ergonomic and social reasons that are not that easy to pin down exactly.
But once the code base grows, it easily becomes a tangled mess.
My biggest con for Go would be the project directory structure. At the toplevel of a project, I like to have only "src", "tests", "docs", "examples" and eventually "containers" if I provide Docker images. With go, it seems that everything should be at the toplevel (or maybe I haven't seen nicely structured projects yet?).
It may have the best features in the world, but if the ecosystem is not there, it will be a pain to use it.
On the opposite, a language can have the worst features and a great ecosystem, for example Python is slow but as great scientific tools, or Javascript has a weird "typing system" but has tons of tools in every domain to make the best of it.
I don't know Bazel though, I'll take a look at it, thanks!
In which directory to store files is an incredibly small and minor detail though.
In my experience, if you open-source a project, it better have to follow conventions. Following conventions makes sure someone else can read your code easily.
> In which directory to store files is an incredibly small and minor detail though.
Yeah it's a small detail, but it is important to me to not get lost in a directory tree.
Random example taken from a github search: https://github.com/gofiber/fiber
Is it really ok to have that much source code at the toplevel? Is the code architecture clear at a glance?
For me, it is not, and I'll have to put in extra work (I'm lazy) to understand the code and how it works.
I don't mind doing that for other projects, but for my projects as I work on them daily, it becomes a pain very quickly.
Naturally C doesn't need bindings, when the OS APIs are written in C.
The distinction I was attempting to make is whether or not C source code is required in your Go project to fully implement a container runtime.
More generally C is just adding some conventions, like 'calling' that can be interacted with by following the rules from e.g assembly or a higher level language that can compile to compatible calls.
- Uses all the static analysers it can get hold of
- Pursues a policy of zero warnings
- Has fuzzing as part of the CI/CD process
I just opened a ticket requesting clarification.
And yes. Low level code requires unsafety sometimes, or at least code that is not provably safe (digression: save for maybe using actual proofs a la seL4?) The important bit about Rust and other memory safe languages is that in Rust, memory unsafeness can be minimized and accounted for. That’s a whole class of bugs that is traditionally basically unmanageable in most non-trivial projects.
Go is also memory safe by default, but the runtime is too heavy, and thus we’re here.
The tests are maintained here: https://github.com/opencontainers/runtime-tools/tree/master/...
I guess this is the closest to be "certified compliant", but that is not enough for working with existing container engines as everyone just assumes runc is used