Thank you for the write-up! Here’re some personal thoughts on the note:
I would argue that this one is actually off-topic, because a R-Pi capable of running the toolchain is no different from other ARM64 Linux machines, and such power is really, really, rare in embedded development. Supporting Raspberry Pi as a host falls into general platform support instead.
I would say SwiftPM is doing fairly well in cross-compilation — except that destination.json support is lacking documentation so many developers may not even notice it. SourceKit-LSP is a trouble-maker here. It doesn’t support setting the destination directly, and the only workaround is to pass Swift compiler flags through -Xswiftc, which makes things really awkward. The issue is tracked in apple/sourcekit-lsp#601 and resolving it will largely benefit cross-platform developers.
It’s possible to switch build targets flawlessly in VS Code once SourceKit-LSP supports hot-reloading destination.json, so the trickier part could be deployment. @Max_Desiatov is now working on the v2 version of destination.json, and we can see if it’s possible to add deployment support (perhaps a plugin URL?) into it.
32-bit support is getting sunset in both Linux, Windows, Darwin (and Android) world, and I believe there’s far more trouble than benefits to have a 32-bit Swift host. More stable and portable cross-compilation support for 32-bit targets should fully meet the need to support 32-bit embedded/bare-metal platforms.
Couldn’t agree more. Binary size is the biggest drawback of SwiftWasm compared to other compiled languages like Go and Rust. I would say that WebAssembly has far lower resource for binary size than embedded platforms, considering how precious bandwidth and loading time are.
It’s worth investigating how we can subset the standard library to match specific use cases. Dead-stripping support is also vital here because it can automatically strip unused standard library codes more effectively without having to provide a variant.
Swift’s Unicode support makes up a huge part of binary size, and I would be happy to see “Swift with no UTF-8”. However, making a dialect is troublesome and may eventually harm the language itself. Is it possible to introduce a new set of safe API for non-Unicode (raw?) strings, instead of tweaking String(let’s just remove it)? I know such approach will largely reduce the usability of many libraries considering how String is widely used, but it’s also important to make things right and disambiguated.