
Hi All, Topkata is a simple OpenGL Game written in Haskell. It's not very advanced. Goal so far is to guide a ball trough an labyrinth to the opposite corner. The web page shows an screenshot. It's only tested under Linux. http://home.arcor.de/chr_bauer/topkata.html Feedback&Patches are welcome. BTW, I had a lot of support in #haskell! Christoph Bauer

Hi Christoph,
opposite corner. The web page shows an screenshot. It's only tested under Linux.
Looks cool! Could you upload it to hackage? http://hackage.haskell.org/ Once its on hackage, using cabal install, it should be possible to get your game going with as little as: cabal install topkata && topkata That would be awsome for trying it out! Thanks Neil

Hello Neil,
Looks cool! Could you upload it to hackage?
Thank you. Ok, I uploaded the current version. At the moment you have to run topkata in the topkata-0.0 directory with ./dist/build/topkata/topkata, because it has to find its texture/sound files. Furthermore I encounter problems (i.e. segmentation faults) on Gentoo with the openal package. But openal-soft-1.4.272 works fine. Christoph Bauer

On 14 Jun 2008, at 12:45, Christoph Bauer wrote:
Hi All,
Topkata is a simple OpenGL Game written in Haskell. It's not very advanced. Goal so far is to guide a ball trough an labyrinth to the opposite corner. The web page shows an screenshot. It's only tested under Linux.
http://home.arcor.de/chr_bauer/topkata.html
Feedback&Patches are welcome. BTW, I had a lot of support in #haskell!
Looks awesome, and I completely agree with Niel -- hackage it up! In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! Bob

tom.davie:
On 14 Jun 2008, at 12:45, Christoph Bauer wrote:
Hi All,
Topkata is a simple OpenGL Game written in Haskell. It's not very advanced. Goal so far is to guide a ball trough an labyrinth to the opposite corner. The web page shows an screenshot. It's only tested under Linux.
http://home.arcor.de/chr_bauer/topkata.html
Feedback&Patches are welcome. BTW, I had a lot of support in #haskell!
Looks awesome, and I completely agree with Niel -- hackage it up!
In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there!
I'd be interested. We should start a wiki page for Haskell on the iphone.. -- Don

On Jun 14, 2008, at 1:06 PM, Don Stewart wrote:
tom.davie:
In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there!
I'd be interested. We should start a wiki page for Haskell on the iphone..
It's an interesting idea, but I think it would need to be a cross- compiler. Does ghc support cross-compilation? Deborah

On 15 Jun 2008, at 07:41, Deborah Goldsmith wrote:
On Jun 14, 2008, at 1:06 PM, Don Stewart wrote:
tom.davie:
In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there!
I'd be interested. We should start a wiki page for Haskell on the iphone..
It's an interesting idea, but I think it would need to be a cross- compiler. Does ghc support cross-compilation?
The most obvious place to start I guess would be using -fvia-C and the C cross compiler that apple supply. I'll certainly be looking into this as soon as I get an iPhone (which unfortunately I need to wait for 3G one in Belgium). Bob

In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! For that matter, there's another ARM-based target in which I'm interested: Nintendo DS. Has anyone got any Haskell code to run on one of these? PS: Maybe this discussion should be moved to a new "Haskell on ARM" thread? -- Ariel J. Birnbaum

"Ariel J. Birnbaum"
In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! For that matter, there's another ARM-based target in which I'm interested: Nintendo DS. Has anyone got any Haskell code to run on one of these? PS: Maybe this discussion should be moved to a new "Haskell on ARM" thread?
I would be interested to see ghc running on Nokia n8xx or iRex iliad. Both of them are quite open linux based systems. -- c/* __o/* <\ * (__ */\ <

xj2106:
"Ariel J. Birnbaum"
writes: In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! For that matter, there's another ARM-based target in which I'm interested: Nintendo DS. Has anyone got any Haskell code to run on one of these? PS: Maybe this discussion should be moved to a new "Haskell on ARM" thread?
I would be interested to see ghc running on Nokia n8xx or iRex iliad. Both of them are quite open linux based systems.
Jeremy Shaw had ghc targeting the nokia last year, iirc. Perhaps he'll have more info. -- Don

