I’m not sure if this is the right category for this question; if not, please let me know which is better and I’ll move the topic over there.
I’d like to build a simple IDE for doing embedded development. To that end I want to link against Swift libraries for compilation and linking. I realize that the Swift runtime demands a lot from a processor and OS, and may not be suitable for Atmel-class MCUs (not to mention a lack of code generation), but should work well on larger ARM cores.
I’d like to find ways to restrict some language features (say, removing Dispatch Queues) as necessary to allow the resulting programs to fit in smaller processors or environments without threading. But I think most ARM cores can support threading and dispatch, so then it’s a question of trimming the standard library.
The result eventually has to be a “raw” binary, where the first compiled instruction is the first byte in the file. In the past when I tried to do this with clang it was surprisingly hard to get the linker to handle it. I don’t know if that’s easier today or not, but I’d like to resume these efforts with Swift in mind.
I’ll take care of providing a suitable runtime environment (ie OS) for these processors, so that’s not really my concern right now. But I do want to enable the end user to fill out a couple of methods (e.g. setup() and loop()), using a high-level abstraction of the available hardware that I will provide, and let them click a button that compiles everything, bundles it, downloads it to the target, and runs it.
Is there any sample code or documentation for invoking the Swift libraries (something akin to the Kaleidoscope example in llvm)? Thanks!