[2] ai.viXra.org:2608.0059 [pdf] submitted on 2026-08-17 20:43:05
Authors: Brent Hartshorn
Comments: 11 Pages.
Cross-language interoperation is normally a matter of agreeing on a boundary: a foreign function interface, a generated shim, a marshalling layer, or a shared intermediate representation. We describe a system in which no boundary exists. Subsets of C++ and of Rust are each lowered to plain C source, and one C compiler consumes the result, so a Rust function calling a C++ method is a C function calling a C function — same translation unit, same intermediate representation, same register allocator. The two lowerings are chosen to converge on identical symbols, with the consequence that a Rust impl Drop and a C++ destructor over the same data emit the same function, and a C++ class may hold a Rust value by value without a shim, a wrapper, or an annotation.Removing the boundary between the languages exposes a second one, below them: the artifact is C, but a C compiler, an assembler, a linker and a runtime still stand between C and a running program, and conventionally those are separate projects. We report a stack in which they are not. The whole path — two source languages to C, C to machine code, machine code to a static ELF executable — is roughly fifty thousand lines in one repository, with no external compiler, assembler, linker or C library involved.
Category: Data Structures and Algorithms
[1] ai.viXra.org:2608.0014 [pdf] submitted on 2026-08-03 17:55:12
Authors: Brent Hartshorn
Comments: 6 Pages. https://github.com/brentharts/crust/
We present Crust, a self-hosted compiler that accepts C, a subset of C++, a subset of Rust and a subset of rpython in a single translation unit, together with its own assembler, linker, freestanding runtime and operating system. After bootstrap the chain depends on no external toolchain: not GCC, not LLVM, not GNU as or ld, and not a host libc. The system is deliberately kept small enough that its entire call graph fits in the context window of a large language model, and we argue this constraint is what makes a system auditable in an era when the reader is increasingly a machine. As a worked example we take the removal of a layer usually treated as part of the machine — the return-address stack — and, with archived and reproducible measurements [20], show both a two-order-of-magnitude pitfall in the naive implementation and a regime in which abandoning the stack is faster than the hardware’s own return predictor. The point of the example is not the speed but the epistemics: the pitfall, the fix, and the regime were each found, made, and checked inside a toolchain small enough to read whole.
Category: Data Structures and Algorithms