True multi stage Haskell

Joachim Breitner mail at joachim-breitner.de
Mon Nov 20 01:11:26 UTC 2017


Hi Tim,

Am Freitag, den 17.11.2017, 13:05 -0500 schrieb Tim Sheard:
> After many years of hoping someone else would do this, I would like to
> make GHC into a true multi-stage programming language. Here is how I
> thought I might approach this.
> 
> 1) Use the GHC as a library module.
> 2) Use the LLVM backend.
> 
> I have no experience with either of these tools.
>
> Lets start simple, How would I write functions like
> 
> compile :: String -> IO PtrToLLVMCode  -- where the string is a small 
> Haskell program.
> llvmCompile :: PtrToLLVMCode -> IO PtrToMachineCode
> jumpTo:: PtrToMachineCode -> IO ans   -- where ans is the "type" of the 
> string.

maybe not quite what you are looking for, but veggies, at
https://github.com/nomeata/veggies
uses the GHC API build a “new” Haskell compiler with its own Core→LLVM
pass. 

Cheers,
Joachim
-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20171119/b94f9c07/attachment.sig>


More information about the ghc-devs mailing list