
hello, im interested in using haskell to generate code and make little AI applications for fun.. is anyone already doing this sort of thing? it would be fun to collaborate with people on this. Here's some code as an example of the direction i'd like to go in. It builds up template haskell Exps and uses the Hint module to typecheck them. With some more work, it could be turned into a program that finds haskell programs (given a type as input).. http://www.sendspace.com/file/aj5r38 __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

zghost123:
hello, im interested in using haskell to generate code and make little AI applications for fun..
is anyone already doing this sort of thing? it would be fun to collaborate with people on this.
Lots of people are generating code from Haskell. Some useful libraries to look at: Language.C http://hackage.haskell.org/cgi-bin/hackage-scripts/package/language-c Language.X86ASM http://hackage.haskell.org/cgi-bin/hackage-scripts/package/harpy Language.JavaScript http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HJavaScript http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HJScript http://hackage.haskell.org/cgi-bin/hackage-scripts/package/WebBits Language.Parrot http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HsParrot Language.Haskell http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskell-src

2008/10/20 z ghost
hello, im interested in using haskell to generate code and make little AI applications for fun..
is anyone already doing this sort of thing? it would be fun to collaborate with people on this.
I've been doing some work with Haskell code-generation in Haskell, but I've been using the haskell-src package to do it instead of Template Haskell, as I've been generating whole modules at a time. I have a bunch of convenience functions that I use over here: http://community.haskell.org/~aslatter/code/xhb/HaskellCombinators.hs It doesn't have a very consistent API, though. Let me know if you have any questions about it. -Antoine

Thanks for that! I don't know yet what would be the easiest way
to automatically build up haskell code (Template haskell's Exps or
the HsDecls in your link).
Generating is only a part of what i need, though. I would like some
feedback from GHC about the generated code (to see if the expressions typecheck, ..)
I've been using the Hint package (which calls GHC) to typecheck
strings http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hint
I've only managed to get it half working. Have you tried this and
would this be the best approach?
It would be great to get machine-readable error data back from GHC somehow (in stead of an error string). I don't if this is possible.
--- On Tue, 10/21/08, Antoine Latter
hello, im interested in using haskell to generate code and make little AI applications for fun..
is anyone already doing this sort of thing? it would be fun to collaborate with people on this.
I've been doing some work with Haskell code-generation in Haskell, but I've been using the haskell-src package to do it instead of Template Haskell, as I've been generating whole modules at a time. I have a bunch of convenience functions that I use over here: http://community.haskell.org/~aslatter/code/xhb/HaskellCombinators.hs It doesn't have a very consistent API, though. Let me know if you have any questions about it. -Antoine __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

you can also write an interpreter in haskell that will typecheck using GADT's http://www.informatik.uni-bonn.de/~ralf/publications/With.pdf http://www.haskell.org/pipermail/haskell/2005-May/015815.html
participants (4)
-
Anatoly Yakovenko
-
Antoine Latter
-
Don Stewart
-
z ghost