Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-29 Thread Jeremy Apthorp
2008/6/30 Jeremy Shaw <[EMAIL PROTECTED]>:
> 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-29 Thread Jeremy Shaw
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-28 Thread Malcolm Wallace

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


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-27 Thread John Meacham
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⑈
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-26 Thread Ian Lynagh
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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-24 Thread Jeremy Shaw
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" <[EMAIL PROTECTED]> 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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-17 Thread Don Stewart
xj2106:
> "Ariel J. Birnbaum" <[EMAIL PROTECTED]> 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


Haskell on ARM (was Re: [Haskell-cafe] ANN: Topkata)

2008-06-17 Thread Xiao-Yong Jin
"Ariel J. Birnbaum" <[EMAIL PROTECTED]> 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.
-- 
c/*__o/*
<\ * (__
*/\  <
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-16 Thread 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?
-- 
Ariel J. Birnbaum
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-15 Thread Thomas Davie


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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-15 Thread Christoph Bauer
Hi,

>> There's a way to put something in the .cabal file about extra data files,
>> and have it install them in a certain location that you can then find
>> programmatically.  I forget the details, but I think it's pretty easy to set
>
> http://neilmitchell.blogspot.com/2008/02/adding-data-files-using-cabal.html

With this summary it was easy. I pushed an patch to
http://home.arcor.de/chr_bauer/topkata.

Christoph
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Deborah Goldsmith

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

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Don Stewart
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Neil Mitchell
Hi

> > > 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.
>
> There's a way to put something in the .cabal file about extra data files,
> and have it install them in a certain location that you can then find
> programmatically.  I forget the details, but I think it's pretty easy to set

http://neilmitchell.blogspot.com/2008/02/adding-data-files-using-cabal.html

Thanks

Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Topkata

2008-06-14 Thread Brent Yorgey
On Sat, Jun 14, 2008 at 10:53 AM, Christoph Bauer <
[EMAIL PROTECTED]> wrote:

> 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.


There's a way to put something in the .cabal file about extra data files,
and have it install them in a certain location that you can then find
programmatically.  I forget the details, but I think it's pretty easy to set
up.  Maybe take a look through the Cabal documentation.  Or maybe Duncan
will jump in and explain. =)

-Brent
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Christoph Bauer
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Thomas 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!


Bob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: Topkata

2008-06-14 Thread Neil Mitchell
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Topkata

2008-06-14 Thread Christoph Bauer
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe