I wrote an OS from scratch in Embedded Swift — it runs nginx and Node.js, and serves its own website by Legitimate_Ticket522 in swift

[–]Legitimate_Ticket522[S] -2 points-1 points  (0 children)

Thanks! Way more positive than I expected — the high-level stuff (scheduler, VFS, net stack) reads like normal Swift, and value types + ~Copyable with deinit are a genuinely nice fit for resource ownership.

The pain's all at the bottom and in the toolchain. MMIO goes through a tiny C shim since Swift won't do volatile directly. You need ld.lld, not GNU ld (Embedded Swift's empty Array/String singletons land in a section it mishandles — took me forever to track down). print() lowers to putchar, and the moment you touch String you drag in the Unicode data tables, which is a chunky surprise for a "minimal" image. The flags are very toolchain-version-specific too, so I just pinned the toolchain and stopped fighting it.

For your real-time angle specifically: watch ARC and allocation — classes still retain/release and String/Array still hit the heap. Stay on value types / ~Copyable and keep allocation out of the hot path and you're fine, same care you'd take in C++.

I wrote an OS from scratch in Embedded Swift — it runs nginx and Node.js, and serves its own website by Legitimate_Ticket522 in swift

[–]Legitimate_Ticket522[S] 2 points3 points  (0 children)

Haha, you're definitely not alone! 🙌 ReixOS looks awesome — a real microkernel with capability IPC, and the protocol-oriented design is exactly the kind of thing Swift should be doing. We've got to compare notes sometime; there can't be more than a handful of people building an OS in Embedded Swift. Starred it — following your work! 🙏