Hey everyone,
I'd like to point out that the c-- domain is no longer cminusminus.org, the historical site can be found on norman ramsey's homepage here <a href="http://www.cs.tufts.edu/~nr/c--/" rel="nofollow">http://www.cs.tufts.edu/~nr/c--/</a> ! It also has actual reading material / papers!<p>The cminusminus domain is no longer valid (though it has more modern CSS), also it lacks links to all the informative papers!<p>C-- is very similar overall to LLVM IR, though there are crucial differences, but overall you could think of them as equivalent representations you can map between trivially (albeit thats glossing over some crucial details).<p>In fact, a few people have been mulling the idea of writing a LLVM IR frontend that would basically be a C-- variant. LLVM IR has a human readable format, but its not quite a programmer writable format!<p>C-- is also the final rep in the ghc compiler before code gen (ie the "native" backend, the llvm backend, and the unregisterized gcc C backend).<p>theres probably a few other things I could say, but that covers the basics. I'm also involved in GHC dev and have actually done a teeny bit of work on the c-- related bits of the compiler.<p>relatedly: i have a few toy C-- snippets you can compile and benchmark using GHC, in a talk I gave a few months ago <a href="https://bitbucket.org/carter/who-ya-gonna-call-talk-may-2013-ny-haskell" rel="nofollow">https://bitbucket.org/carter/who-ya-gonna-call-talk-may-2013...</a> <a href="https://vimeo.com/69025829" rel="nofollow">https://vimeo.com/69025829</a><p>I should also add that C-- in GHC <= 7.6 doesn't have function arguments, but in GHC HEAD / 7.7 and soon 7.8, you can have nice function args in the C-- functions. See <a href="https://github.com/ghc/ghc/blob/master/rts/PrimOps.cmm" rel="nofollow">https://github.com/ghc/ghc/blob/master/rts/PrimOps.cmm</a> for GHC HEAD examples, vs <a href="https://github.com/ghc/ghc/blob/ghc-7.6/rts/PrimOps.cmm" rel="nofollow">https://github.com/ghc/ghc/blob/ghc-7.6/rts/PrimOps.cmm</a> for the old style.
Could someone enlighten me what's the advantage of this over LLVM-IR?<p>Edit: Ok, I've found the following SO thread: <a href="http://stackoverflow.com/questions/3891513/how-does-c-compare-to-llvm" rel="nofollow">http://stackoverflow.com/questions/3891513/how-does-c-compar...</a>
When I first entered college in 1988 there was a small DOS compiler floating around called C-- back then, which I got from some BBS (yes, a BBS, how antiquated!), probably in 1989. It was a mix of a subset of C and proto-assembly. I have looked for it a few times over the years, and this one isn't it, although it has some similar ideas. It makes me wonder how many other little-known C-- projects there are.
According to this, C-- is still a large part of the Glasgow Haskell Compiler. It looks like (Fig 5.2) code goes into C-- before being translated to LLVM.<p><a href="http://www.aosabook.org/en/ghc.html" rel="nofollow">http://www.aosabook.org/en/ghc.html</a>
"As of May 2004, only the Pentium back end is as expressive as a C compiler. The Alpha and Mips back ends can run hello, world. We are working on back ends for PowerPC (Mac OS X), ARM, and IA-64. Let us know what other platforms you are interested in."
I own the cminusminus.com domain. Was planning on using it for a blog, mainly to post horrible c/c++ code snippets I come across. If anyone wants it, let me know.
According to this infographic, a C-- was the influence for JavaScript.<p><a href="http://www.georgehernandez.com/h/xComputers/Programming/Media/tongues-cleaner.png" rel="nofollow">http://www.georgehernandez.com/h/xComputers/Programming/Medi...</a><p>If this has any truth (perhaps a different c--?) I'd like to know which one is being referred to.
Another take on portable assembly languages is Dan Bernstein's qhasm: <a href="http://cr.yp.to/qhasm.html" rel="nofollow">http://cr.yp.to/qhasm.html</a><p>An overview here: <a href="http://cr.yp.to/qhasm/20050129-portable.txt" rel="nofollow">http://cr.yp.to/qhasm/20050129-portable.txt</a>
I must be missing something since I see the line "The specification is available as DVI, PostScript, or PDF.", but cannot find any download link.
Wow, I was surprised by the content of the website. I think this is how a website should be.<p>First they are talking about the problem and then they present the solution.<p>I also like the words that are marked bold.<p>This is how interaction design should be done (imho).
For another take on this area, I recommend reading about Pillar from Intel. <a href="http://dl.acm.org/citation.cfm?id=1433063" rel="nofollow">http://dl.acm.org/citation.cfm?id=1433063</a>
this seems really awesome, but I have no idea what it does?<p>I know that Python compiles to C and that Clojure compiles to JVM (or even to JavaScript).<p>My cartoon:<p><pre><code> scripting lang --> programming lang --> native code
</code></pre>
Honestly, I have never experimented with Assembly language much except for COOL (<a href="http://en.wikipedia.org/wiki/Cool_(programming_language)" rel="nofollow">http://en.wikipedia.org/wiki/Cool_(programming_language)</a>) and TOY (<a href="http://introcs.cs.princeton.edu/java/52toy/" rel="nofollow">http://introcs.cs.princeton.edu/java/52toy/</a>).
Cool! the first parser/compiler I wrote was for C-- (the version that is a small subset of C, not this one). Had not even heard an mention of the different C-- languages for a few years now.
Say you're writing a compiler for a language in Haskell, and you want to generate machine code rather than having it be interpreted. Is C-- a natural choice on this platform? Or might LLVM be a better choice?