<div dir="ltr">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.<div><br></div><div>I&#39;d love to hear of any progress on that front.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 9:26 AM, Dmitri Gribenko <span dir="ltr">&lt;<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Dec 4, 2015 at 5:37 AM, Matthijs Hollemans &lt;<a href="mailto:mail@hollance.com">mail@hollance.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Just out of curiosity, how feasible would it be to get swiftc working as a cross-compiler for Arduino microcontrollers?<br>
&gt;<br>
&gt; 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.<br>
&gt;<br>
&gt; 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?<br>
<br>
</span>The runtime and the standard library currently take much more than 32<br>
kB.  Also, the runtime and the standard library in many places rely on<br>
having an OS providing a POSIX API.  I&#39;m also unsure about the state<br>
of the LLVM backend for ATmega.  I&#39;m not saying that running on a<br>
small 8-bit microcontroller is completely infeasible, but it will<br>
certainly require a major engineering effort across the whole stack,<br>
starting from LLVM.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dmitri<br>
<br>
--<br>
main(i,j){for(i=2;;i++){for(j=2;j&lt;i;j++){if(!(i%j)){j=0;break;}}if<br>
(j){printf(&quot;%d\n&quot;,i);}}} /*Dmitri Gribenko &lt;<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>&gt;*/<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><font color="#999999">Steven Hepting</font></div><div><font color="#999999">iOS Developer</font></div></div></div>
</div>