IRC channel logs

2024-08-19.log

back to list of logs

<stikonas>lrvick: I think haskell there predates bootstrappability of other stuff in guix
<stikonas>well, they had a few attempts at haskell but so far no luckj
<andydude>Irvise: you mean hugs?
<andydude>Irvick: iirc, this guy talked about using hugs to bootstrap GHC: https://www.joachim-breitner.de/blog/748-Thoughts_on_bootstrapping_GHC
<stikonas>there are some newer updates https://www.joachim-breitner.de/blog/802-More_thoughts_on_a_bootstrappable_GHC
<andydude>I wrote a grep clone in Haskell
<lrvick>Hmm. Will keep an eye on the hugs path
<andydude>Also, there seems to be a Haskell=>C option https://gitlab.haskell.org/ghc/ghc/-/wikis/building/unregisterised
<lrvick>So maybe something along the lines of mrustc is possible then
<andydude>But that seems like it might be outside the spirit of bootstrapping
<lrvick>convert ghc to C, then compile it with gcc, then use that to compile ghc
<lrvick>that feels less insane to say now that I have seen mrustc
<andydude>What's mrustc?
<lrvick>mrustc is how rust is bootstrapped now. Mutabah straight ports old versions of rust to C++, compiles them with gcc, then you can use those to compile rust itself native
<lrvick>and bootstrap from there
<lrvick> https://github.com/thepowersgang/mrustc
<andydude>C++ makes a great compilation target
<lrvick>yeah it is the gcc->rustc bridge
<lrvick>so maybe can do similar with ghc
<lrvick>ghc source -> c++ source -> gcc -> ghc
<andydude>Zig also has a C++ impl
<andydude>but I believe it's part of the main repo
<lrvick>yeah, and zig is stupid easy to bootstrap
<lrvick>I already do it in stagex
<lrvick>zig was -built- for bootstrapping. Wish more languages thought about this early
<lrvick>literally just a "cmake" invocation to bootstrap zig
<matrix_bridge><cosinusoidally> Bootstrap from what though? 2.6MB wasm binary? https://github.com/ziglang/zig-bootstrap/blob/master/zig/stage1/zig1.wasm
<matrix_bridge><cosinusoidally> I'm not too familiar with the process, but it seems https://github.com/ziglang/zig-bootstrap/blob/master/zig/bootstrap.c builds a wasm to c converter then converts zig1.wasm into C?
<matrix_bridge><cosinusoidally> If so then you've got an large binary to audit.
<matrix_bridge><cosinusoidally> * n
<matrix_bridge><cosinusoidally> * a
<AwesomeAdam54321>cosinusoidally: Zig can be bootstrapped from version 0.10.0, which doesn't bootstrap from a wasm binary
<matrix_bridge><cosinusoidally> ah fair enough
<matrix_bridge><cosinusoidally> but does that involve walking up the versions one by one like rust?
<oriansj>AwesomeAdam54321: version 0.10.0 was written in zig itself; so you need a 0.9.* to build it from source if I remember correctly.
<matrix_bridge><Andrius Štikonas> But at least for zig there is still a path, even if not direct...
<matrix_bridge><Andrius Štikonas> Haskell or scala don't have any path ...
<lanodan>Yeah that said I wonder how long the 0.9.x compiler will work as it uses LLVM rather than something more stable.
<matrix_bridge><Andrius Štikonas> Well, one will have to build old llvm...
<matrix_bridge><Andrius Štikonas> Just like for rustc
<lrvick>Though if mrustc .74 ships, I can finally drop all old versions of llvm from the stagex tree...
<matrix_bridge><Andrius Štikonas> well, in my gentoo-bootstrap overlay I just used vendored llvm source
<matrix_bridge><Andrius Štikonas> which is a bit inefficient as you need to rebuild them for each rustc version
<matrix_bridge><Andrius Štikonas> but at least it reduces the amount of maintenance that I have to do