Re: [Haskell] ANNOUNCE: jhc 0.6.1

Hi, this is to announce the release of jhc 0.6.1. The jhc homepage with distribution information is at http://repetae.net/computer/jhc/
The main new feature in this release is a much simplified cross-compilation mechanism. While cross-compilation was always possible with jhc, it used to involve manually copying the C file and calling gcc with the right options on it, now this is taken care of by jhc.
A (popular) example would be setting up an iPhone cross compilation target. For instance with the SDK setup I have, I would simply add the following to a file ~/.jhc/targets.ini
[iphone] cc=arm-apple-darwin cflags+=-I/usr/local/arm-apple-darwin/include merge=le32
then you can compile iphone binaries with
; jhc --cross -miphone HelloWorld.hs
the targets mechanism is extensible at run-time and I have included native unix, win32, osx-intel and osx-powerpc targets. But certainly many more interesting ones are possible. Some I have tested have been a nokia N770 as a target and an atheros MIPS based router running dd-wrt. Maximum coolness! When you were targeting the nokia, how did you handle
Switching to Haskell Cafe; I hope you read that list, John, since it seems more suitable to this kind of question. John Meacham wrote: the radically different user interface? Did you have to establish a mapping from one of the Haskell UI packages to the Nokia equivalents? If so, which one did you pick, and how much time did it take? I'd love it if I could get this working for the Palm.... Dave Barton (soon to be) University of Toronto

On Wed, Jun 24, 2009 at 11:43:25AM -0400, David Barton wrote:
the targets mechanism is extensible at run-time and I have included native unix, win32, osx-intel and osx-powerpc targets. But certainly many more interesting ones are possible. Some I have tested have been a nokia N770 as a target and an atheros MIPS based router running dd-wrt. Maximum coolness! When you were targeting the nokia, how did you handle the radically different user interface? Did you have to establish a mapping from one of the Haskell UI packages to the Nokia equivalents? If so, which one did you pick, and how much time did it take?
No, I didn't establish a full mapping. I was mainly testing the cross compilation abilities of jhc so wasn't working on full nokia apps. However, maemo is based on gtk, so the gtk2hs bindings should just work and you need only extend them with the few maemo specifc APIs. The maemo APIs follow the same basic pattern as the gtk interface, so extending gtk2hs probably won't be hard. And of course, once such a binding is written, you will be able to use it with any haskell compiler that can target maemo.
I'd love it if I could get this working for the Palm....
Basically, if you can get a gcc toolchain working for your target and the CPU isn't too absurd, then jhc will be able to compile to it with just an entry in your targets.ini file. Now, the harder bit is the standard libraries, the ones included with jhc assume something vaugely unixy (or windowsy), So you may need to modify them to bind to the appropriate palm APIs. Perhaps an 'embedded subset' of haskell 98 would be a good thing to split off the standard jhc libraries. Something that makes floating point and arbitrary precision arithmetic optional and forgoes most of the haskell98 IO routines in favor of a platform specific model... John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
participants (2)
-
David Barton
-
John Meacham