Re: data kinds

2013-01-27 Thread Erik Hesselink

 When we discussed this last time (summarized by the link Pedro sent, I
 think) it came up that it might be nice to also
 have kind synonyms, which would be analogous to type synonyms, but one
 level up.   The natural syntax for that would be to have a type kind
 declaration, but this seems a bit confusing...


 What about just 'kind'? It's symmetric with 'type'.

Erik
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Error building ghc on raspberry pi.

2013-01-27 Thread roconnor

On Mon, 21 Jan 2013, rocon...@theorem.ca wrote:


On Mon, 21 Jan 2013, Karel Gardas wrote:


On 01/21/13 12:49 AM, rocon...@theorem.ca wrote:

On Sun, 20 Jan 2013, Karel Gardas wrote:


Okay, I patched the settings filed generted by ./configure in the
binary-dist and rank make install which completed. However,

pi@raspberrypi /tmp/bindist $ bin/ghc --make Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
pi@raspberrypi /tmp/bindist $ ./Main
Segmentation fault
pi@raspberrypi /tmp/bindist $ cat Main.hs
main = putStrLn Hello World.

Damn it. So close. I don't know how make install succeded without
segfaulting.


Sigh! Go back to your build tree and try the same thing with
inplace/bin/ghc-stage2 and let us know if this works or not. BTW:
What's in Main.hs?


pi@raspberrypi /tmp $ ghc-7.6.1c/inplace/bin/ghc-stage2 Main.hs
[1 of 1] Compiling Main ( Main.hs, Main.o )
Linking Main ...
pi@raspberrypi /tmp $ ./Main
Hello World.

The stage2 compiler works fine inplace.


OK, so binary-dist not only corrupted your settings file, but also somehow 
your compiler. Nice to see you are able to get working compiler on your RPi 
board. Congratulations! :-)


Thanks. :)

So the binary-dist has a settings.in file.  It is the configure step in the 
binary-dist that generates the corrupt settings file.


I'll try to poke around to see where and why the stage2 compiler and the 
binary-dist compiler differ.


I replaced the lib/ghc-7.6.1/settings built from the binary-dist which 
read:


[(GCC extra via C opts,  -fwrapv),
 (C compiler command, /usr/bin/gcc),
 (C compiler flags,  -fno-stack-protector ),
 (ar command, /usr/bin/ar),
 (ar flags, q),
 (ar supports at file, @ArSupportsAtFile@),
 (touch command, touch),
 (dllwrap command, /bin/false),
 (windres command, /bin/false),
 (perl command, /usr/bin/perl),
 (target os, OSLinux),
 (target arch, ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = 
HARD}),
 (target word size, 4),
 (target has GNU nonexec stack, False),
 (target has .ident directive, True),
 (target has subsections via symbols, False),
 (LLVM llc command, llc),
 (LLVM opt command, opt)
 ]

With the settings file from the build:

[(GCC extra via C opts,  -fwrapv),
 (C compiler command, /usr/bin/gcc),
 (C compiler flags,  -fno-stack-protector  -Wl,--hash-size=31 
-Wl,--reduce-memory-overheads),
 (ar command, /usr/bin/ar),
 (ar flags, q),
 (ar supports at file, YES),
 (touch command, touch),
 (dllwrap command, /bin/false),
 (windres command, /bin/false),
 (perl command, /usr/bin/perl),
 (target os, OSLinux),
 (target arch, ArchARM {armISA = ARMv6, armISAExt = [VFPv2], armABI = 
HARD}),
 (target word size, 4),
 (target has GNU nonexec stack, False),
 (target has .ident directive, True),
 (target has subsections via symbols, False),
 (LLVM llc command, /usr/bin/llc-3.0),
 (LLVM opt command, /usr/bin/opt-3.0)
 ]

and now ghc builds executables that do not segfault!

It seem that the configure program in the binary-dist needs some patching.

--
Russell O'Connor  http://r6.ca/
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


How to get started with a new backend?

2013-01-27 Thread Jason Dagit
I would like to explore making a backend for .NET. I've done a lot of
background reading about previous .NET and JVM attempts for Haskell. It
seems like several folks have made significant progress in the past and,
with the exception of UHC, I can't find any code around the internet from
the previous efforts. I realize that in total it's a huge undertaking and
codegen is only one of several significant hurdles to success.

I would like to get a very, very, very simple translation working inside
GHC. If all I can compile and run is fibonacci, then I would be quite
happy. For my first attempt, proof of concept is sufficient.

I found a lot of good documentation on the ghc trac for how the compilation
phases work and what happens in the different parts of the backend. The
documentation is excellent, especially compared to other compilers I've
looked at.

When I started looking at how to write the code, I started to wonder about
the least effort path to getting something (anything?) working. Here are
some questions:
  * Haskell.NET seems to be dead. Does anyone know where their code went?
  * Did lambdavm also disappear? (JVM I know, but close enough to be useful)
  * Would it make sense to copymodify the -fvia-C backend to generate C#?
