
The C-- Language Specification (2005) [pdf] - headalgorithm
https://www.cs.tufts.edu/~nr/c--/extern/man2.pdf
======
carterschonwald
There’s an alternative timeline where c— was better marketed / promulgated as
a backend tool kit for optimizing compilers and everyone use c— instead.

That’s not to say llvm isn’t great, but some of the design choices it has make
it a lot of work to do funky stuff ! And c— is a bit easier to write low level
rts snippets in.

I do think the ghc c— flavor is super nice to write in these days.

------
tyingq
Short overview of "C--" :
[https://www.cs.tufts.edu/~nr/c--/index.html](https://www.cs.tufts.edu/~nr/c--/index.html)

------
afraca
A prominent project where I have encountered this is GHC, the Haskell
compiler. The route there goes: Haskell --> Core --> STG --> C--

(It then goes to one of: \- Machine code generation \- into C for feeding to
gcc \- into LLVM's intermediate representation. )

~~~
faissaloo
Would converting C-- to C/LLVM IR be redundant?

~~~
kryptiskt
It's true that they are mostly on the same level but it's way easier to
compile C-- to LLVM IR or C than to write three separate STG->(Imperative
code) stages.

------
gnulinux
Does compiling to C-- have any benefits compared to compiling equivalent C
code (maybe a subset of C)? My guess would be modern C compilers, powered by
decades of R&D and programming, would be able to optimize just as well and
possibly better.

EDIT: One advantage that comes to my mind is that compiling to C-- will give
slightly more power to deal with stack. E.g. implementing exceptions,
continuations etc would be simpler. This is possible in C using inline
assembly.

~~~
rwhaling
One benefit that is repeatedly mentioned in the papers is the ability to do
tail-call optimization, which is more or less impossible with compile-to-c
interpretations, and mandatory for functional languages.

------
DonHopkins
C++++-=

“C++++-= is the new language that is a little more than C++ and a lot less.”
-Bill Joy

In this talk from 1991, Bill Joy predicts a new hypothetical language that he
calls “C++++-=”, which adds some things to C++, and takes away some other
things.

[https://medium.com/@donhopkins/bill-joys-
law-2-year-1984-mil...](https://medium.com/@donhopkins/bill-joys-
law-2-year-1984-million-instructions-per-second-3a8c92165cfe)

------
dragonbonheur
The other project named C-- [http://c--sphinx.narod.ru/indexe.htm](http://c--
sphinx.narod.ru/indexe.htm)

~~~
vgoh1
I used this in the mid- to late-90's on my 80386 (which was very much out of
date at the time, but was all I had). I was very new to computing at the time,
and the only other languages that I had under my belt were QuickBASIC and
80386 assembler, so I can't comment on if it were a "good" language or not.
After less than a year, I ended up abandoning it, preferring to use QuickBASIC
for high level, and machine language for low, not feeling like I needed the
intermediate C--.

------
ThePadawan
IIRC EiffelStudio compiled Eiffel to C-- as an intermediary stage, but I
haven't used it since university and struggle to find information about that
online.

~~~
_pmf_
Slightly off topic: did you do any projects using Eiffel, and if yes, what
were the benefits / unique features?

~~~
ThePadawan
I did not use it past university.

------
inspector-g
Interesting! I've been writing a lot of C/C++ for over a decade, but had never
heard of C-- before.

So, I went to the website[1] linked in the PDF to learn more, but sadly it
appears the domain has been taken over and now just displays a small
collection of badly written articles about Windows.

[1] [http://cminusminus.org](http://cminusminus.org)

------
blacksqr
Code at: [https://github.com/nrnrnr/qc--](https://github.com/nrnrnr/qc--)

~~~
vmchale
Very neat, thank you!

------
ufo
Are there any projects other than GHC which still use C--? I had heard that it
was unfortunately kind of dead these days.

------
evincarofautumn
I would love to use it for my compiler backend…if I could find any maintained
standalone implementations of it.

------
metalliqaz
Sometime in the 90's I downloaded a programming language called "C--" that was
basically assembly with some loop control structures and functions. I'm
assuming this completely unrelated.

Edit: ah, looks like dragonbonheur found and linked it already in this thread!

~~~
sprinx
That was Sprinkx C-- Great Compiller with IDE in late 90's [http://c--
sphinx.narod.ru/indexe.htm](http://c--sphinx.narod.ru/indexe.htm)

------
tempodox
This looks like a precursor of LLVM IR.

------
vmchale
Is GHC the only project that uses this?

------
DonHopkins
Generalizing Overloading for C++2000: Bjarne Stroustrup, AT&T Labs, Florham
Park, NJ, USA.

Abstract: This paper outlines the proposal for generalizing the overloading
rules for Standard C++ that is expected to become part of the next revision of
the standard. The focus is on general ideas rather than technical details
(which can be found in AT&T Labs Technical Report no. 42, April 1,1998).

[http://www.stroustrup.com/whitespace98.pdf](http://www.stroustrup.com/whitespace98.pdf)

