<system>hi! i think this channel is more appropriate for talking about my effort to bootstrap the nim compiler for guix, but please correct me if i'm wrong ***system is now known as unmatched-paren
<unmatched-paren>so i found that the earliest nims were written in pascal, which isn't bootstrapped either :( <unmatched-paren>but it doesn't seem impossible; i'm wondering if it would be possible to compile fpc with either gnu pascal (unmaintained) or one of the three pascal->c converters i've found...? <AwesomeAdam54321>unmatched-paren: Even though GNU Pascal isn't currently maintained, it doesn't mean it can't be used to bootstrap right? <pabs3>AwesomeAdam54321: unmatched-paren quit before your message ***ChanServ sets mode: +o rekado_
<rekado_>yes, I built GHC from source. I configured with “--enable-hc-boot” — the configure script says “Boot the Glasgow Haskell Compiler from intermediate .hc files.” <rekado_>I looked at the .hc files and they like like proper source code to me. <rekado_>doesn’t smell like autogenerated stuff <rekado_>I don’t know … I don’t feel like celebrating yet. This was too easy. <AwesomeAdam54321>unmatched-paren: The generated C code from the converter needs to be human-readable though, or else it can't really be considered source code <rekado_>if you run the converter as part of the build it’s fine <unmatched-paren>p2c segfaults on this alpine proot running in termux on android, but i'll test it on my laptop when i'm able <unmatched-paren>the one thing i'm worried about is that freepascal might be written with fp-exclusive extensions that aren't supported by p2c <rekado_>usually it helps to build an older version first; newer versions might rely on extensions previous versions introduced. <rekado_>I’ll try building GHC 6.0 with GHC 4 next. <stikonas>well, building newer GHC with older should be no big deal, it's just a matter of number of intermediate steps <civodul>rekado_: woohoo! this all sounds like exciting prospects! <rekado_>stikonas: yes, my old notes say that I should do: 4.08.2 -> 6.0 -> 6.6 -> 6.12(?) -> 7.4 -> 7.6 <rekado_>but I’m a little … offended that I didn’t have to do anything special with hugs and interpreting parts of GHC with the compiled RTS from GHC 4 … <stikonas>yes, sounds somehow very easy. But maybe it is <rekado_>if it really was so easy then I wonder why nobody has done it before <rekado_>the only difference is that back then I didn’t have GCC 2.95 <stikonas>would be good to figure out where those .hc files are comming from <rekado_>a total of 4k lines with plenty of comments <rekado_>the C code is just too pre-standard to be built with any more recent GCC <rekado_>we had a discussion about some of the quirks here a few years back <stikonas>still, even if GCC 2.95 has to be used, that's better than non-bootstrappable haskell <rekado_>I haven’t tried GCC 4 — recently anyway <rekado_>my notes don’t say if I tried it back then <rekado_>(I also used Perl 5.14, because of $*) ***attila_lendvai_ is now known as attila_lendvai
<oriansj>rekado: now that is *HUGE* news if true. <oriansj>when you get a chance do a write up so some more people can confirm and start looking for potential blobby bits we need to address <oriansj>unmatched-paren: all bootstrapping discussion is welcome here. and there may be notes on bootstrapping pascal in the channel logs that might interest you <stikonas>oriansj, rekado_: GCC 4.0.4 works just fine <stikonas>oh, actually maybe not everything has built <stikonas>The Glorious Glasgow Haskell Compilation System, version 4.08.2 <rekado_>perl > 5.30 should misbehave silently <rekado_>$* was stripped of its magic and only later was turned into an error. <rekado_>versions since its effect has been removed and prior to turning it into an error will misbehave when multi-line regexp matches are wanted <unmatched-paren>oriansj: i wanted to add first-class https://nim-lang.org support to guix, but in the process i learned that their csources repo that's used for bootstrapping was actually produced by the nim compiler and thus is not source <unmatched-paren>`git log --reverse` revealed that the first nim was written in pascal <Hagfish>i wouldn't have guessed pascal (i don't know what i would have guessed), but having that known and documented and bootstrap would be amazing <unmatched-paren>Hagfish: thanks! there are several pascal to c transpilers around. i'm betting on them rn... <rekado_>stikonas: I built it again with GCC 4.9 (4.8 is broken right now, and we have no earlier minor version in Guix), and while the build seemingly succeeds there are a lot of errors. <rekado_>oddly enough the build system does not consider these fatal <rekado_>with 2.95 I get two messages about missing targets: make[3]: *** No rule to make target 'Array.o', needed by 'libHSstd.a'. Stop. <rekado_>and: make[2]: *** No rule to make target 'utils/Argv.o', needed by 'hsc'. Stop. <rekado_>but no hard build errors like with GCC 4.9 <stikonas>well, maybe later I can try to see if it's easily patchable, shouldn't be too hard <stikonas>gcc 2.95 is fine in principle, but even in Guix janneke wants to move away from it <ekaitz>btw did you guys ever found "configure: error: cannot run C compiled programs." when compiling gcc? <ekaitz>I'm using janneke 's guix package for 4.6.4 but I'm not using TCC and I get that weird error <ekaitz>at least it finds the libraries like it should and looks like everything compiles correctly... <janneke>ekaitz: it could be that i never got this far, dunno <unmatched-paren>note to self: 46c41e436 is the latest nim commit that contains the pascal version <ekaitz>janneke: might be but it looks your thing is pretty mature <ekaitz>anyway the error code is somewhat disturbing <ekaitz>i've been searching about it but the results were pretty wild: from missing glibc (which is not missing) to trying to compile for the wrong architecture (which I'm not doing YET) ***unmatche` is now known as unmatched-paren`
<unmatched-paren`>/gnu/store/2xpvvdh9ks4m4l50jb8p8rjkpq63fnpd-profile/bin/ld:fpmake.pp: file format not recognized; treating as linker script <unmatched-paren`>raw `p2c` complains about `p2crc`, which i think is fixable by creating it, but it seems to try to use /tmp/<guix build directory for p2c>/p2c-2.01/src/p2crc, which of course doesn't exist <unmatched-paren`>wait, doesn't that make `p2c` non-deterministic if it records the directory it was built in? <unmatched-paren`>i've also found `ptoc` which converts pascal to c++, but its license is unclear <stikonas>rekado_: have you managed to solve make[3]: *** No rule to make target 'Array.o', needed by 'libHSstd.a' ? <stikonas>those files in lib/std seem to be built from haskell sources... <unmatched-paren`>okay, p2c will definitely not be adequate to build either nim or fpc. and by the time fpc was imported into version control it was already self-hosting... <stikonas>unmatched-paren`: it's not the first time this happens... <unmatched-paren`>(worth noting that this is not the official repo, just someone uploaded it to github) <unmatched-paren`>hm, actually, p2c might work with nim at least.. probably not with fpc though <unmatched-paren`>although the pascal nim doesn't seem to support some architectures that guix supports, it looks easy enough to patch <unmatched-paren`>does anyone here know pascal? p2c is failing on *one* file, and i can't tell why because it has absolutely no error handling <Hagfish>unmatched-paren`: i think the free software community has been caught out by that sort of licence before <Hagfish>i think elm vs pine is the example i'm thinking of <Hagfish>the author of elm(?) said that although the licence allowed "changing and redistributing" the source code, it didn't allow you to do both <Hagfish>which was not what people had assumed (and maybe not what a court would decide), but the free software community ended up writing their own replacement from scratch, with a saner licenec <Hagfish>the author claimed that the *intent* was that you could only distribute unmodified changes <Hagfish>and that if the licence didn't explicitly allow distribution of derivative works, then that right was specifically withheld <Hagfish>or, withheld by default, under copyright law <rekado_>note also the IRC discussion about the weird C code in the RTS of GHC 4 ***stikonas_ is now known as stikonas
<stikonas>anyway, even if I try, I should probably get gcc 2.95.3... <rekado_>looks like it might not be needed after all <rekado_>the failure to build two .o files may require revisiting this <stikonas>but it's very annoying to build anything in ghc 4 because make just ignores any errors... <stikonas>so one have to scroll back to see what failed