https://compilerspotlight.substack.com/p/language-showcase-c3 [https] Compiler Spotlight SubscribeSign in Share this post [https] Language Showcase: C3 compilerspotlight.substack.com Copy link Twitter Facebook Email Language Showcase: C3 C3 is a C-like language striving to be an evolution of C, rather than a completely new language. [https] Jeaye Wilkerson 3 hr ago Share this post [https] Language Showcase: C3 compilerspotlight.substack.com Copy link Twitter Facebook Email C3 is a systems programming language based on C. It's an evolution of C enabling the same paradigms and retaining the same syntax as far as possible. For today's language showcase, C3's developer, Christoffer Lerno, talks about what makes it tick. [https] How would you describe C3 to the average programmer? C3 is an evolution of C: "what could C look like if backwards compatibility wasn't a concern?". The main additions are modules, slices and semantic macros, but otherwise it tries to stay close to the look-and-feel of C. Most importantly, it is ABI compatible with C everywhere, meaning functions in C3 are by default callable from C and vice versa. ----------------------------------------------------------------- You don't have to rewrite everything in C3, you can pick and choose. ----------------------------------------------------------------- Which problems is C3 trying to solve? C has the burden of backwards compatibility and while it's possible to add features on top, it's hard to make them nicely integrated in the overall language. Some parts of C (in particular string handling and arrays) aren't very ergonomic and makes the language seem harder to use than it needs to be. So it's about making C programming more accessible and less punishing by providing better tools for the pain points in C. Thanks for reading Compiler Spotlight! Subscribe for free to hear about new language showcases. [ ]Subscribe What makes C3 unique? I don't know if it is! There are a couple of "C replacement languages" in development right now: Odin, Jai, Zig and Hare to name a few. What they have in common is that they diverge quite a bit from C syntax and semantics. ----------------------------------------------------------------- C3 is different: you can just lift your C code with just a few changes into C3 and have it run as expected. ----------------------------------------------------------------- What are some of the toughest challenges with building C3? I'd love to have more people invested in the project with strong language design sensibilities to bounce ideas off. I love a good argument to be able to narrow down on the essentials of a feature. Luckily there are forums for budding programming language designers to trade ideas which helps. But that's not quite the same as having someone who really wants to help one YOUR language. The programming is the easy part. What's next for C3? Work on expanding the standard library, I'd like to reach the point where people can feel it has all the necessary basics. Where can people learn more? The docs can be found at https://www.c3-lang.org and the compiler can be found on Github: https://github.com/c3lang/c3c Which languages inspired yours the most? C2, by Bas van den Berg. My first compiler work was actually contributing to the C2 compiler! While Bas wanted a more modest feature set on top of C, I thought more ideas should be tested, and initially C3 was just C2 + some more features. When I decided to write a compiler for my ideas, I picked the name C3 to acknowledge its origins. Program comparison: arithmetic Prompt: Implement a program which takes in a single string from stdin containing a basic arithmetic expression, such as "1 + 2 - 5", evaluate it, and print the result. [https] Like this post Share this post [https] Language Showcase: C3 compilerspotlight.substack.com Copy link Twitter Facebook Email Comments [https] [ ] Create your profile [ ] Your name[ ]Your bio[ ] [ ][ ] Subscribe to the newsletter 0 subscriptions will be displayed on your profile (edit) Skip for now Save & Post Comment Only paid subscribers can comment on this post Already a paid subscriber? Sign in Check your email For your security, we need to re-authenticate you. Click the link we sent to , or click here to sign in. TopNew No posts Ready for more? [ ]Subscribe (c) 2022 Jeaye Wilkerson Privacy [?] Terms [?] Collection notice Publish on Substack Get the app Substack is the home for great writing This site requires JavaScript to run correctly. Please turn on JavaScript or unblock scripts