logoalt Hacker News

Show HN: C-compiler to compile TCC for live-bootstrap

52 pointsby fjfaaselast Wednesday at 11:34 PM8 commentsview on HN

Comments

ValdikSStoday at 1:37 AM

Bootstapping is so complex, here's 181-step document to compile Linux: from "commented opcodes" in hex0 to assembler with labels, from simple C compiler to ~c89 compiler to tinycc ~c99 compiler, from simple shell to scheme interpreter to Fiwix unix-like kernel.

https://github.com/fosslinux/live-bootstrap/blob/master/part...

show 1 reply
ACAVJW4Htoday at 3:05 AM

Related: pnut.sh https://github.com/udem-dlteam/pnut just released. It’s a self-compiling C->POSIX shell transpiler that outputs readable shell, aimed at live-bootstrap and reproducible build chains. The shell edition is auditable and can bootstrap a native compiler from just POSIX sh + coreutils. Very much in the spirit of stage0 / compile-from-nothing work.

lrvicktoday at 3:07 AM

Eliminating Mes would be amazing for us in Stagex. Mes is the second longest build in the entire tree (after rust).

stevefan1999today at 12:30 AM

At this point I believe running Common Lisp/Scheme from SectorLisp wouldn't be that far off

show 1 reply
gaigalastoday at 5:47 AM

The thing about Mes is that it does riscv64 too. I don't know the current state of the support, but there is something there.

There are still many pieces of riscv64 missing in the whole thing (an equivalent to Fiwix being the most challenging right now), and realistically only x86 is currently viable. I think riscv64 is the next in line though.

show 1 reply