
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?

On 3 May 2014, at 20:05 , Florian Weimer
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?
Ka-ching: http://www.cs.tufts.edu/~nr/c--/extern/man2.pdf Ben.

On 3 May 2014, at 20:30 , Ben Lippmeier
On 3 May 2014, at 20: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?
Note that GHC doesn't actually implement C-- as per the spec. It's got an intermediate language named Cmm that is "inspired by" C--, but they're not the same thing. Ben.

(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@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Are all of these links collected on the GHC wiki somewhere? If not,
would you mind adding them?
I, for one, appreciate a curated list of references like this!
On Sat, May 3, 2014 at 5:33 AM, Arash Rouhani
(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
See the top of https://github.com/ghc/ghc/blob/master/compiler/cmm/CmmParse.y Be ready to occasionally look into https://github.com/ghc/ghc/blob/master/includes/Cmm.h Edward Yang's blog post is a must-read http://blog.ezyang.com/2013/07/no-grammar-no-problem/ (less than a year old) 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 2 years ago, Simon Marlow extended the classical Cmm syntax to make it much nicer: https://github.com/ghc/ghc/commit/a7c0387d20c1c9994d1100b14fbb8fb4e28a259e 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 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 :) 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@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Hi Andrew, Thanks for the encouragement! :) I went ahead and updated the wiki and incorporated my links. I also gave some more guidelines for each link. [1] Cheers, Arash [1]: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Cmm On 2014-05-04 16:53, Andrew Farmer wrote:
Are all of these links collected on the GHC wiki somewhere? If not, would you mind adding them?
I, for one, appreciate a curated list of references like this!
On Sat, May 3, 2014 at 5:33 AM, Arash Rouhani
wrote: (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
See the top of https://github.com/ghc/ghc/blob/master/compiler/cmm/CmmParse.y Be ready to occasionally look into https://github.com/ghc/ghc/blob/master/includes/Cmm.h Edward Yang's blog post is a must-read http://blog.ezyang.com/2013/07/no-grammar-no-problem/ (less than a year old) 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 2 years ago, Simon Marlow extended the classical Cmm syntax to make it much nicer: https://github.com/ghc/ghc/commit/a7c0387d20c1c9994d1100b14fbb8fb4e28a259e 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 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 :) 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@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

Thank you Arash!
Simon
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Arash
| Rouhani
| Sent: 04 May 2014 19:54
| To: Andrew Farmer
| Cc: ghc-devs@haskell.org
| Subject: Re: C-- specfication
|
| Hi Andrew,
|
| Thanks for the encouragement! :)
|
| I went ahead and updated the wiki and incorporated my links. I also gave
| some more guidelines for each link. [1]
|
| Cheers,
| Arash
|
|
|
| [1]: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Cmm
|
| On 2014-05-04 16:53, Andrew Farmer wrote:
| > Are all of these links collected on the GHC wiki somewhere? If not,
| > would you mind adding them?
| >
| > I, for one, appreciate a curated list of references like this!
| >
| > On Sat, May 3, 2014 at 5:33 AM, Arash Rouhani
| >

Are you interested in ghc's cmm? It is different from the original C--. (And it differs between ghc versions.) Here is the best thing I found: https://github.com/ghc/ghc/blob/master/compiler/cmm/CmmParse.y There is a wiki page: https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CmmType But is it out of date and sometimes misleading. On Sat, 2014-05-03 at 12:05 +0200, 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@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

* Yuras Shumovich:
Are you interested in ghc's cmm? It is different from the original C--. (And it differs between ghc versions.)
Actually, I'm interested in some form of Mini-C (in the spirit of Mini-ML or Featherweight Java) for some experiment, and I assumed that people here would know where to get the C-- specification. Looks like I wasn't mistaken, thanks. :) I'm not sure yet if C-- fits my needs, though.
participants (6)
-
Andrew Farmer
-
Arash Rouhani
-
Ben Lippmeier
-
Florian Weimer
-
Simon Peyton Jones
-
Yuras Shumovich