
I don't know of any separate description of the semantics of Core, but it's just the lambda calculus with let, letrec and case. There's plenty of code that works over Core in GHC itself, but no separate libraries. There is a library to parse the stuff that ghc -fext-core spits out, though. Kirsten Chevalier and Tobias Gedell have experience of using this route, and may be able to help, depending on your purpose. Contributing well-engineered Core-manipulating libraries would be a Good Thing. Simon | -----Original Message----- | From: Martin Sjögren [mailto:md9ms@mdstud.chalmers.se] | Sent: 18 February 2003 08:18 | To: glasgow-haskell-users@haskell.org | Subject: The semantics of Core? | | Hello | | I'm looking for a paper or some other documentation on the exact | semantics of Core. I've read the paper about the concrete syntax, and it | briefly mentions the abstract syntax and something about the case | expression, but not a lot. Unless I missed something? | | I'm also looking for actual code for working with Core. :) The | Language.Haskell.* stuff gives me a very high-level representation of | Haskell source, and I'd rather work with something simple, like Core. I | *suppose* I could use ghc -fvia-ext or helium -C or something like that, | and then parse the file it spits out, but it feels like a long way to go | when there should be shortcuts available. Another way is to rip out the | code from ghc or helium that does this, but that's not so nice either :( | | Any suggestions? | | | /Martin

tis 2003-02-18 klockan 09.49 skrev Simon Peyton-Jones:
I don't know of any separate description of the semantics of Core, but it's just the lambda calculus with let, letrec and case. There's plenty of code that works over Core in GHC itself, but no separate libraries. There is a library to parse the stuff that ghc -fext-core spits out, though.
I was more interested in the strictness properties. The way I understood it, Core case is strict? I looked at utils/ext-core and now I'm stuck at producing all the .hcr files needed. I just can't think of a good way of getting .hcr files from all modules that Prelude imports. I've tried tricks with -fno-code and tricks with --make -no-hs-main but to no avail so far. With ghc --make -fglasgow-exts -fext-core -no-hs-main Prelude.hs I get GHC/Base.lhs:84: parse error on input `#' If I pass -cpp too, I get GHC/Base.lhs:96: failed to load interface for `GHC.Err': Bad interface file: GHC/Err.hi-boot does not exist Action: openFile Reason: No such file or directory File: GHC/Err.hi-boot I'm confused. All manner of help appreciated. :) /Martin
participants (2)
-
Martin Sjögren
-
Simon Peyton-Jones