[TUHS] Any UNIX With No C In Userland?

Greg A. Woods woods at robohack.ca
Tue Mar 4 07:57:39 AEST 2025


At Mon, 3 Mar 2025 22:31:13 +1100, Peter Yardley <peter.martin.yardley at gmail.com> wrote:
Subject: [TUHS] Re: Any UNIX With No C In Userland?
>
> Problems I have with C as a systems language is there is no
> certainty about representation of a structure in memory and hence
> when it is written to disk.

That might be true for some nit-pick-ity "Standard C", but it isn't true
for most real implementations, at least in the realm of 'hosted'
implementations.  Real implementations do after all have to interface
with real hardware.

In fact it's not impossible, or even really hard, to define a struct,
even with bitfields, that can be "portably" compiled for a number of
different architectures and platforms, including with different word
sizes and endianness and which will map directly onto an external binary
data representation.  It can get a bit ugly to look at, but it works.
Between the compiler manual and the ABI manual it _should_ all be quite
clear how to do it.

Of course "Standard C" has only got worse as it has morphed along the
way, growing increasingly thorny with more instead of less "Undefined
Behaviour".

--
					Greg A. Woods <gwoods at acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <woods at robohack.ca>
Planix, Inc. <woods at planix.com>     Avoncote Farms <woods at avoncote.ca>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP Digital Signature
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20250303/6a98c14b/attachment.sig>


More information about the TUHS mailing list