C-- specfication
Arash Rouhani
rarash at student.chalmers.se
Sat May 3 10:33:05 UTC 2014
(Sorry Florian, I forgot to "reply to list"!)
Hi Florian!
Forget Cminusminus.org, in my experience it seems to have diverged from
the GHC version of Cminusminus.
I would recommend these resources
1. See the top of
https://github.com/ghc/ghc/blob/master/compiler/cmm/CmmParse.y
2. Be ready to occasionally look into
https://github.com/ghc/ghc/blob/master/includes/Cmm.h
3. Edward Yang's blog post is a must-read
http://blog.ezyang.com/2013/07/no-grammar-no-problem/ (less than a
year old)
4. You can also get the big picture of Cmm from David Terei's bachelor
thesis:
https://davidterei.com/downloads/papers/terei:2009:honours_thesis.pdf
5. 2 years ago, Simon Marlow extended the classical Cmm syntax to make
it much nicer:
https://github.com/ghc/ghc/commit/a7c0387d20c1c9994d1100b14fbb8fb4e28a259e
6. The commentary (it is kinda outdated in my experience, but worth
taking a look :)),
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Cmm *and*
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CmmType
7. Read the code! There's a lot of Cmm files and after looking at
various parts of it for a while parts start to make sense :)
8. Shameless plug: You might find sections 4.2 and 4.2.1 from my master
thesis helpful to understand the difference between arguments and
fields. http://arashrouhani.com/papers/master-thesis.pdf
And it will take time to learn Cmm. The most unintuitive thing for me
that took me a while to understand is that there are no function calls
in "classical" cmm code. The newer syntax allows function calls but you
should know that they are kind of magical. Hope this helps! :)
(Sorry for giving so many reading references :p)
Cheers,
Arash
On 2014-05-03 12:05, Florian Weimer wrote:
> I'm looking for a specification of C--. I can't find it on the
> cminuscminus.org web site, and it's also not included in the release
> tarball. Does anybody know where to get it?
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140503/9c399dd3/attachment-0001.html>
More information about the ghc-devs
mailing list