One of the criticisms I have heard of C-- is that it doesn't distinguish between integer and floating-point data in the type system. There are some architectures where that wouldn't be a problem, but most modern CPUs have completely separate integer and floating-point data paths, with a performance penalty for shuffling data between them. Generating good code on these systems from C-- source requires more effort than…
C Minus Minus
11–20 of 75 posts
Re: C Minus Minus
#12Re: C Minus Minus
#13One of the criticisms I have heard of C-- is that it doesn't distinguish between integer and floating-point data in the type system. There are some architectures where that wouldn't be a problem, but most modern CPUs have completely separate integer and floating-point data paths, with a performance penalty for shuffling data between them. Generating good code on these systems from C-- source requires more effort than…
Modern architectures have different register banks for the two, but that's irrelevant, C-- is not register-centric.
Re: C Minus Minus
#14(Reads the page.)
"Oooh. Interesting."
Re: C Minus Minus
#15So now any wikipedia page is now worthy of a hackernews post?
Re: C Minus Minus
#16Earlier quoted context omitted.
Modern architectures have different register banks for the two, but that's irrelevant, C-- is not register-centric.
Isn't the point of C-- to be an IR, easily compileable to assembly on the target?
Re: C Minus Minus
#17The problem with things like this is that "compile to C" isn't really just done for ease of implementation, but for sheer portability - individual C compilers are widespread, and the totality of them are basically ubiquitous. The Quick C-- compiler mentioned in the article only supported x86. So the only way I would see something like this work, is as a frontend for an existing compiler. LLVM itself makes this kinda…
https://takenobu-hs.github.io/downloads/haskell_ghc_illustra... shows how it (well, the Cmm fork) is used to compile Haskell code with GHC
Re: C Minus Minus
#18I'm familiar with a different C-- developed by Peter Cellik which appeared before the language in the article (1997). But the article has no mention of it. The discussion page of the article does mention there used to be many languages called C-- with similar ideas and the article only talks about a specific one
Re: C Minus Minus
#19Slightly related to this, this article made me check Simon Peyton Jones's wiki page [1], where I saw this: > Jones has played a vital role in the development of new Microsoft Excel features since 2003, when he published a paper on user-defined functions.[19] In 2021, anonymous functions and let expressions were made available in the Office 365 version of Excel as a beta feature.[20] Truly, there were (possibly still…
Re: C Minus Minus
#20I actually researched this some time ago, and was a bit surprised to learn that modern GHC’s intermediate representation seems to differ from what the C-- paper describes quite substantially, in ways that are only described in the source code. They’re still using the same name though.
One observation is that GHC has been somewhat slow to adopt new CPU targets (M1, WebAssembly). I wonder if the reliance on C-- played a role in that.