Hi everyone.

So, right now I am trying to figure out how best to integrate Go support to
HelenOS mainline. Some of you know that the way I support Go in my personal
branches is not quite satisfactory to me.

First of all, let me explicitly state the "why". My intention behind Go
support is to have a modern, reasonably memory-safe language to write
system components with. That means several things. First, it is unnecessary
to support all the features from the start (as long as it is easy to just
not use them). Second, there should be as little mandatory library code as
possible (trusted computing base). Third, since Go is garbage-collected (in
itself a good thing, since it helps memory safety, but may be bad for
performance and/or memory use), we may want to make it possible to optimize
programs wrt memory usage and fine-tune the allocator's and
garbage-collector's behavior. Note that all contemporary Go compilers (most
importantly gccgo) emit native machine code, so there is no virtual
machine. Also, code compiled by gccgo can directly call C-language
functions.

With all that in mind, here is what I have come up with so far:

lib/gocore:
The basic runtime support (mostly support for important function calls
emitted by the gccgo compiler). As little code as possible if it can be
helped. Non-critical parts of the runtime should be kept in a separate
library if possible.

(maybe) lib/gomore:
In case some functionality can be stripped down to basics for the default
variant, this library can contain a more complex full-featured
implementation. One example that comes to mind is profiling/debugging
features and such things.

lib/gomem:
Memory allocator and garbage collector (mostly copied from the official
distribution). This is an important component, but keeping it in a separate
library makes it possible to write different implementation of the same
thing if useful. Not to mention it's a huge piece of code and modularity is
always good.

lib/gomap:
Hash map implementation. Hash map is a native type in Go, but it is not
critical for anything and still a very complicated piece of code.

lib/gochan:
Channel implementation. Same reason as above.


golib directory - since Go code has modular structure through "packages",
and generally does not use makefiles, a separate golib directory would be
useful for them. This directory would contain all the Go libraries written
specifically for HelenOS. Also, a support for automatically downloading and
building third-party packages (e.g. parts of the official package
library[1], and other useful stuff[2]) would be nice. Noncritical parts of
the runtime that can be implemented in Go would also go here.


So, this is basically it. What do you guys think?

-- Jirka Z.

[1] http://golang.org/pkg/
[2] http://golang.org/doc/code.html#remote
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to