whistler
Re:Winding down the Swift 3 release
on Wednesday May 18, 2016 @04:22AM (#11720503)
I agree that dynamic dispatch is not suitable for a kernel however if you compile Swift on a linux host then there is no ObjC runtime support anyway so its not an issue. However I would still see it as the full Swift language
Re:Winding down the Swift 3 release
on Tuesday May 17, 2016 @02:08PM (#11715876)
It is possible but the Swift stdlib does rely on a minimal set of libc functions including malloc()/free() and the usual str* and mem* functions. Some of the other functionality can be removed eg the math and floating point but even implementing malloc() in Swift would be hard because any data structures that get used eg Arrays will themselves rely on malloc(), and even if you wrote it using UnsafeMutablePointer it would not be much different to a C implentation. Also the globalinit functions that get called at startup themselves rely on malloc() so it ends up being circular.
However if you are willing to accept some functionality will be written in C it is possible to run Swift directly on bare metal.