Trailing commas have always been ignored in structs or arrays in #C (#C99 I am looking at).
This reminds me that I had unlearned this because #JavaScript didn't have it. And now I am questioning if C has it, even though this was where I had learned it loooong time ago.
🤔
The #C99 preprocessing seems a good idea at first sight. But tbh it brings a lot of burden too. For example every `#include ...` statement is basically a copy+paste of the header file replacing the `#include` statement. Which means a included file provides all included files too. There is no real file or module wide scoping for preprocessed stuff.
modern languages (designs) ftw!
I have to say, the web programming had taught me to not like for-loops a lot anymore, but working with #C99 during the day I have to do that a lot. And I find myself a lot asking ChatGPT to offer some more elegant solutions. I guess I am waiting for map functions ;).
what the actual heck! #zig can #crosscompile #c99 out of the box!? https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html
Speaking of overengineering, I just built a small content processor in the vein of XNA content pipeline: it processes a content directory, creating one single bundle file with processed data for each asset and a content table.
The loader supports asset reference counting and cleans up automatically upon closing the content bundle.
Supports PNG and a very small subset of LDTK for now.
I had way too much fun doing this 😬
@ChristosArgyrop Building #Perl already requires a subset of #C99 and will take advantage of others if your compiler has them, per https://metacpan.org/dist/perl/view/INSTALL
> dimension generic rendering _
hept, my custom C99 engine, has a dimension-independent "mesh" structure, allowing for 2D, 3D, and even 4D(?!) rendering - all using the same system, and all capable of being easily drawn at any time any where~
on my way home from work, I had a breakthrough in how I understand thread-safe variables.
and now I have a perfectly synced and thread-safe multi-core quaternion 2d/3d render engine! (notice how the timer in the console doesn't pause while the drawing is being paused!)
Great:
“Few Lesser Known Tricks, Quirks And Features Of C”, Joren Garenar (https://blog.joren.ga/less-known-c).
Via HN: https://news.ycombinator.com/item?id=34855331
On Lobsters: https://lobste.rs/s/if8osu/few_lesser_known_tricks_quirks_features_c
#c #programming #tricks #c11 #c99
Speaking of #C99, probably one of the weirdest additions is the ability to use 'static' (and other type qualifiers) _inside_ the brackets of function array parameter declarations:
foo(int arr[static 42]) { ... }
Here 'static' means "at least 42 elements long". Other qualifiers define what type the array decays to.
I got the octree macro to work, a little tricky the recursive structs in C. Next is refactoring chunk systems (terrain gen, mesh building, etc), to work with octrees before I add collisions.
#indiedev #gamedevelopment #coding #c99
My current “dream” project for my spare time is a bare-metal #C standard library. You’d be able to configure a filesystem handler for stdio funcs, a callback to handle system(3) calls, etc. Drivers would be compiled into the app, etc. Basically a little #embedded #OperatingSystem whose API is exactly #C99. Think early #Xinu without multitasking.
I have no use case for this. I just find it fun to think about. Probably wouldn’t do device discovery except by maybe by parsing DeviceTree?
#c #embedded #c99 #xinu #operatingsystem
RT @DoNxBoCo: C99 サークルぼこぼんのお品書きですー!1日目西ぱ-46bでお待ちしてます!新刊・既刊、フルカラーで全て!!500円!!!みんな買ってくれ!!! #C99 #Minecraft
配置マップ:https://t.co/iYaMjKy5VL
メロブ 通販予約ページ
https://t.co/u1jcYHgFcT https://t.co/OVkeTPmRpk
RT @DoNxBoCo: C99 サークルぼこぼんのお品書きですー!1日目西ぱ-46bでお待ちしてます!新刊・既刊、フルカラーで全て!!500円!!!みんな買ってくれ!!! #C99 #Minecraft
配置マップ:https://t.co/iYaMjKy5VL
メロブ 通販予約ページ
https://t.co/u1jcYHgFcT https://t.co/OVkeTPmRpk
I've used #C99 as my default #cprogramming option for a while now. The first time I need a function per data type I'll try switch up to #C11 and use Generics.