IRC channel logs

2026-09-16.log

back to list of logs

<Guest26>While trying to bootstrap valac from commit c300d9c3d0af08f628b6c260bdd32f431a47e0f2, everything goes fine up until needing to parse .y grammar files. Bison, then, freaks out and complains about many things but throws errors for undefined types ("$$ --> ...").
<Guest26>Does anybody have a clue about what could be happening? I even tried compiling with oyacc, but no luck.
<pullpullpull> /server add -auto -network Libera irc.libera.chat 6697 -tls
<pullpullpull>my bad! I didn't mean to type that as a message
<pullpullpull>I wanted to ask if anyone made progress bootstrapping haskell?
<xentrac>np. I was going to respond, "Well, I'll try" :)
<pullpullpull>bootstrapping haskell?
<matrix_bridge><Jeremiah Orians> Well if you mean Haskell the language; there are several successful projects. If you mean bootstrapping GHC, then that is thus far has not been achieved
<pullpullpull>I meant GHC because afaik it's the only "mainstream" haskell compiler
<pullpullpull>and easily the most complex
<matrix_bridge><Jeremiah Orians> Yeah, tends to be the pattern of people implementing a compiler in the language being compiled tend to immediately turn around and start using those new features
<pullpullpull>Its because ghc 0.29's source code requires an old environment to compile, right?
<matrix_bridge><Jeremiah Orians> I wish that was the problem; if it was one of our brilliant Guix packagers would have solved it in an afternoon
<pullpullpull>then why has no one been able to?
<matrix_bridge><Jeremiah Orians> Why would it be hard to implement all of the used language features needed to compile a language that its own collection of developers spent nearly a decade working on?
<matrix_bridge><Jeremiah Orians> Well, because it would take someone who likes working on compilers and Haskell to spend about 2-3 years of work in a language other than Haskell (or limited to one of the bootstrapped Haskell subsets) to finally solve that gap.
<matrix_bridge><Jeremiah Orians> So what is likely going to occur is one of the subsets is going to grow until it can compile GHC or someone is going to have to demonstrate that they are a world class programmer and just do it themselves. (The first option is unfortunately much more likely)
<pullpullpull>I never said its needed to implement all of the features, I'm asking why it's not possible to emulate the environment that ghc 0.29 was compiled in and use that as a chain.. I understand how complex haskell with all of it's language features is. I'm neither surprised nor perplexed as to why no one would spend so much time to produce a "from scratch" compiler for haskell, my question was
<pullpullpull>entirely different. I study type theory, I have little experience with bootstrapping however I found the idea very interesting so I wanted to help, I don't appreciate the sarcasm, acting like I am an idiot for not being super knowleageable in this hyper niche field
<matrix_bridge><Jeremiah Orians> Not being sarcastic but it is easy to have communication issues in text alone ^_^ and I apologize that I gave you that impression.
<matrix_bridge><Jeremiah Orians> We are able to do exotic environments using qemu and just extract the generated binaries from any arbitrary kernel/library/environment combination for which we are able to build the components.
<matrix_bridge><Jeremiah Orians> If I remember correctly rekado did attempt exactly that in 2017. https://elephly.net/posts/2017-01-09-bootstrapping-haskell-part-1.html
<matrix_bridge><Jeremiah Orians> Additional details about it can be found here: https://github.com/nomeata/bootstrapping-haskell
<pullpullpull>Thanks, I'll look into it, it seems really interesting
<matrix_bridge><Jeremiah Orians> Guix currently uses a generated C blob to bootstrap GHC. But no one has taken that blob as a spec and done the work yet.
<pullpullpull>Sorry, I understood none of that :<, I don't know much about Guix but I'll study it as soon as I get the time to
<matrix_bridge><Jeremiah Orians> Well, feel free to ask clarifying questions. We are all here to learn, share and help each other. But as we are distributed around the globe, sometimes the answers may be delayed.
<AwesomeAdam54321>Guest26: I think this should fix the errors: https://paste.debian.net/hidden/df7d7ae5
<AwesomeAdam54321>After building valac with `-fpermissive` for a few files, the compiler can be built and generate C code for the test cases
<AwesomeAdam54321> https://termbin.com/h5by0
<notgull>I think the three main languages that haven’t been bootstrapped yet are Haskell, Kotlin and Scala
<notgull>Oops, four, forgot about Pascal
<notgull>I was working with QBE a while ago to try to make it a viable compiler backend for bootstrap compilers
<matrix_bridge><Jeremiah Orians> Yeah but of those pascal is definitely the easiest to bootstrap. As one could do a 1:1 translation between FreePascal’s pascal source code and C in a month.
<notgull>Yeah
<notgull>Although it would probably be best to use a non-bespoke compiler backend
<vagrantc>well, as the root of a bootstrapping path, sometimes a bespoke compiler is exactly the right thing to do ...
<vagrantc>e.g. compiling rust requires to build all the intermediate compiler versions e.g. to build rust 1.90 you need to build rust 1.x, and 1.x+2 requirse 1.x+1 ... and nearly every version in between