Matthijs, perhaps another option for Microcontroller work with Swift would be the Raspberry Pi. It runs a full version of Linux and has the $5 Raspberry Pi Zero option now.
I'd love to hear of any progress on that front. On Fri, Dec 4, 2015 at 9:26 AM, Dmitri Gribenko <[email protected]> wrote: > On Fri, Dec 4, 2015 at 5:37 AM, Matthijs Hollemans <[email protected]> > wrote: > > Hi all, > > > > Just out of curiosity, how feasible would it be to get swiftc working as > a cross-compiler for Arduino microcontrollers? > > > > Currently the Arduino is programmed in C/C++ and seeing as Swift is > positioned as a replacement for those languages, I’m wondering if it could > live up to this task already. > > > > Obviously, the low-end Arduinos use an 8-bit CPU and an LLVM code > generator for this CPU is required. But my main concern is the requirements > of the Swift runtime. An Arduino Uno only has 32 kB of working memory. How > much of that would be taken up by the Swift runtime? > > The runtime and the standard library currently take much more than 32 > kB. Also, the runtime and the standard library in many places rely on > having an OS providing a POSIX API. I'm also unsure about the state > of the LLVM backend for ATmega. I'm not saying that running on a > small 8-bit microcontroller is completely infeasible, but it will > certainly require a major engineering effort across the whole stack, > starting from LLVM. > > Dmitri > > -- > main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if > (j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/ > _______________________________________________ > swift-dev mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-dev > -- Steven Hepting iOS Developer
_______________________________________________ swift-dev mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-dev
