Embedded funcional programming?

Hi, all, I've beeing working with some people who do programming for wireless devices. 100% of their code uses C, and I would like to show them nice things they could do with funcional programming (not necessarily Haskell. I believe, say, Standard ML could be also very nice.) I'm new to this, so the only problems I see are finding a compiler that targets the platform (ARM7, for instance, or others) and uploading the compiled firmware to the device. Do you think this can be a straightforward path? Thanks, Maurício

Hello Maurício
I'm new to this, so the only problems I see are finding a compiler that targets the platform (ARM7, for instance, or others) and uploading the compiled firmware to the device.
You might find that the extra RAM requirements for a non-C language becomes a problem - especially when it manifestly translates to extra euros/dollars on the "BOM" costs (aka bill-of-materials). Best wishes Stephen

I'm new to this, so the only problems I see are finding a compiler that targets the platform (ARM7, for instance, or others) and uploading the compiled firmware to the device.
You might find that the extra RAM requirements for a non-C language becomes a problem - especially when it manifestly translates to extra euros/dollars on the "BOM" costs (aka bill-of-materials).
About 15 years ago, I wrote my PhD Thesis on the topic of "Functional Programming and Embedded Systems". ftp://ftp.cs.york.ac.uk/pub/malcolm/thesis.html Back then, I was using the Gofer interpreter (a forerunner of Hugs), compiling Haskell to bytecode, and targetted at the M68000. Bytecode is one important way to reduce the RAM requirements. An interpreter can also be quite parsimonious with heap allocation - as I recall, I extended the embedded board from 256kb of RAM to 768kb (yes, note kilobytes, not Mb) in anticipation of heap pressure, but in the end came nowhere near needing all of that. Regards, Malcolm

Maurício CA
I've beeing working with some people who do programming for wireless devices. 100% of their code uses C, and I would like to show them nice things they could do with funcional programming (not necessarily Haskell. I believe, say, Standard ML could be also very nice.)
I'm new to this, so the only problems I see are finding a compiler that targets the platform (ARM7, for instance, or others) and uploading the compiled firmware to the device.
Do you think this can be a straightforward path?
With one other guy, I got OCaml working on the iPhone. I don't know that I'd call it straightforward, exactly. The hardest part was the interface to the existing libraries (Cocoa Touch). This included making some tweaks to the OCaml ARM back end so that its register and calling conventions match what is used by Apple's C and ObjC compilers. At any rate, we were really very happy with the results until a week or so ago when Apple apparently saw fit to forbid the use of languages other than C, C++, and ObjC. Your associates might have a much easier time if they're working closer to bare metal. If their hardware is up to it, I would really suggest looking into it. As a side comment, I haven't noticed any reaction in the Haskell/iPhone community about Apple's recent policy change. Regards, Jeffrey Scofield Seattle

On Sat, Apr 17, 2010 at 08:21:06PM -0700, Jeffrey Scofield wrote:
As a side comment, I haven't noticed any reaction in the Haskell/iPhone community about Apple's recent policy change.
I've seen some reaction in other language communities, and I'm sure you can imagine what it's like. Understandable sentiments, but not very productive. I recently purchased an Android phone and spent a little time looking around to see if Haskellers were doing anything there, but no luck so far. Has anyone here done anything with Android? -- Darrin Chandler | Phoenix BSD User Group | MetaBUG dwchandler@stilyagin.com | http://phxbug.org/ | http://metabug.org/ http://www.stilyagin.com/ | Daemons in the Desert | Global BUG Federation

Darrin Chandler wrote:
On Sat, Apr 17, 2010 at 08:21:06PM -0700, Jeffrey Scofield wrote:
As a side comment, I haven't noticed any reaction in the Haskell/iPhone community about Apple's recent policy change.
I've seen some reaction in other language communities, and I'm sure you can imagine what it's like. Understandable sentiments, but not very productive.
I recently purchased an Android phone and spent a little time looking around to see if Haskellers were doing anything there, but no luck so far. Has anyone here done anything with Android?
I've done a simple app in Java, and some experiments with JRuby. I've not done any thing Android with Haskell, but would love to give it a shot. However, I don't know where to begin. James -- Neurogami - Smart application development http://www.neurogami.com james@neurogami.com

On 18/04/2010, at 1:39 PM, Darrin Chandler wrote:
I recently purchased an Android phone and spent a little time looking around to see if Haskellers were doing anything there, but no luck so far. Has anyone here done anything with Android?
Not Haskell, but FP on Android: http://www.kablambda.org/blog/2009/07/27/functional-programming-on-android/ I don't have an Android, so all I did was a 'hello world' to see if it could be done. Tom

Jeffrey Scofield
As a side comment, I haven't noticed any reaction in the Haskell/iPhone community about Apple's recent policy change.
From the Haskell reddit:
http://www.reddit.com/r/haskell/comments/bouxy/more_on_the_iphone_applicatio... http://www.reddit.com/r/haskell/comments/boc3t/does_this_mean_we_cant_use_ha... -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

As a side comment, I haven't noticed any reaction in the Haskell/iPhone community about Apple's recent policy change.
The stricter they make it, the better, since it hopefully gets us closer to the point where people will see that they should stay the heel away from any such handcuffs, Stefan
participants (9)
-
Darrin Chandler
-
Ivan Lazar Miljenovic
-
James Britt
-
Jeffrey Scofield
-
Malcolm Wallace
-
Maurício CA
-
Stefan Monnier
-
Stephen Tetley
-
Tom Davies