Re: Happy / Alex description for Haskell2010

2018-10-25 Thread Sam Halliday
Thanks Doaitse,

I'm not looking for a parser that I can run, I am mostly interested in
the codified BNF, to study, and adapt.

I'll take a look at the Utrecht Haskell Compiler in any case, as it
sounds interesting... do you mean this file?
https://github.com/uhc/uhc/blob/master/EHC/src/helium/Parser/Parser.hs

On Thu, 25 Oct 2018 at 20:11, Doaitse Swierstra  wrote:
>
> I do not know why you do need a Haskell parser, but the Utrecht Haskell 
> Compiler contains a combinator based Haskell parser (using the uulib package, 
> supporting the offside rule) which might serve your needs. It can easily be 
> adapted if needed.
>
>  Doaitse Swierstra
>
>
>
> > Op 25 okt. 2018, om 20:31  heeft Sam Halliday  het 
> > volgende geschreven:
> >
> > Hello all,
> >
> > Is there a Happy / Alex file describing Haskell2010?
> >
> > I can see the versions in the ghc source tree, but of course they
> > support all the ghc extensions. The link to the hsparser page [1] in
> > the Happy documentation doesn't seem to exist anymore.
> >
> > I would also love to hear if there is a Bison definition.
> >
> > Best regards,
> > Sam
> >
> > [1] 
> > http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne/haskell_libs/hsparser.html
> > ___
> > Glasgow-haskell-users mailing list
> > Glasgow-haskell-users@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Happy / Alex description for Haskell2010

2018-10-25 Thread Sam Halliday
Hello all,

Is there a Happy / Alex file describing Haskell2010?

I can see the versions in the ghc source tree, but of course they
support all the ghc extensions. The link to the hsparser page [1] in
the Happy documentation doesn't seem to exist anymore.

I would also love to hear if there is a Bison definition.

Best regards,
Sam

[1] 
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne/haskell_libs/hsparser.html
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Unable to compile ghc-8.2.2 with ghc-8.4.3

2018-08-31 Thread Sam Halliday
Hi Ben,

Updating the new build tool is e right thing to do, long term, but it
unfortunate doesn't help with my objective of compiling old versions of ghc
... but there is a quick here that I could exploit. Since I'm building for
the same platform, bug just using different versions of the operating
system, I think I can create the C files in an old Debian inside docker and
use them in the more modern host machine to build the old ghc.

On Fri, 31 Aug 2018, 15:36 Ben Gamari,  wrote:

> Sam Halliday  writes:
>
> > Hi Ben,
> >
> > This would definitely help. I could use a docker image of a really old
> > OS that has old ghc binaries available, to generate the .c for that
> > old version of GHC (e.g. v 7.0 or something). Then I could use those
> > files to bootstrap a ghc 7.0 on my machine, and from there every
> > version of ghc since. It would make a lot of sense for the
> > "unregistered" sources to be made available as an optional download
> > alongside the source code, if haskell.org were open to that
> > possibility.
> >
> This is a very interesting idea. The build system currently isn't
> really setup in a way to make this possible, but this could likely be
> changed in our new build system, Hadrian. Also, I suspect this would
> require some adjustments to the C code generator, which very likely has
> some platform dependence in its output.
>
> Perhaps you'd like to try picking up this task?
>
> Cheers,
>
> - Ben
>
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Unable to compile ghc-8.2.2 with ghc-8.4.3

2018-08-31 Thread Sam Halliday
Hi Ben,

This would definitely help. I could use a docker image of a really old
OS that has old ghc binaries available, to generate the .c for that
old version of GHC (e.g. v 7.0 or something). Then I could use those
files to bootstrap a ghc 7.0 on my machine, and from there every
version of ghc since. It would make a lot of sense for the
"unregistered" sources to be made available as an optional download
alongside the source code, if haskell.org were open to that
possibility.

Best regards,
Sam


