John
@MrJayLC
Followers
161
Following
7K
Media
1K
Statuses
11K
CEO #htmx Foundation Putting C back in CDeezNutz Inc. Master of CompSci Hobby 3D Animator Competitive shooter Occasional DnDer Wool is king, thanks Grandma
Norway
Joined March 2011
@IroncladDev Unless the preference is unaligned indentation, anyone who prefers aligned indentation either prefers 1 space indentation or tabs. The rest are posers.
1
0
4
But C strings are superior when parsing, because you only have to check for the sentinel, which is part of the jump table of things you're checking for. The real problem is that you cannot have a non-sentinel string by literal. Pstrings, SVs, SBs. Most don't need a sentinel.
One of the biggest problems of C are strings. Better to say no out of the box strings. *const u8 is absolutely the worst way to represent strings because every time you need to compare the strings you have to loop over the bytes instead of starting with length comparison
0
0
1
poor man's lambda achieved, however there is a byproduct of mprotect affecting entire pages that makes each lambda require an entire page of their own whilst also rendering any data portion read-only, which is annoying. Makes for a storage question of a lambda as FAM.
0
0
0
I can name at least two types in machine code: register width and flag.
Everyone saying “but there are no types in machine code!” didn’t understand the point. You may want to look at how a JavaScript object is actually implemented. Static types become necessary—even if conceptual, just within assembly—because different runs of machine code need to
0
0
1
Nothing is stopping libc from being updated to track resource acquisition and relinquish as part of the CRT. the CRT has an init and a fini step, of which it could set up resource locations to track pages and files allocated, and just release them on exit. It just doesn't.
C is hard because you have to manually free every pointer. Actually, you don't. 🤫 The cleanup attribute allows you to define a function that runs automatically when a variable goes out of scope. It's basically RAII/Destructors in C.
0
0
0
This is what I like to call "C++ Template Type Explosion". Eventually, you end up wrapping it all up in a using somewhere and just shove it under the rug. Image from @lefticus, https://t.co/IITymVDjml
0
0
0
Why do I feel like I'm refollowing people I've already followed before? Strange.
0
0
0
paracetamol != ibuprofen afaik anti-inflammatory is what you want to offer the whamen for their period pains. Gotta give a *little* effort.
0
0
0
Thinking about the SYS-V Initial Process Stack: The Auxiliary Vector contains configurations of the system (such as system-name and page size). Why on earth is it lower than ArgC, ArgV and EnvP? Makes you waste time iterating over EnvP just to get to AuxV, which makes me :(
0
0
0
nob.h for the uninitialized:
github.com
Header only library for writing build recipes in C. - GitHub - tsoding/nob.h: Header only library for writing build recipes in C.
0
0
0
Is there any reason why printf can't have a function pointer that operates on an arg by (void) pointer and returns a string? printf("%U\n", &struct_printer, &struct_var);
0
0
0
Ah yes, because having an iPhone USB-C that refuses to charge non-iPhone devices is such an improvement! Not to mention specs on voltage, amp, frequencies, etc. might all differ. Go tardwrangling! Always use power cable and converters to the devices they're made for.
This was a great move by Europe and much needed standardization that has made hardware better everywhere. So much better than companies who formerly profited from incompatible cables, once forced to adopt USB-C, touted it in their marketing.
0
0
0