Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-16 Thread Slava Pestov via swift-users
> On Aug 15, 2016, at 3:36 PM, Rick Mann wrote: > > Well, even C++ requires some amount of run time. On a larger MCU, the runtime > shouldn't be a problem at all. What I want to do is minimize the amount of OS > I have to implement. For example, using newlib >

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-15 Thread David Sweeris via swift-users
I don't know what you mean by "naked function", but you'd request it by starting a thread on swift evolution (which I would encourage you to do). - Dave Sweeris > On Aug 15, 2016, at 17:36, Rick Mann wrote: > > Well, even C++ requires some amount of run time. On a

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-15 Thread Rick Mann via swift-users
Well, even C++ requires some amount of run time. On a larger MCU, the runtime shouldn't be a problem at all. What I want to do is minimize the amount of OS I have to implement. For example, using newlib (https://sourceware.org/newlib/), I can stub out 20-odd functions, and everything gets

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-11 Thread Slava Pestov via swift-users
Even if you take care not to create class instances, the compiler emits many calls to runtime functions to implement features such as generics, casts and existentials. It is possible to write code where a large number of runtime calls are optimized away, but I don’t think they can be eliminated

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-10 Thread Rick Mann via swift-users
> On Aug 10, 2016, at 09:31 , Jens Alfke wrote: > > If you’re going for something bigger than that, why not just use a Raspberry > Pi or C.H.I.P. or one of the other tiny ARM PC boards? They all run Linux, > and I believe people are already working on porting Swift to run

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-10 Thread Saagar Jha via swift-users
Sent from my iPhone > On Aug 10, 2016, at 08:31, Jens Alfke via swift-users > wrote: > > >> On Aug 9, 2016, at 1:10 PM, Rick Mann via swift-users >> wrote: >> >> For the smaller devices, runtime library overhead is a concern (mostly due >>

Re: [swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-10 Thread David Sweeris via swift-users
There's definitely a runtime, but I *think* you can avoid actually using it by being very careful with your data structures. ARC means that classes obviously trigger it, and I think it *might* be involved resizing arrays and strings (they do some tricks behind the scenes, but I can't remember

[swift-users] Swift in bare-metal embedded programming/Swift runtime

2016-08-09 Thread Rick Mann via swift-users
Is it possible to use Swift for bare-metal programming on embedded devices? These devices usually have memory-mapped registers that are read and written to affect the operation of the device. Some can be quite small (e.g. 8-bit registers, simple single physical memory address space), and others