Zig specifics aside… build it from source using what? Another compiler. Okay, so you can compile that one from source. But what does that? Another compiler.
Unless you’re recording memory contents and executing instructions by hand, you’ve just discovered the Ken Thompson hack. At some point the pragmatic thing is to trust some bits from a trusted source (e.g. downloaded from an official repo w/ a known cert, etc.).
Rice's Theorem makes the Ken Thompson hack impossible in general. He only executed his hack in a single short-term demonstration against a specific target, but it's not possible to make a "long-con" against an open-source project with lots of activity and lots of people building it even if you find a way to infect nearly all of those people.
I believe GP used assembler to refer to the program which reads your hand-written assembly and produces a binary. That program was presumably given to you so you need to trust it.
No, the only way to solve this problem is to start with a computer entirely devoid of code and bit-bang your assembler into the machine with switches, the way the first users of the MITS Altair did it.
You can also bootstrap the way lisp did and write the fist compiler in the language and get a bunch of grad students to hand-compile it.
But, yeah if you don't have a bunch of grad students at the ready, an assembler hand-written in machine code is the only option if you want to trust the entire stack. Though I'm not sure what that would get you. I don't know of any higher language compilers that are written directly in assembly these days, so you'd never be able to compile your C/C++ compiler.
There was a C compiler written in assembly posted on HN 4 years ago [1]!
So yeah, if you wanted to, you could bit-bang an assembler capable of assembling a simple C compiler, then in your simple subset of C you could implement a full C compiler, and from there you can do anything you want!
The grad student approach also sounds interesting. A basic Lisp interpreter can easily fit on a single letter-sized sheet of paper. A single person could hand-compile that, it would just take longer. But, if you're living alone in a cabin in the woods with your own hand-built computer and a personal library of computer books in hard copy, that would be a totally feasible project.
Unless you’re recording memory contents and executing instructions by hand, you’ve just discovered the Ken Thompson hack. At some point the pragmatic thing is to trust some bits from a trusted source (e.g. downloaded from an official repo w/ a known cert, etc.).