frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://github.com/FransFaase/MES-replacement
67•fjfaase•1mo ago

Comments

stevefan1999•1mo ago
At this point I believe running Common Lisp/Scheme from SectorLisp wouldn't be that far off
agumonkey•1mo ago
don't threaten me with a good time
Imustaskforhelp•1mo ago
So technically someone can run a c compiler written in guile in sectorlisp?

I think that the reason stage0 and other projects work this way is that they found lisp and other projects to be very limiting and there were definitely some reasons that they do things the current way that are mentioned in their docs.

fjfaase•1mo ago
In fact the MES-compiler, the one that I want to replace, is written in Scheme. It also comes with a Scheme interpreter written in C. Before the MES-compiler can be executed the source has to be unzipped and unpacked with two programs that are also compiled from C sources. So, you already need a compiler that supports a sizable subset of C to compile all these programs in order to compile the MES-compiler, which is a rather compliant C-compiler, which is used to compile the Tiny C Compiler and a standard library (included in the MES sources). The unzip and untar programs are also needed to unpack/zip the archive with the Tiny C Compiler sources.
Imustaskforhelp•1mo ago
Super fascinating stuff! I love these kind of stuff. Genuinely reading comments like yours really cheer me up in a way

I had this thought once that there would be a single sd card or hard drive which would allow bootstrapping source and a hash and with systems like tor and torrenting in general combining with self hosted wikipedia perhaps and all the mirrors of open source software I use.

I had this idea that its now possible to have such hard drives if I so desire and I am not usually paranoid but in actuality, feats like bootstrappability remove paranoia because I feel like there must be other people who do this and who verify security and I can always go to them or they exist :)

Bootstrappability is really cool and awesome stuff in my opinion which is severely underrated by many and I am glad that people like you work in helping bootstrappability. Have a nice day!

Regarding the comment itself, I didn't know that this was the case of Mes as I had just thought the only thing it depends on is scheme but thanks for sharing information about this.

kazinator•1mo ago
Once everything is unpacked, are the resulting compiler materials sufficient to compile and run those packing and unpacking programs?
fjfaase•1mo ago
I am not sure if follow you completely. Yes, I guess it is the case, but what is the use? Before you can compile the Tiny C Compiler, you already need to unpack the .tar.gz file containing the sources. The sources for ungz and untar

So, you need a minimal C compiler that can also compile the ungz and untar programs from their C sources. At the moment, I have a minimal C compiler that can compile the Tiny C Compiler and the standard library that is part of the GNU Mes compiler. One of the following tasks will be to see if it can also compile the sources for ungz and untar, which can be found in [0]. I think it will be not so hard as these sources already have been adapted to be compiled with a minimal C compiler.

[0] https://github.com/oriansj/mescc-tools-extra

fjfaase•1mo ago
I understand that you mean that SectorLisp is taken as the 'seed' that we have to trust that it is not malicious (or secretly executes a malicious program if its finds it). In the live-bootstrap project it is 'hex0' that is the seed, a simple program that converts hexadecimal character (by pairs) into bytes.
ValdikSS•1mo ago
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...

fjfaase•1mo ago
I have been reviewing stage0 and gave a presentation, 'reviewing live-bootstrap' about it at WHY2025, in which I also made some suggestions about improving stage0. I am now working on this.

What I refer to as stage0 is the first 19 steps of the mentioned description, which actually involves the execution of over 700 executables. (See presenration for T-diagran.) I believe that number can reduced by at least a half.

Imustaskforhelp•1mo ago
Please share me the youtube video regarding the presentation for bootstrapping as I find the idea of bootstrapping really pleasant and like I am most likely sure that although I am more an arch(cachy) personal user/debian for servers users. I feel like even these are adding reproducibility and I am sure that nixos can be reproducible https://news.ycombinator.com/item?id=38057591

Guix can definitely be bootstrapped but there are comments on this post where someone tries to reproduce nix with tcc etc.

Imagining the ability that nix can be completely bootstrapped makes me feel like it can be really good for these purposes

Like if this is reproducible and bootstrappble, then I am satisfied with the hash because other people can test it out to verify they get the same hash and I can download the iso's and then verify the hash myself to find complete safety.

