News for hackers. Stuff that matters.
Re:C2 Lang design (2014) [pdf] by bluejekyll on Thursday August 06, 2015 @03:21AM (#10015029)
Is there an advantage to this over say a more modern and safe language like Rust? It seems to be just reducing the complexity of the language, but doesn't look like it will reduce memory related bugs.
Re:C2 Lang design (2014) [pdf] by rwmj on Thursday August 06, 2015 @03:50AM (#10015107)
Since you have to rewrite everything, you might as well switch to another language (we switched to OCaml). If there was an incremental path or a safe subset of C or something like that, that would be more interesting.
Re:C2 Lang design (2014) [pdf] by tempodox on Thursday August 06, 2015 @04:28AM (#10015248)
My thoughts exactly. If nothing bad happens, I think Rust will be a worthy successor of C in low-level land. If I need a higher abstraction level, I use either Lisp if I want dynamic typing, or OCaml if I want static typing. Together, those three cover a vast spectrum.

addendum: That doesn't mean C2 is not a worthwhile experiment. I might even try it out when a compiler is available.

Re:C2 Lang design (2014) [pdf] by steveklabnik on Thursday August 06, 2015 @11:38AM (#10017193)
We have pretty good C interop, so you don't have to re-write everything, you can do it in chunks. Firefox isn't suddenly going to be reimplemented in Rust, for example, it will be library by library, bit by bit.

Of course, you can do that with some other languages too, but our lack of runtime and no-overhead makes it significantly better, in my opinion.

Re:C2 Lang design (2014) [pdf] by qznc on Thursday August 06, 2015 @04:02AM (#10015158)
You can use D, which shares a lot of syntax with C, although you cannot directly reuse C code because there is no preprocessor in D. Some people use D as a "C development compiler".

The incremental path is the official C standards. C will probably gain modules for example.

Re:C2 Lang design (2014) [pdf] by rwmj on Thursday August 06, 2015 @04:51AM (#10015305)
In the project I'm working on right now, there are 277,617 lines of C (using gcc extensions). The incremental path either compiles all of that directly, or we rewrite it. There's hardly any middle ground, and actually rewriting it isn't a realistic option either.

(For comparison the same project has 63,972 lines of OCaml and 31,605 lines of Perl)