GHC (API?) question: GHC Core for Base libraries

Bill Hallahan william.hallahan at yale.edu
Wed Dec 19 23:26:46 UTC 2018


Thanks!  That's an interesting approach.  I hadn't considered just patching GHC.

> On Dec 19, 2018, at 5:58 AM, Christopher Done <chrisdone at gmail.com> wrote:
> 
> Here is the simplest possible way to print core in the Main.hs, by the way:
> 
> https://github.com/chrisdone/prana/commit/1303c7bb385a95eef7bb4752997897455853ca72#diff-28e5b5a88ae58fa953c1ad5ab5a7bfe0
> 
> That's taking GHC 8.0's Main.hs and patching it.
> On Wed, 19 Dec 2018 at 10:50, Christopher Done <chrisdone at gmail.com> wrote:
>> 
>> Hi Bill,
>> 
>> I use a different approach, using docker, and that's to use a patched
>> `Main.hs` (https://github.com/chrisdone/prana/commits/master/ghc-8.0/Main.hs)
>> and compile GHC with that patched file. It's a little unorthodox but
>> has so far been highly effective.
>> 
>> Here is a repo of a core interpreter I've been dabbling with:
>> https://github.com/chrisdone/prana
>> 
>> Here I have a Dockerfile that copies my edited version of `Main.hs`
>> and builds base, ghc-prim and integer-gmp together into an isolated
>> package database:
>> https://github.com/chrisdone/prana/blob/master/Dockerfile.ghc-8.0#L56-L114
>> 
>> My Main.hs writes a .prana file for every module. At the end of the
>> Dockerfile, I export that to a .tar.gz archive:
>> https://github.com/chrisdone/prana/blob/master/Dockerfile.ghc-8.0#L113
>> 
>> Then I have a set of scripts
>> https://github.com/chrisdone/prana/tree/master/scripts
>> To build the image, and one to copy the libraries to the current
>> directory under `libraries/`.
>> 
>> Hope that's of some help!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181219/3746b855/attachment.sig>


More information about the ghc-devs mailing list