On Wed, Aug 16, 2023 at 10:56 AM Greg Troxel <g...@lexort.com> wrote:

> Jean-Paul Calderone <exar...@twistedmatrix.com> writes:
>
> >> While I'm not likely to dive into haskell (as a language that seems
> >> difficult to use on minority platforms), it's great to see tahoe-lafs
> >> moving beyond a single reference implementation.
> >
> > I'm curious about these "minority platforms".  I think this might mean
> very
> > resource-constrained systems - maybe microprocessor scale?
>
> I think it means "any random operating system and cpu combination that
> there is not a self-hosted toolchain for".
>

Ahh I see.  That makes sense.


>
> But maybe I'm confused.  Can I start with C and C++, no more than C99
> and C++11, and just build a haskell compiler, for say NetBSD with sparc,
> vax, mips, 68000?   I have the impression that everybody uses ghc and
> that it needs a previous version of ghc, and if you aren't using the
> distributed binaries this is hard to deal with.
>

I think you have roughly the right impression.  The usual build workflow is
to get binaries for an older GHC and then build the newer GHC with them.  I
believe you can iterate this process back into history a ways to eventually
reach a point where you can build the older GHC without having another GHC,
but I don't have the details at hand.

GHC has a native code generator but I think it is pretty limited in the
architectures it supports.  However, there are also C and LLVM code
generators - so if you can get a GHC for, say, 68k NetBSD, you can at least
get it to emit C code that your C compiler can deal with.


>
> The pkgsrc entry for ghc says:
>
>   DISTNAME=       ghc-6.8.3
>
>   SITES.ghc-6.4.2-src.tar.bz2=    http://www.haskell.org/ghc/dist/6.4.2/
>   SITES.ghc-6.4.2-i386-unknown-netbsd-hc.tar.gz= ${MASTER_SITE_LOCAL}
>
>   # There is only an i386 bootstrap kit available.
>   ONLY_FOR_PLATFORM=      Darwin-*-i386 FreeBSD-*-i386 NetBSD-*-i386
> OpenBSD-*-i386 SunOS-*-i386
>
>
I'm not sure what to make of this (never really done any BSD packaging) -
at first it looks like it might mean that 6.4.2 is the "old enough" GHC
that you don't need an older GHC to build it - but then the comment about
the "i386 bootstrap kit" throws some doubt on that interpretation.


>
> How does guix deal with haskell, in terms of reduced binary seed and
> reproducible builds?
>

I don't know much about Guix in detail but I think that Nix essentially
punts and accepts a Haskell-project-built binary distribution as a starting
point for building its packages.  Presumably either NetBSD or Nix or Guix
could actually bootstrap all the way from source but it might be considered
too much build work to be worth bothering?

GHC does have the ability to do a "stage 3" build (stage 1 is "build new
GHC with old GHC", stage 2 is "build new GHC with new GHC you just built",
stage 3 is "build new GHC with the new GHC you just built with new GHC")
which in principle can form a kind of check coming from a different
perspective from the "bootstrap from source" check - if your stage 2 and
stage 3 outputs are different, something might be fishy (of course this is
not bulletproof).

-Jean-Paul
_______________________________________________
tahoe-dev mailing list
tahoe-dev@lists.tahoe-lafs.org
https://lists.tahoe-lafs.org/mailman/listinfo/tahoe-dev

Reply via email to