Foundation in Embedded Swift

The one catch here is that the bare initializer Date() is the exact same as Date.now. That would mean that any call to the bare initializer would need to have access to some RTC clock which not all boards have (im not sure I've seen a actual chip with a builtin RTC, development boards or production boards sure... but not a chip).

Per the concept of calendars (which means locales and consequently ICU databases) this might overlap nicely with @Douglas_Gregor's pitch [Pitch] [Embedded] "Unicode" availability domain for APIs requiring the Unicode tables. Albeit a viral annotation to litter the Foundation codebase, but perhaps a good mechanism to indicate the "smallness"(or not) of impact of APIs.

Data would require an allocator of sorts, posix_memalign etc. JSON would require similar allocations but also probably would face some issues around existentials. URL might be more approachable than it has in the past with the recent work folks have been doing around that. URLSession however would likely be rather non-trivial.

Essentials is a good starting point to build for embedded, however I would guess that the other localization and networking sub projects of Foundation might be a bit of tall asks from my experience.

3 Likes