Hello, I have, on two occasions made an *unregisterised* of GHC for the ARM (specifically the Maemo on Nokia 770). Mostly I just followed the unregisterised porting directions in the GHC user manual. I documented one attempt here: http://hackage.haskell.org/trac/ghc/wiki/ArmLinuxGhc Note: This procedure is for building a version of GHC that runs on ARM and generates ARM code. So, it is not build a cross-compiler, just a native ARM compiler. The unregisterised build is not that useful because: 1. no FFI 2. uses trampolining for tail calls 3. no threads I think 4. some other stuff I have forgotten So, the next step is to registerise the build. This is online a few lines a code. Basically stuff like: 1. add ARM support to the evil mangler (basically, a few regexps to strip prolog and epilogue stuff from the ASM) 2. #define which registers exist and what they should be used for 3. implement the tail call ASM 4. define some aspects of the C calling convention 5. (Optional), implement native assembly generation This is not a lot of code. However, it is very low-level code. I think that doing a registerised build is pretty easy, the *second* time you do it. The big problem is that there is pretty much no documentation on how to do it. (The porting guide does tell you, very generally, what needs to be done). Also, running GHC on an emulated ARM processor is slow. I think it took GHC 6.4 8+ hours to build. Now that many of the extra libs have been split out into the extra libs package, that should help significantly with the build time. If any does attempt to build for the ARM, please, please, please, document what you do in the wiki. And, if you do, edit the wiki as you go, you definitely won't be able to remember what you did after the fact. (Or, at the very least, use some program to capture everything you do so that you can refer to it later). And, finally, I heard vague rumors a while ago that made me think that GHC 6.10 might have a pure ANSI-C backend? Is there any truth to this? That would make porting much easier if it meant you did not have to do steps 1-4. j. ps. I would be happy to try to answer any questions if someone tries a port. I would still like to run GHC on my 770, and I hope to own an iPhone if they fix a few ommisions (bluetooth keyboard support, and similar stuff). At Tue, 17 Jun 2008 13:12:33 -0700, Don Stewart wrote:
xj2106:
"Ariel J. Birnbaum"
writes: In the mean time -- who knows enough to make ghc target ARM, and get this to link against the iPhone libraries? This would be quite a coup if it could be made to run there! For that matter, there's another ARM-based target in which I'm interested: Nintendo DS. Has anyone got any Haskell code to run on one of these? PS: Maybe this discussion should be moved to a new "Haskell on ARM" thread?
I would be interested to see ghc running on Nokia n8xx or iRex iliad. Both of them are quite open linux based systems.
Jeremy Shaw had ghc targeting the nokia last year, iirc. Perhaps he'll have more info.
-- Don _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Jeremy Shaw wrote:
If any does attempt to build for the ARM, please, please, please, document what you do in the wiki. And, if you do, edit the wiki as you go, you definitely won't be able to remember what you did after the fact. (Or, at the very least, use some program to capture everything you do so that you can refer to it later).
And, finally, I heard vague rumors a while ago that made me think that GHC 6.10 might have a pure ANSI-C backend? Is there any truth to this? That would make porting much easier if it meant you did not have to do steps 1-4.
j.
ps. I would be happy to try to answer any questions if someone tries a port. I would still like to run GHC on my 770, and I hope to own an iPhone if they fix a few ommisions (bluetooth keyboard support, and similar stuff).
I recently acquired the ARM-based Nokia N810 (and <3 it), powered by Maemo. Running a uname -a on it: Linux Nokia-N810-42-19 2.6.21-omap1 #2 Fri Nov 16 16:24:58 EET 2007 armv6l unknown I would love a working GHC implementation on it, if for nothing else than how awesome it would be. Whether that means using a C back-end or native compilation doesn't matter to me so much. I might be one to attempt this, as I know C and ARM-ish asm decently well and have a powerful desktop to compile on. I have no familiarity with GHC internals, though. Lastly, I won't have anything like the time to attempt this seriously until mid-September or so. Braden Shepherdson shepheb

At Tue, 24 Jun 2008 20:43:45 -0400, Braden Shepherdson wrote:
I recently acquired the ARM-based Nokia N810 (and <3 it), powered by Maemo. Running a uname -a on it:
I might be one to attempt this, as I know C and ARM-ish asm decently well and have a powerful desktop to compile on. I have no familiarity with GHC internals, though.
I think that is a fine set of qualifications. The porting process requires low-level knowledge of C, asm, and the ARM more than GHC internals. It's mostly stuff like #defining what the names of the ARM registers are, and which ones are preserved across C function calls. Also, if you are not starting until at least Sept, waiting for 6.10 might be a good choice, since it sounds like the backend will be changing quite a bit. No point in doing it twice if there is no rush. j. ps. Perhaps we should have some sort of GHC on the ARM hackathon when 6.10 comes out. I think there are quite a few people who have tried or who are interested in trying a port. Having more heads look at it would probably make things go faster.

