C23 Programming for Everyone

Here’s a history quiz: What architecture did the first C++ compiler target? Of course, it is a trick question. The original C++ — known then as C with classes — compiler wrote out standard C code that you then compiled for whatever your target was. This has a lot of advantages since C compilers are everywhere. Now we are seeing a similar approach to bring C23 to the world with Cake. Cake can translate C23 or other versions to C99 which you can then compile with normal compilers.


While the old C++ compiler, cfront, needed special steps to compile (since it was built using C++), you can build cake for Windows or Linux easily. However, it can also be built with emscripten and you can try it yourself in your web browser.



Curious about what’s new in C23? Well, some old stuff was removed and even more was deprecated. But the really interesting things are the additions which include decimal floating point types, integers with specified bit size, standard attributes, and many changes involving constants and initialization. You can find a summary over on cppreference.com. Of course, many of these things have been around in C++ or in common extensions for compilers for a long time, but this brings a lot of common practice together in standard C.


The only other thing to watch out for is that some features are really in the library. Compiling your code isn’t going to help with differences in libraries, although many of the changes are just bringing in functions that most libra ..

Support the originator by clicking the read the rest link below.