Changes between Version 1 and Version 2 of Commentary/Rts/Cmm


Ignore:
Timestamp:
Sep 12, 2006 1:48:12 PM (8 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Rts/Cmm

    v1 v2  
    11 
    22 
    3 = GHC Commentary: What the hell is a {{{.cmm}}} file? = 
     3= GHC Commentary: What the hell is a `.cmm` file? = 
     4 
     5A `.cmm` file is rather like C--.  The syntax is almost C-- (a few constructs are missing), and it is augmented with some macros that are expanded by GHC's code generator (eg. `INFO_TABLE()`).  A `.cmm` file is compiled by GHC itself: the syntax is parsed by [[GhcFile(compiler/cmm/CmmParse.y)]] and [[GhcFile(compiler/cmm/CmmLex.x)]] into the [wiki:Commentary/Compiler/CmmType Cmm] data type, where it is then passed through one of the [wiki:Commentary/Compiler/Backends back-ends]. 
     6 
     7We use the C preprocessor on `.cmm` files, making extensive use of macros to make writing this low-level code a bit less tedious and error-prone.  Most of our C-- macros are in [[GhcFile(includes/Cmm.h)]].