| Linux Nokia-N810-42-19 2.6.21-omap1 #2 Fri Nov 16 16:24:58 EET 2007 | armv6l unknown | | I would love a working GHC implementation on it, if for nothing else | than how awesome it would be. Whether that means using a C back-end or | native compilation doesn't matter to me so much. | | I might be one to attempt this, as I know C and ARM-ish asm decently | well and have a powerful desktop to compile on. I have no familiarity | with GHC internals, though. Lastly, I won't have anything like the time | to attempt this seriously until mid-September or so. That's good. John Dias is hard at work on GHC's back end, and we should be in reasonable shape by mid Sept. Better still a month later... Keep us posted with what you do. Simon

Simon Peyton-Jones wrote:
| Linux Nokia-N810-42-19 2.6.21-omap1 #2 Fri Nov 16 16:24:58 EET 2007 | armv6l unknown | | I would love a working GHC implementation on it, if for nothing else | than how awesome it would be. Whether that means using a C back-end or | native compilation doesn't matter to me so much. | | I might be one to attempt this, as I know C and ARM-ish asm decently | well and have a powerful desktop to compile on. I have no familiarity | with GHC internals, though. Lastly, I won't have anything like the time | to attempt this seriously until mid-September or so.
That's good. John Dias is hard at work on GHC's back end, and we should be in reasonable shape by mid Sept. Better still a month later... Keep us posted with what you do.
Simon
Well, I've documented three attempts in detail on the ArmLinuxGhc Trac page[1]. In short, it doesn't work. 6.8 and 6.9 fail, expectedly, since bootstrapping is known to be broken[2]. 6.6 might be made to work, but it didn't work with moderate effort and so it seems foolish to invest that sort of energy into an old version when the back end is being overhauled. As it appears that the task will be much easier after the back end changes, this project is effectively on hold until the 6.10 release. In particular, bootstrapping needs to work. There is a bug[2] about this with milestone set to 6.10.1. Hopefully a quick-and-dirty unregisterised port will be easy after that, with registerised and possibly even native code-gen on the horizon. One question that has come up is, what external tools does GHC need to build binaries on a given platform? When going via-c, is a complete C toolchain necessary? When doing native code-gen, are ld or ar required, or other binutils? If we magically had a 6.9 that would generate ARM binaries, what would it take to run binaries built in the dev environment on the device? Would it take more to run GHC itself on the device? Braden Shepherdson shepheb [1] http://hackage.haskell.org/trac/ghc/wiki/ArmLinuxGhc [2] http://hackage.haskell.org/trac/ghc/ticket/1346

On Tue, Jun 24, 2008 at 11:27:03AM -0700, Jeremy Shaw wrote:
The unregisterised build is not that useful because:
1. no FFI
If libffi supports it then this should now work.
1. add ARM support to the evil mangler (basically, a few regexps to strip prolog and epilogue stuff from the ASM)
Note that the mangler is on the way out for 6.10: http://www.haskell.org/pipermail/cvs-ghc/2008-June/042979.html
5. (Optional), implement native assembly generation
You'll need to do this instead. Thanks Ian

Just a random note. jhc works fine on ARM, I have successfully run Haskell programs on on iPhone and a nokia n800 tablet compiled with it. jhc is, of course, still pretty unstable. but new developers are always welcome. John -- John Meacham - ⑆repetae.net⑆john⑈

Also, I have successfully run hugs on the Nokia N770. j. At Sat, 28 Jun 2008 22:39:00 +0100, Malcolm Wallace wrote:
Just a random note. jhc works fine on ARM,
Another semi-random note: nhc12 and nhc13 (precursors to nhc98) were originally developed on an ARM with 2Mb of memory, way back in 1994-5.
Regards, Malcolm
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

2008/6/30 Jeremy Shaw
I have successfully run hugs on the Nokia N770.
hugs has also been successfully run on the Nintendo DS, as far as I'm aware. However, my aim is to be able to write high-performance applications (say, games) in haskell. An interpreter just isn't fast enough. Maybe I should try working on an inline C module too... Jeremy
participants (14)
-
Ariel J. Birnbaum
-
Braden Shepherdson
-
c-bauer-olsbruecken@t-online.de
-
Deborah Goldsmith
-
Don Stewart
-
Ian Lynagh
-
Jeremy Apthorp
-
Jeremy Shaw
-
John Meacham
-
Malcolm Wallace
-
Neil Mitchell
-
Simon Peyton-Jones
-
Thomas Davie
-
Xiao-Yong Jin