Predefined Versions for Apple Operating Systems
Michael K. Huntington
asleep.wildfowl.nmto at letterprotect.net
Wed Jun 25 08:22:50 UTC 2025
On Saturday, 21 June 2025 at 20:24:34 UTC, Walter Bright wrote:
> Currently, the following predefined versions exist for Apple
> operating systems:
>
> OSX iOS TVOS WatchOS VisionOS
>
> When I look at druntime source code, I see things like:
>
> ```d
> version (OSX)
> version = Darwin;
> else version (iOS)
> version = Darwin;
> else version (TVOS)
> version = Darwin;
> else version (WatchOS)
> version = Darwin;
> ```
> and:
> ```d
>
> ```d
> version (OSX) {}
> else version (iOS) {}
> else version (TVOS) {}
> else version (WatchOS) {}
> else:
> ```
> appearing ad nauseam.
>
> (note the conspicuous absence of VisionOS appearing in druntime)
>
> I propose, like Windows encompassing Win32 and Win64, that
> __APPLE__ encompass OSX, iOS, TVOS, WatchOS, and VisionOS.
> __APPLE__ is already standardized in C headers for that purpose.
>
> The use of "darwin" or "Darwin" appears to be quite obsolete.
>
> This will clean up a lot of version algebra in the druntime
> files.
That's a really interesting question about D! I haven't worked
with D's WASM bindings myself, but the concept of direct access
to externref and funcref is vital for efficient interop. It
reminds me of wrestling with similar pointer type conversions in
Rust. If you're looking for a good way to de-stress from the
coding headaches this kind of thing causes, I highly recommend
playing Geometry Dash. It's surprisingly addictive. Good luck
finding your D solution!
https://geometrydashgame.lol
More information about the Digitalmars-d
mailing list