The trac claims that ghc can compile itself to C so that only standard gnu
C tools are needed to build an unregistered compiler. Could I use this
trick to translate programs to C#?
  * What stage in the pipeline should I translate from? Core? STG? Cmm?
  * Which directories/source files should I look at to get familiar with
the code gen? I've heard the LLVM codegen is relatively simple.
  * Any other advice?

Thank you in advance!
Jason
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to get started with a new backend?

2013-01-27 Thread Christopher Done
 The trac claims that ghc can compile itself to C so that only standard gnu C 
 tools are needed to build an unregistered compiler.

Wait, it can? Where's that?

On 28 January 2013 02:15, Jason Dagit dag...@gmail.com wrote:
 I would like to explore making a backend for .NET. I've done a lot of
 background reading about previous .NET and JVM attempts for Haskell. It
 seems like several folks have made significant progress in the past and,
 with the exception of UHC, I can't find any code around the internet from
 the previous efforts. I realize that in total it's a huge undertaking and
 codegen is only one of several significant hurdles to success.

 I would like to get a very, very, very simple translation working inside
 GHC. If all I can compile and run is fibonacci, then I would be quite happy.
 For my first attempt, proof of concept is sufficient.

 I found a lot of good documentation on the ghc trac for how the compilation
 phases work and what happens in the different parts of the backend. The
 documentation is excellent, especially compared to other compilers I've
 looked at.

 When I started looking at how to write the code, I started to wonder about
 the least effort path to getting something (anything?) working. Here are
 some questions:
   * Haskell.NET seems to be dead. Does anyone know where their code went?
   * Did lambdavm also disappear? (JVM I know, but close enough to be useful)
   * Would it make sense to copymodify the -fvia-C backend to generate C#?
 The trac claims that ghc can compile itself to C so that only standard gnu C
 tools are needed to build an unregistered compiler. Could I use this trick
 to translate programs to C#?
   * What stage in the pipeline should I translate from? Core? STG? Cmm?
   * Which directories/source files should I look at to get familiar with the
 code gen? I've heard the LLVM codegen is relatively simple.
   * Any other advice?

 Thank you in advance!
 Jason

 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Request for review of a GADT tutorial draft

2013-01-27 Thread Anton Dergunov
Dear Haskell community,

I have recently written an introductory-level tutorial article about
GADTs in GHC (inspired by LASER 2012 summer school and to be submitted
to their proceedings).

I have already send this draft to the Haskell Cafe mailing list, but
I was also advised to use these mailing lists, so I would like to ask
for your feedback:
http://anton-dergunov.ru/publications/gadts_draft_v4.pdf

Any opinion about this article and any suggestions are very welcome!

-- 
Best Regards,
Anton Dergunov

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: How to get started with a new backend?

2013-01-27 Thread David Terei
I believe that some Microsoft Research folks at Cambridge got a fairly
far along implementation of Haskell on Java or .NET many years back
but concluded it wasn't a good fit. My rusty memory of a conversation
with Simon Marlow about this was that all the Java libraries basically
ended up in IO and matching the API and type design up with Haskell
wasn't very nice.

Not sure what the motivation is, but you may want to look at VMKit:
http://vmkit.llvm.org/. It could be a good fit and may be easy to use
through the LLVM backend.

On 27 January 2013 17:15, Jason Dagit dag...@gmail.com wrote:
 I would like to explore making a backend for .NET. I've done a lot of
 background reading about previous .NET and JVM attempts for Haskell. It
 seems like several folks have made significant progress in the past and,
 with the exception of UHC, I can't find any code around the internet from
 the previous efforts. I realize that in total it's a huge undertaking and
 codegen is only one of several significant hurdles to success.

 I would like to get a very, very, very simple translation working inside
 GHC. If all I can compile and run is fibonacci, then I would be quite happy.
 For my first attempt, proof of concept is sufficient.

 I found a lot of good documentation on the ghc trac for how the compilation
 phases work and what happens in the different parts of the backend. The
 documentation is excellent, especially compared to other compilers I've
 looked at.

 When I started looking at how to write the code, I started to wonder about
 the least effort path to getting something (anything?) working. Here are
 some questions:
   * Haskell.NET seems to be dead. Does anyone know where their code went?
   * Did lambdavm also disappear? (JVM I know, but close enough to be useful)
   * Would it make sense to copymodify the -fvia-C backend to generate C#?
 The trac claims that ghc can compile itself to C so that only standard gnu C
 tools are needed to build an unregistered compiler. Could I use this trick
 to translate programs to C#?
   * What stage in the pipeline should I translate from? Core? STG? Cmm?
   * Which directories/source files should I look at to get familiar with the
 code gen? I've heard the LLVM codegen is relatively simple.
   * Any other advice?

 Thank you in advance!
 Jason

 ___
 Glasgow-haskell-users mailing list
 Glasgow-haskell-users@haskell.org
 http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users