News for hackers. Stuff that matters.
Re:Pragmatic Bare Metal Rust by hoprocker on Tuesday May 19, 2015 @05:58PM (#9573439)
This is great! I've been thinking about doing something like this with Rust for a while. Anybody have experience using Zinc.rs[0] in a similar capacity?

[0] https://zinc.rs/

Re:Pragmatic Bare Metal Rust by jakobdabo on Tuesday May 19, 2015 @06:07PM (#9573485)
If you are looking into Zinc, there is a newer version of it here at https://github.com/mcoffin/zinc/tree/new-build

If I'm not wrong, it will be merged with the official version soon.

Re:Pragmatic Bare Metal Rust by posborne on Tuesday May 19, 2015 @11:18PM (#9574473)
That is the hope, since master is currently out of date.

I have been working with Matt Coffin some on getting this working. Feel free to increase its chances of merging by helping us test any of the supported boards (Freescale K20, NXP LPC17xx, SAM3x (on a branch), STM32F4, STM32l1, TI Tiva C).

I plan on putting together an RFC for how we can modify zinc (or provide documentation) to make it easier for individuals to create both libraries and projects that work well with zinc, but do not require modifying zinc itself.

Re:Pragmatic Bare Metal Rust by Animats on Wednesday May 20, 2015 @12:23AM (#9574663)
Zinc looks very promising. Will it fit on the Arduino Due, which is an ARM system with limited memory?
Re:Pragmatic Bare Metal Rust by posborne on Wednesday May 20, 2015 @12:55AM (#9574746)
Yes, I believe so. The binaries I have built so far have been very small (<2KB for a blink example). mcoffin has a branch with SAM3x support, which appears to be the processor on the Due: https://github.com/mcoffin/zinc/tree/sam3x

The Due has 512KB of room for code which is quite a lot (for microcontrollers).

Re:Pragmatic Bare Metal Rust by TickleSteve on Wednesday May 20, 2015 @02:14AM (#9574893)
2KB to blink LEDS? seriously? this needs to be on the order of a few ten of bytes to be competitive...
Re:Pragmatic Bare Metal Rust by posborne on Wednesday May 20, 2015 @09:54AM (#9576297)
A few points:

* I don't think a few tens of bytes is realistic for a real application that needs to set up the stack, timers, and then blink some LEDs (https://github.com/mcoffin/zinc/blob/new-build/examples/app_... / https://github.com/mcoffin/zinc/blob/new-build/examples/app_...)

* Assuming the code size overhead does not continue to bloat after some initial overhead, I think rust can still be very competitive. Although modern embedded systems are still very constrained, the days of 8-bit micros are basically over. You can buy a 32-bit ARM micro for nearly the same cost with sufficient RAM/Flash to run rust well.

* Looking back, I think the size of blink should actually be closer to 600 bytes. Will need to investigate: http://zinc.rs/stats/

Re:Pragmatic Bare Metal Rust by rkangel on Wednesday May 20, 2015 @08:28AM (#9575823)
That depends on what's in there. My understanding is that that 2Kb is not so much overhead as required dependencies. Dependencies that most real applications would probably end up pulling in anyway, like a dynamic memory allocator.

The end of the market with tiny micros and extremely simple applications (like just blinking LEDs) is likely to never be well suited to Rust, but doesn't gain much from it anyway.

Re:Pragmatic Bare Metal Rust by Ygg2 on Wednesday May 20, 2015 @05:14AM (#9575230)
It probably can be lowered by manually linking and similar stuff.

See: http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-...