4 ms·
Have you tried C23, especially its new Unicode support? It really surprised me after returning to C more than ten years later. You can now write wide and UTF-8
by tamnd 11mo ago
Have you tried C23, especially its new Unicode support? It really surprised me after returning to C more than ten years later.
You can now write wide and UTF-8 string literals directly:
char8_t* s = u8"こんにちは";
char16_t* t = u"Привет";
char32_t* ustr = U"你好";
It just works across compilers, no special libraries or hacks needed.
C still feels like C, but cleaner, safer, and more consistent.
- grayhatter 11mo agoI abandoned the goal of investing More time into C when they couldn't get defer into their latest version. 2 years later, already enjoying it in Zig `defer` is a lot less important to me now. But I still view it as a symptom of the death of the language. C isn't dead, by any stretch of the imagination, but it's no longer learning from it's mistakes, where as I still am.
- tamnd 11mo agoI started learning C again for one simple reason: to understand the Linux kernel. You cannot do that without knowing C, and soon you end up learning about GCC, linkers, and how programs really run. Once I spent time with it, I saw how many smart ideas from the kernel could be used anywhere. the initcall system that runs modules in order, the way structs with function pointers create flexible drivers, the use of macros to build type-safe lists and so on. https://www.collabora.com/news-and-blog/blog/2020/07/14/introduction-to-linux-kernel-initcalls/ https://www.collabora.com/news-and-blog/blog/2020/07/14/intr... For real work, though, life is short. I use Go.