logoalt Hacker News

veexx103 • today at 1:45 PM • 5 replies • view on HN

Is it feasible to create a new language by adding features to C

just as was done with C++?


Replies

accelbred • today at 4:29 PM

I am working on a language that was C with extensions, transpiled to plain C, but the C syntax is kinda not great to work with (stuff like needing type tables and unbounded lookahead). At the point you clean up the syntax, you're not really C with extensions anymore.

pornel • today at 4:13 PM

It's not worth it. The value of C is in compatibility, availability of compilers, and familiarity.

As soon as you change anything in a breaking way, start requiring your own compiler/transpiler, or introduce new idioms, you end up losing the things that keep C alive.

Users of C either like it exactly the way it is, or have to use a specific C version due to a vendor dependency or compliance.

An upgraded C not approved by the standards body gives you yet another niche language that is not C, but is still burdened with its old flaws.

➕ show 2 replies
pjmlp • today at 2:19 PM

And Objective-C, yet somehow people reinvent them badly in C.

FullGarden_S • today at 4:15 PM

C3 might be it because C3 has full C ABI compatibility so unlike most modern C-like alternatives, it checks out.

nikbackm • today at 2:19 PM

There are already plenty of such languages, Zig among others.

➕ show 2 replies