Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I didn't get it, what could gcc/clang potentially bring to Plan9?


Plan9 uses a different dialect of C written by Ritchie (his last compiler) than most of today's software. Also, the standard library and programming model are quite substantially different than the ANSI C model. There is something on Plan9 called APE (ANSI Posix Environment), which is kind of like WINE (an emulation layer, not an emulator or compatible ABI), for porting ANSI C apps, but it's built with a rather old version of GCC and is far from complete.

Meaning, most software won't run on Plan9 without major modifications, so bringing a modern GCC/CLANG would give access to better compilation, but really there needs to be more work on APE to get more software over (lots of low hanging fruit there from what I've seen).


APE isn't anything like wine. It's just some libraries that give you a posix-ish api. It also doesnt use GCC at all, it uses kencc (the native plan 9 compiler) and cpp.


then they could have just updated ape, should be less work than trying to babysit gcc.


A modern optimization pipeline.


A lot of the fun of the Plan 9 compiler and source organization is that it doesn't optimize; instead, it compiles fast. Like the whole OS in about a minute (on a Raspberry PI). Or maybe it's 2 minutes, I don't recall.

The Go folks have adopted some of the same ideas (minimal optimization and no nested include files), and they build on the experience of the Plan 9 compiler to better divide the work between the "compiler" and "linker", so we gain more from parallel make.


Whole system takes about 55 minutes on a Raspberry Pi. Just the kernel takes a bit over a minute.

The build speed doesn't matter much if you don't like the runtime speed.


Note that the pi is about as fast as a 233 MHz pentium 2.


Aha! That makes so much sense to me. My first PC, which I still have (runs OpenBSD nowadays), is a 350 MHz Pentium II. When I got my Raspberry Pi (a version 1 model B), running a 500 MHz ARM, I was a little taken aback by just how much slower it seemed than my old P2 box. It's got a faster clock and more RAM, how could that be? But it certainly feels slower!

Do you have any sources on this? Can you perhaps link me to something that explains the differences between the ARM and the P2 that lead to such a difference in performance despite the clock speeds?


Runtime speed isn't much of an issue for us. There's nothing in the codebase that large or complicated enough to be slow.


I remember benchmarking plan9 C against gcc waaay back; 1999 or so. Gcc'd programs were a fair bit faster. And I was compiling and running the programs under cygwin under Windows95!

I did this partly because plan9 had published some source code and times on a system with exactly the same hardware as mine - AMD k6/350.

I suspect the plan9 compiler hasn't had nearly as many changes since then so the gap would be much wider.

I acknowledge compile time is important also - and this is where the plan9/golang people have made a reasonable trade-off.


What does an operating system gain from maintaining its own slightly special C compiler?


independence from complex, unmaintainable, ever moving code that is mostly controlled by other people who don't share our values. for example nobody in the loonix community seems to be able to ensure that cross-compiling works.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: