Skip to content
codingncaffeine edited this page Sep 1, 2026 · 8 revisions

Welcome to the Sashfold wiki!

Why C++?

1. The pledge changes the math. Most of modern C++'s misery is dependency and ecosystem misery — vendored libraries,
   ABI drift, supply-chain rot. Sashfold has zero dependencies by constitution. We link the OS and the standard
   runtime, nothing else. Meanwhile the strongest practical argument for the alternatives — their package ecosystems
   — is something the pledge bans us from using anyway. A zero-crate Rust browser gives up much of what makes Rust
   productive; at that point you're comparing bare languages, not ecosystems, and the gap narrows a lot.

 2. The problem domain is C++-shaped. Every mature engine — Blink, WebKit, Gecko — is C++. The entire institutional
   literature of engine-building (LayoutNG's design docs, WebKit internals, the specs' own implementation notes)
   speaks C++. When we ask "how did the mature ones solve this," the answer arrives in our language. And the spec's
   core algorithms — the adoption agency, foster parenting, tree mutation with back-pointers everywhere — are
   aliasing-heavy graph surgery that safe Rust pushes into index-arenas and unsafe blocks anyway (Servo's history
   shows this). You end up hand-rolling pointer discipline either way; we just do it with forty years of reference
   material behind us.

3. We sit on the raw OS ABI, and C++ is that ABI. Win32 directly, AppKit via objc_msgSend, the Wayland wire protocol
   over a socket. No bindings, no FFI layer, no generated glue — which for anyone else would be dependencies.

4. Safety here is a process, not a language checkbox. Every parser is fuzzed from the week it's born; ASan/UBSan
   lanes run in CI on every push; conformance ratchets stop regressions; and the endgame architecture is
   multi-process with sandboxed renderers — which even memory-safe browsers need, because the language stops none of
   the logic bugs, spec violations, or sandbox-escape classes. We write C++23 under a disciplined subset: RAII,
   single-owner arenas (the DOM is a node soup of unique_ptrs owned by the Document), -Werror with a tall warning
   wall, no raw new/delete in engine code. The C++ people hate is C++98 plus a thousand unvetted dependencies.
   That's not what this is.

5. The honest scope note. If this were a fifty-person team building for a decade under CISA memos, the
   memory-safe-language pressure would weigh differently. For a from-scratch engine whose identity is "every byte
   ours, fuzzed from birth, sandboxed eventually," C++23 is the pragmatic optimum — and the project's other purpose
   (a legible engineering signal to engine teams, who are all C++ shops) only reinforces it.

Clone this wiki locally