6 ms·
I daily drive 9front. The historical emergence answers here are fine as far as they go, but they're a bit like saying that Linux is an OS developed by Linus to
by xelxebar 1mo ago
I daily drive 9front.
The historical emergence answers here are fine as far as they go, but they're a bit like saying that Linux is an OS developed by Linus to help him learn x86.
IMO 9front is an exposé of what an OS can look like when it's written for and by hackers with a focus on simplicity. The YouTube channel adventuresin9[0] parades some nice examples of what real world usage looks like.
For example, since everything is just a file, you tunnel traffic with a simple bind mount. Since everything is just text, small regexes suffice to route mouse clicks to UI actions. Since windows are just buffers, grepping history is grepping the window's text buffer; taking a screenshot is just cp-ing the window's draw buffer.
Oh, and 9front C diverges from the standard intentionally in some nice ways: evaluation of function args is sequenced, anonymous unions like
struct {
int a;
union {
uint i;
int j;
};
}
do what you want, the libc is a lot leaner and cleaner, etc.
[0]:https://www.youtube.com/channel/UC7qFfPYl0t8Cq7auyblZqxA https://www.youtube.com/channel/UC7qFfPYl0t8Cq7auyblZqxA
- deleted 1mo ago[deleted]
- wahern 1mo agoC99 added designated initializers and compound literals, and C11 added anonymous structs and unions of the kind you showed above. These are 3 of the biggest features Plan 9 added to C, and they were adopted relatively quickly. But there's another type of anonymous struct/union Plan 9 added; using a bare tag name, e.g. `struct foo { union bar; };` to implicitly define the members. And Plan 9 C will also automagically coerce (and adjust the pointer offset) a struct reference to a reference to a typed anonymous member when calling a function that takes the latter. And now that I think about it, this seems like the obvious predecessor to Go's duck typing.
- asveikau 1mo agoGCC and VC++ supported anonymous structs and unions long before C11.