This is an update for the Goken9cc project I've announced a few months
ago on 9fans (and presented at IWP9): https://github.com/aryx/goken9cc

To summarize: goken9cc is a portable, multi-architecture toolchain — C
compilers, assemblers, and linkers — together with a minimalist C
library, rooted in Ken Thompson's legendary work on the Plan 9 and
Inferno operating systems. First extended by Go developers, this
toolchain now brings cross-platform support for Linux, macOS, and
Windows while preserving the simplicity, elegance, and efficiency of
the original Plan 9 tools.

In the future work section of my talk I was talking about the
support to produce Linux ELF binaries, macOS Mach-O binaries,
and windows PE binaries and it's now all working!

There is also a multiplatform libc similar to the original Plan 9 libc
that can work on 11 architectures (i386, amd64, arm, arm64, riscv32, riscv64,
mips, powerpc, sparc, alpha, m68k) across 4 operating systems (Linux,
darwin, windows, plan9, with xv6 in the work).

We can now even bootstrap goken using goken, that is using it to compile
itself on Linux, macOS, and windows (and we can still bootstrap it
using gcc and clang, the original goal of goken9cc).

The included multiplatform libc is pretty complete as it
can be used to compile goken itself which contains not only the toolchain
but also the code of mk, rc, as well as many Plan 9 utilities.

My plan now is to add a multiplatform libdraw to also produce
Linux, macOS, and windows binaries using graphics (relying on
Russ cox port of libdraw in plan9port and in drawterm).

Happy to answer questions or requests for the project.

PS: the code of goken is synced with my other principia softwarica project
so the code of goken is also fully explain in the principia books
at https://principia-softwarica.org/


AI disclaimer:
95% of the code in goken9cc was written by humans (mostly Ken
Thompson, Rob Pike, Charles Forsyth, Richard Miller, and other Plan 9
contributors), and for the most part written more than 30 years
ago. What I did was essentially to package those old toolchains
together and then use AI to write the remaining 5% so that the
toolchains could work not just on Plan 9 for Plan 9 but also on and
for Linux, macOS, and Windows (imitating for the most part what was
done by Go developers for the Go language).

All the clerical work of finding the right syscall numbers for each
architecture and operating systems for the multiplatform C library in
goken9cc (see lib_core/libc/{arch,syscall,os}) was done by Claude
Code, inspired by what Go developers did for Go (see the
GO/pkg/{syscall,runtime} directories).

Most of the code written by AI is clearly marked with a special
claude: comment at the front and part of a commit authored by Claude
code. You can use the scripts/ai_percentage.py to get authorship LOC
statistics across the different directories in goken9cc.

------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T2bd4bdf3bed27839-Mba276412b5bb732bb23582de
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to