For those who are making indie C compilers that don't pretend to be __GNUC__ but want to compile real world projects, slimcc's test script[1] and platform header hacks[2] might save you some time. [1] https://github.com/fuhsnn/slimcc/blob/main/scripts/linux_thi... [2] https://github.com/fuhsnn/slimcc/blob/main/slimcc_headers/pl... Some more fun stories: - Game projects default to using SIMD so for example SDL and STB…
Although I don't use slimcc, I follow its development because I learn so much about C - even though I've been using C and C++ for over 30 years. https://github.com/fuhsnn/slimcc/blob/main/scripts/linux_thi... is an incredible piece of work. I can't imagine how many hours it took to assemble this collection. If slimcc can pass that project list torture test, then surely it's bulletproof.
C extensions, portability, and alternative compilers
91–97 of 97 posts
Re: C extensions, portability, and alternative compilers
#92Earlier quoted context omitted.
How dare anyone spend time on things you don't approve of. /s
Spending time on your hobby is wondwerful. Expecting the world to consider your hobby important is arrogant.
Re: C extensions, portability, and alternative compilers
#93I think the Common Lisp ecosystem sets a good example of how a dozen of implementations move ahead together. Implementations experiment with extensions, the really useful ones get implemented multiple times, and some portability library emerges as de-facto standard if it's good enough. You can watch the result in https://portability.cl/ , the language is evolving like never before even if the standard committee has d…
Isn’t this only possible in lisp due to the strong foundations of meta programming allowing the implementation of language features as user libraries?
But I think the power dynamics is crucial. In the Lisp ecosystem the users have great power, (and there are dozens of implementations,) so it's not like one or two implementation decides what everyone is gonna use and everyone just lives with it.
Re: C extensions, portability, and alternative compilers
#94Re: C extensions, portability, and alternative compilers
#95Earlier quoted context omitted.
The ideal isn't feature flags (ie FOO_SUPPORTED) but rather feature tests (ie COMPILES( foo( int ) ) ). Yet another reason why languages with proper metaprogramming capabilities are better.
The problem with feature tests is that you then rely on the test code being correct. A typo in the feature test can erroneously be interpreted as lack of that feature. One step of the 2024 supply-chain attack on xz utils was to disable a security feature by introducing a feature test with an intentional typo. Even knowing that this commit[0] contains an intentional typo, I had to re-read the diff a few times to actua…
It's an interesting point though that the parts of a program that don't fail loudly are prone to having bugs go unnoticed.
Re: C extensions, portability, and alternative compilers
#96Earlier quoted context omitted.
The definition of a strawman.
Not at all. The point was that using systemd is somehow "mandated". It's not, people chose systemd because it's actually better and made life easier compared to some POSIX nonsense. The point was that this non-existent "mandate" caused a "bifurcation" from "standards-based" software to Linux-specific. If anything is being "mandated" here, it's the POSIX compliance. Nobody is obligated to follow this like it's some so…
If you're using RedHat or Debian and most of their derivative distributions, it is.
> people chose systemd because it's actually better
No, they did not. Most people did not choose systemd, their Linux distributions did.
RedHat chose their own system for their own distributions; on Debian, a controvertial process foisted it onto the distribution using gaslit rhetoric; and I don't know much about the process elswehre.
> The point was
That was not the point.
> It's just not "standards compliant"
This is the straw man you've created. Neither my post nor most critique of systemd regards "standards compliance".
Re: C extensions, portability, and alternative compilers
#97Earlier quoted context omitted.
Not at all. The point was that using systemd is somehow "mandated". It's not, people chose systemd because it's actually better and made life easier compared to some POSIX nonsense. The point was that this non-existent "mandate" caused a "bifurcation" from "standards-based" software to Linux-specific. If anything is being "mandated" here, it's the POSIX compliance. Nobody is obligated to follow this like it's some so…
> It's not If you're using RedHat or Debian and most of their derivative distributions, it is. > people chose systemd because it's actually better No, they did not. Most people did not choose systemd, their Linux distributions did. RedHat chose their own system for their own distributions; on Debian, a controvertial process foisted it onto the distribution using gaslit rhetoric; and I don't know much about the proces…
Use a better distribution.
Arch Linux has entire wiki pages dedicated to alternative init systems. Anyone can download, install and use OpenRC or whatever they want if they really care enough. People actually took the time to document the process.
Linux is whatever you make of it. There is nothing stopping you from installing whatever you want. I could write an init today and start using it immediately. I don't need anybody's permission to do it.
> Most people did not choose systemd, their Linux distributions did.
By "people" I meant the people who make and maintain the distributions. They're the ones who actually choose what to ship in their projects. Users either accept it, look elsewhere or take on the maintenance burden unto themselves.
No doubt they chose systemd because it made their lives monumentally easier. Maintaining my own computer with systemd is pretty much painless. I don't even remember what it was like before.
> Neither my post nor most critique of systemd regards "standards compliance".
> we've started to see this sort of bifrucation of a lot more FOSS away from being standard-based and multi-platform to being Linux-specific.
No idea what "standard" you're referring to if not POSIX.