<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Though it might sound a little silly (because why not run linux), but starting with a beagle bone black would not be a terrible way to begin with bare metal work. &nbsp;It has plenty of RAM, you know that LLVM writes good machine code for it, it has JTAG accessible, it’s inexpensive, etc...<div class=""><br class=""></div><div class="">This would be an amazing achievement. &nbsp;I admit that was one of the first things I thought of when open source swift was announced. &nbsp;I loath programming in anything else. I’m spoiled.<div class=""><br class=""></div><div class="">- Will</div><div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On Dec 20, 2015, at 12:22 AM, Dmitri Gribenko via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Sat, Dec 19, 2015 at 6:53 PM, Chaitanya Mannem via swift-users <span dir="ltr" class="">&lt;<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class="">Hi,</div><div class=""></div><div class=""><blockquote type="cite" style="font-family:SFNSText,'Helvetica Neue',Helvetica,sans-serif" class=""><div class=""><div class=""></div></div></blockquote></div><div class=""><br class=""></div><div class=""><span style="font-family:SFNSText,'Helvetica Neue',Helvetica,sans-serif" class="">I wanted to know if it is possible to compile swift code for bare metal. I know there is a runtime but does swift depend on it to execute&nbsp;even if I don't use those features?, can I disable them somehow. I was hoping that since you can produce LLVM Bytecode that you can cross compile using the arm-none-eabi toolchain for an embedded use-case (</span><a href="http://www.ti.com/tool/ek-tm4c123gxl)" style="font-family:SFNSText,'Helvetica Neue',Helvetica,sans-serif" target="_blank" class="">http://www.ti.com/tool/ek-tm4c123gxl)</a><span style="font-family:SFNSText,'Helvetica Neue',Helvetica,sans-serif" class="">. Please tell me there's hope, I don't want to use C++ &nbsp;:(</span></div></div></blockquote><div class=""><br class=""></div><div class="">It is a goal of Swift to be a systems programming language, but nobody has yet compiled a program using Swift for a bare-metal target, so a significant amount of work would be required.</div><div class=""><br class=""></div><div class="">The Swift runtime is required to support basic features such as object allocation, casts and generics, so you can't just omit it.</div><div class=""><br class=""></div><div class="">Regarding the microcontroller that you referenced, I think it would be an overly ambitious goal to try to make everything work with 256 Kb of flash and 32 Kb of RAM.&nbsp; I would recommend to start with a more powerful bare-metal target, and get things working without an OS and memory protection, measure RAM and flash consumption, and try to fit everything into a smaller MCU.</div><div class=""><br class=""></div><div class="">Dmitri&nbsp;</div></div><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">main(i,j){for(i=2;;i++){for(j=2;j&lt;i;j++){if(!(i%j)){j=0;break;}}if<br class="">(j){printf("%d\n",i);}}} /*Dmitri Gribenko &lt;<a href="mailto:gribozavr@gmail.com" target="_blank" class="">gribozavr@gmail.com</a>&gt;*/</div>
</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=uCUFpGLUoBzd6VlLevGlN6zbiKwOlCB4F-2F5tkA0uYIDMZfLOKKM4L0or3d3yhFxlwX0MVmuqZrdaxbdpoju3ZMFSa3SZBe59GL0uIJns5661AGlcF5dKB4gLyBbS-2FOj5vEvRPpyOeEKwrwacXfitLhIT02SQFa0WpUYspZdVGac-2F1AfgXfQlw79SVkE2nXOKowMMOP1lC4J5m44cWtW-2BPbXi-2BCsZhhGKDYQVobkHMbg-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></body></html>