Hacker News new | ask | show | jobs
by mjburgess 882 days ago
imv, we're still missing a C replacement-successor

There should be a language about as simple as c, with a few additional keywords for safety (type and memory), and a modern standard library -- that works basically everywhere C works, and is backwards compatible with C.

ie., we're missing --C++

I think all the supposed successors have approached the problem from the lang-design pov, where for C, it needs to be from-existing-compilers-and-tools pov.

I suspect there's a route to C v2 by starting with the C std, and gcc/clang, then working "forwards". Similar to cppfront for C++.

ie., it needs to compile 99% of all existing C code, it needs to compile to 90% of all in-use platform for C, etc.

5 comments

You may find Zig interesting: https://ziglang.org. The language is not C compatible but the tooling can compile C and C++ without hassle.
i'm aware of zig, which is why i included the criteria above that i take to rule it out.

i do think the successor should be src-compt with C

What would be great is a language that does to C what TypeScript did to JavaScript.

C but with better safety and additional developer ergonomics would be amazing.

Part of the problem is I think you would need to depart from the traditional C build system to get the most benefits. That will be hard for adoption.

>There should be a language about as simple as c,

I just recently started to dip my feet into golang and it feels like Go could've been something like that. With it's runtime and garbage collection that obviously disqualifies itself, but it's a really simple and fun language, I think. Something like that as a systems programming language with """easy""" memory management would be tremendous (maybe Zig is like that, but I haven't tried that out yet).

Zig, Odin and Jai are the main contenders.

I don’t think backward C compatibility is a good idea, since the C syntax has issues. Instead a transpilation tool from C could be built.

Carbon was a possible successor, only time will tell