On 22 August 2018 at 21:20, Ben Gamari  wrote:
> Indeed, GHC can indeed produce (very slow) C. This is known as
> unregisterised mode [1]. That being said, I'm not sure that helps you with
> the task at hand. Afterall, you still would need a haskell compiler to build
> your unregisterised compiler.
>
> [1] https://ghc.haskell.org/trac/ghc/wiki/Building/Unregisterised
>
> On August 22, 2018 12:12:27 PM EDT, Sam Halliday 
> wrote:
>>
>> Hi Tom,
>>
>> I'm not sure it is necessary to go back that far. Vitaly pointed out
>> that any version of GHC could produce the "minimal C" output, which
>> can be ported to another platform that doesn't have a GHC, as the
>> bootstrap. I'm not entirely sure how to generate that output, mind
>> you.
>>
>> On 22 August 2018 at 17:05,   wrote:
>>>
>>>  (I haven't actually done this, but:) If you want to be able to install
>>> GHC without any GHC binary, I think you'd have to start with an ancient
>>> version of GHC which wasn't itself written in Haskell, and build successive
>>> versions (skipping as many as possible) until you had a GHC which supported
>>> all the language features the most-recent version requires.
>>>
>>>  If you did embark on this, it would be nice if you could report back
>>> with a minimal number of steps it takes to get to current GHC!
>>>
>>>  Tom
>>>
>>>>  El 22 ago 2018, a las 06:01, Sam Halliday 
>>>> escribió:
>>>>
>>>>  Hi Ben,
>>>>
>>>>  What is the recommended way to build old versions of GHC? The
>>>>  haskell.org binaries for, e.g. 7.8.3, do not work on my machine. If I
>>>>  attempt to recompile ghc 7.8.3 with the haskell.org binary, I get
>>>>  linkage errors.
>>>>
>>>>  Actually I'd love to be able to bootstrap a build without any ghc
>>>>  installed... that would solve the problem. I heard about the "phase0"
>>>>  approach from Vitaly Bragilevsky at his Lambdaconf talk this year. But
>>>>  I've been unable to find any documentation about it.
>>>>
>>>>  Best regards,
>>>>  Sam
>>>>
>>>>
>>>>>  On 22 August 2018 at 12:30, Ben Gamari  wrote:
>>>>>  In general we don't support bootstrapping older GHCI with newer GHC.
>>>>>  However, you may be able to hack something together by manually
>>>>> tweaking
>>>>>  bounds.
>>>>>
>>>>>  Cheers,
>>>>>
>>>>>  - Ben
>>>>>
>>>>>  --
>>>>>  Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>>>> 
>>>>>
>>>>>  Glasgow-haskell-users mailing list
>>>>>  Glasgow-haskell-users@haskell.org
>>>>>  http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>>>>
>>>> 
>>>>
>>>>  Glasgow-haskell-users mailing list
>>>>  Glasgow-haskell-users@haskell.org
>>>>  http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Unable to compile ghc-8.2.2 with ghc-8.4.3

2018-08-22 Thread Sam Halliday
Hi Tom,

I'm not sure it is necessary to go back that far. Vitaly pointed out
that any version of GHC could produce the "minimal C" output, which
can be ported to another platform that doesn't have a GHC, as the
bootstrap. I'm not entirely sure how to generate that output, mind
you.

On 22 August 2018 at 17:05,   wrote:
> (I haven't actually done this, but:) If you want to be able to install GHC 
> without any GHC binary, I think you'd have to start with an ancient version 
> of GHC which wasn't itself written in Haskell, and build successive versions 
> (skipping as many as possible) until you had a GHC which supported all the 
> language features the most-recent version requires.
>
> If you did embark on this, it would be nice if you could report back with a 
> minimal number of steps it takes to get to current GHC!
>
> Tom
>
>> El 22 ago 2018, a las 06:01, Sam Halliday  escribió:
>>
>> Hi Ben,
>>
>> What is the recommended way to build old versions of GHC? The
>> haskell.org binaries for, e.g. 7.8.3, do not work on my machine. If I
>> attempt to recompile ghc 7.8.3 with the haskell.org binary, I get
>> linkage errors.
>>
>> Actually I'd love to be able to bootstrap a build without any ghc
>> installed... that would solve the problem. I heard about the "phase0"
>> approach from Vitaly Bragilevsky at his Lambdaconf talk this year. But
>> I've been unable to find any documentation about it.
>>
>> Best regards,
>> Sam
>>
>>
>>> On 22 August 2018 at 12:30, Ben Gamari  wrote:
>>> In general we don't support bootstrapping older GHCI with newer GHC.
>>> However, you may be able to hack something together by manually tweaking
>>> bounds.
>>>
>>> Cheers,
>>>
>>> - Ben
>>>
>>> --
>>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>> ___
>>> Glasgow-haskell-users mailing list
>>> Glasgow-haskell-users@haskell.org
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>> ___
>> Glasgow-haskell-users mailing list
>> Glasgow-haskell-users@haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Unable to compile ghc-8.2.2 with ghc-8.4.3

2018-08-22 Thread Sam Halliday
Hi Ben,

What is the recommended way to build old versions of GHC? The
haskell.org binaries for, e.g. 7.8.3, do not work on my machine. If I
attempt to recompile ghc 7.8.3 with the haskell.org binary, I get
linkage errors.

Actually I'd love to be able to bootstrap a build without any ghc
installed... that would solve the problem. I heard about the "phase0"
approach from Vitaly Bragilevsky at his Lambdaconf talk this year. But
I've been unable to find any documentation about it.

Best regards,
Sam


On 22 August 2018 at 12:30, Ben Gamari  wrote:
> In general we don't support bootstrapping older GHCI with newer GHC.
> However, you may be able to hack something together by manually tweaking
> bounds.
>
> Cheers,
>
> - Ben
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
> ___
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Unable to compile ghc-8.2.2 with ghc-8.4.3

2018-08-22 Thread Sam Halliday
Hello all,

I am unable to compile ghc-8.2.2 with ghc-8.4.3 (which is otherwise
working fine, e.g. to compile my own projects and xmonad). Could
somebody please help? The error I get is

ghc-cabal: Encountered missing dependencies:
base >=4.4.1 && <4.11
libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No
such file or directory
make[1]: *** [libraries/hpc/ghc.mk:3:
libraries/hpc/dist-boot/package-data.mk] Error 1
make: *** [Makefile:123: all] Error 2

I should give some background as to why I'm doing this: I am trying to
build a back catalogue of ghc installations because the older binary
downloads from haskell.org give me linking errors and I've lost faith
in Archlinux's ability to package ghc.

I plan on using these builds of ghc in stack, instead of their
binaries. I don't like downloading binaries. I'd rather build them
from source. I will also create a docker image for my own CI purposes.

I'm using this script, but it's just a formalisation of the ghc
installation instructions to help me automate the process.

  https://gitlab.com/fommil/ghc-env/blob/master/bin/ghc-env

I am on Archlinux, which (I'm sure many of you know) has a very broken
concept of ghc. I already lost 2 hours today because Archlinux broke
my ~/.ghc, and therefore xmonad was unable to start and this locked me
out of my desktop. I plan on using NixOS in the future. From a fresh
OS install I do

  pacman -S ghc-static cabal-install

to get me ghc 8.4.3 and the cabal CLI. From here I download and
compile ghc 8.4.3 and cabal-install with

  ghc-env compile 8.4.3
  cabal install cabal-install xmonad xmonad-contrib

and now I can delete Arch's versions of ghc (yay!).

But from here, if I try to compile ghc 8.2.2 (with a view to compile
all the way back to the 7.x series) I get the failure at the top.

An alternative solution would be if there were instructions for a
fabled "phase0" compile, which doesn't require a ghc bootstrap. Does
anybody know anything about that?


Best regards,
Sam
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users