Although I might still be trusting my linux iso but maybe we will have risc-v hardware where I can plug in an sd card or data or similar and it can give the hash of it for the extremely paranoid (maybe universities or very secure companies perhaps?)

After that (or quite frankly just the hash part for 99% people), I can then flash the iso to any and every hardware with complete verification

Although I feel like this still won't help if the firmware or the hardware itself can't be trusted. I mean even in corebooted chromebooks, the intel TPM only stops the ability of sending the bytecode over wire but it itself really can't be stopped. Maybe we will have risc-v machines but they would rather be really expensive.

I think tho librebooted thinkpads + nixos/guix can be really great for privacy perhaps. But what are your reasons why bootstrappability fascinates you (for me its this stacking aspect and then finally we get some useful os without having to trust anything but source which we can read/heck even audit ourselves or have the shared faith that the source code is audited by security people since its completely readable)

fjfaase•1mo ago
At WHY2025: https://www.youtube.com/watch?v=akzyyO5wvm0 with (interactive) notes: https://www.iwriteiam.nl/WHY2025_talk.html

At Hackfest Enschede 2024: https://www.youtube.com/watch?v=eKXMwVqaauc with notes: https://www.iwriteiam.nl/Hackfest_2024.html

lioeters•1mo ago
I love this project, what it's aiming to achieve. Thanks for sharing the links!

It's very interesting, making a C compiler that supports a small subset of C, enough to compile TCC. And the stack-based language as intermediate representation. I found a treasure trove of implementation notes, enjoying reading it. https://fransfaase.github.io/Emulator

dataflow•1mo ago
Are they gonna keep doing this with Rust etc.?
fjfaase•1mo ago
The idea of bootstrapping is that you start with nothing, or at least with almost nothing. In case of stage0 (the first stage of live-bootstrap) this a small program that converts a file with hexadecimal characters (in pairs) to a binary file. From there you have to build everything. To compile Rust, you need a Rust or C compiler, I understand. I have no idea how hard it would be to build a minimal Rust compiler that could compile itself, one that not necessary performs all the checks that the (full) Rust compiler would do.

I think that Rust is build as part of live-bootstrap, but at a much later stage when the latest version of the GNU C compiler has been build.

csb6•1mo ago
There was a project [0] to write a bare bones rust compiler (no borrow checking) in C that aims to be able to build rustc in order to simplify bootstrapping, but it seems to have stalled.

[0] https://notgull.net/announcing-dozer/

steveklabnik•1mo ago
You would get a C++ compiler going and then build mrustc and then use that to build rustc and then use that to build the version of rustc you want.
fjfaase•1mo ago
The latest version of g++ is written in C++. If I am not mistaken g++ 4.7.4 is the oldest version that is written in C. But it does not support the C++ version in which the latest version of g++ is written. For that you have to compile g++ 10.4.0 first. And g++ 4.7.4 cannot be compiled by the Tiny C Compiler (tcc). The total chain then becomes:

tcc 0.9.26 → tcc 0.9.27 → gcc 4.0.4 → g++ 4.7.4 → g++ 10.4.0 → g++ 13.1.0

ACAVJW4H•1mo ago
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.
lrvick•1mo ago
Eliminating Mes would be amazing for us in Stagex. Mes is the second longest build in the entire tree (after rust).
gaigalas•1mo ago
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.

fjfaase•1mo ago
Stage 3 or 4 support for the other targets is also planed. This will require some small adaptations to the compiler for 32 to 64 word size and Stack-C versions for those targets.
gaigalas•1mo ago
I am currently watching closely both yours, pnut.sh (already mentioned in the thread) and https://github.com/cosinusoidally experiments. I think they all have something good to contribute.

These first steps interest me very much, and perhaps x86-only is the best we'll get for a foreseeable future (10 years or so), considering how difficult builder-hex0/fiwix is to port to another arch and how crucial it is for the whole concept.

The GCC 4.7 RISC port and other things are nice (higher stages), but they are short term practical goals. I think the future lies in very specialized bootstrap-specific software that can cut lots of corners at once.

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
247•isitcontent•17h ago•27 comments

Show HN: Kappal – CLI to Run Docker Compose YML on Kubernetes for Local Dev

https://github.com/sandys/kappal
6•sandGorgon•2d ago•2 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
350•vecti•19h ago•157 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
316•eljojo•20h ago•195 comments

