Follow

Compilers are often written in the language they are compiling. This creates a chicken-and-egg problem that leads users and distributors to rely on opaque, pre-built binaries of those compilers that they use to build newer versions of the compiler.

bootstrappable.org/

@neauoire this is actively on my mind as I return to maintain the clojure compiler I wrote in clojure. self-hosting creates all kinds of headaches and yes the compiler depends on precompiled binaries from previous versions of itself... not great...

@nasser @neauoire I guess it's not easy to bootstrap yours off the mainline Clojure implementation?

I'm spoiled that my own bootstrapping process for Fennel emits readable source as output so you don't have the problem of an uninspectable, inauditable dependency.

@technomancy @neauoire it's a bit of a challenge but technically possible I suppose. We originally bootstrapped off of ClojureCLR, but it was a pain in the ass because of the circular dependency introduced by spec and semantic differences in how MAGIC deals with types.

@neauoire I was going to mention GuixSD's incredible efforts in this space until I saw the website footer. the site is written in Guile and therefore almost certainly a Guix community/devs project itself

but anyway, they've got some pretty robust reproducibility principles for anything that makes it into the main repos. notably I believe they're aiming for the entire toolchain to be bootstrapped off a few hand written hex binaries, and then upwards from there? been a minute since I read it

@neauoire wasn't it a sign that the language works? And people write a compiler in that language that should be able to compile itself?

@neauoire @sirjofri It's also a prerequisite for certain kinds of metaprogramming AFAIK.

@neauoire This is one reason why I like GNU autoconf and automake: It only needs m4 and a shell as dependency — m4 which is a much simpler language.

They pay the price for getting the bootstrap working. That’s one of many reasons I nowadays prefer autotools over other build tools. Despite their also existing problems.

@neauoire
At least #Nim can generate C sources to then build a new compiler but the problem is never fully solved.

Sign in to participate in the conversation
Merveilles

Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them.