Show HN: MCP App to play backgammon with your LLM

https://github.com/sam-mfb/backgammon-mcp
3•sam256•1h ago•1 comments

Show HN: R3forth, a ColorForth-inspired language with a tiny VM

https://github.com/phreda4/r3
77•phreda4•16h ago•14 comments

Show HN: Smooth CLI – Token-efficient browser for AI agents

https://docs.smooth.sh/cli/overview
93•antves•1d ago•70 comments

Show HN: I'm 75, building an OSS Virtual Protest Protocol for digital activism

https://github.com/voice-of-japan/Virtual-Protest-Protocol/blob/main/README.md
5•sakanakana00•2h ago•1 comments

Show HN: I built Divvy to split restaurant bills from a photo

https://divvyai.app/
3•pieterdy•2h ago•0 comments

Show HN: ARM64 Android Dev Kit

https://github.com/denuoweb/ARM64-ADK
17•denuoweb•2d ago•2 comments

Show HN: BioTradingArena – Benchmark for LLMs to predict biotech stock movements

https://www.biotradingarena.com/hn
26•dchu17•21h ago•12 comments

Show HN: Slack CLI for Agents

https://github.com/stablyai/agent-slack
49•nwparker•1d ago•11 comments

Show HN: Artifact Keeper – Open-Source Artifactory/Nexus Alternative in Rust

https://github.com/artifact-keeper
152•bsgeraci•1d ago•64 comments

Show HN: I Hacked My Family's Meal Planning with an App

https://mealjar.app
2•melvinzammit•4h ago•0 comments

Show HN: I built a free UCP checker – see if AI agents can find your store

https://ucphub.ai/ucp-store-check/
2•vladeta•5h ago•2 comments

Show HN: Gigacode – Use OpenCode's UI with Claude Code/Codex/Amp

https://github.com/rivet-dev/sandbox-agent/tree/main/gigacode
19•NathanFlurry•1d ago•9 comments

Show HN: Compile-Time Vibe Coding

https://github.com/Michael-JB/vibecode
10•michaelchicory•6h ago•1 comments

Show HN: Slop News – HN front page now, but it's all slop

https://dosaygo-studio.github.io/hn-front-page-2035/slop-news
15•keepamovin•7h ago•5 comments

Show HN: Daily-updated database of malicious browser extensions

https://github.com/toborrm9/malicious_extension_sentry
14•toborrm9•22h ago•7 comments

Show HN: Micropolis/SimCity Clone in Emacs Lisp

https://github.com/vkazanov/elcity
172•vkazanov•2d ago•49 comments

Show HN: Horizons – OSS agent execution engine

https://github.com/synth-laboratories/Horizons
23•JoshPurtell•1d ago•5 comments

Show HN: Falcon's Eye (isometric NetHack) running in the browser via WebAssembly

https://rahuljaguste.github.io/Nethack_Falcons_Eye/
5•rahuljaguste•16h ago•1 comments

Show HN: Fitspire – a simple 5-minute workout app for busy people (iOS)

https://apps.apple.com/us/app/fitspire-5-minute-workout/id6758784938
2•devavinoth12•10h ago•0 comments

Show HN: Local task classifier and dispatcher on RTX 3080

https://github.com/resilientworkflowsentinel/resilient-workflow-sentinel
25•Shubham_Amb•1d ago•2 comments

Show HN: I built a RAG engine to search Singaporean laws

https://github.com/adityaprasad-sudo/Explore-Singapore
4•ambitious_potat•11h ago•4 comments

Show HN: Sem – Semantic diffs and patches for Git

https://ataraxy-labs.github.io/sem/
2•rs545837•11h ago•1 comments

Show HN: A password system with no database, no sync, and nothing to breach

https://bastion-enclave.vercel.app
12•KevinChasse•22h ago•16 comments

Show HN: GitClaw – An AI assistant that runs in GitHub Actions

https://github.com/SawyerHood/gitclaw
10•sawyerjhood•23h ago•0 comments

Show HN: FastLog: 1.4 GB/s text file analyzer with AVX2 SIMD

https://github.com/AGDNoob/FastLog
5•AGDNoob•13h ago•1 comments

Show HN: Craftplan – I built my wife a production management tool for her bakery

https://github.com/puemos/craftplan
568•deofoo•5d ago•166 comments