[Haskell-cafe] Announcing AusHac 2011 - The second annual Australian Haskell Hackathon (July 8-10)
Attention all Australasian Haskellers! After last year’s fantastic turnout for the first Australian Haskell Hackathon - AusHac 2010 - we’ve decided to organise another. As it’s rather boring to have a Hackathon with only two people, we encourage and welcome anyone interested in Haskell in Australia, New Zealand and surrounding areas (or further afield if you want!) to come and join us. Last year we had more than 25 Haskellers come from Brisbane, Canberra, Melbourne, Sydney and even two from as far away as New Zealand. AusHac 2011 will be held from Friday July 8th until Sunday July 10th, again at UNSW’s Computer Science building in Sydney. There’s no need to come for the entire weekend, just for whenever you’re able to. Last year, people worked on several projects including: • Accelerate: a high performance library for array computations using various backends (CUDA, LLVM, etc.) being written at UNSW. • Leksah: the Haskell IDE written in Haskell • DDC: the compiler for the Haskell-like language Disciple, which has strict evaluation by default, region, effect and closure typing and other interesting language features. • Hubris: the Haskell/Ruby bridge for calling Haskell from Ruby and vice-versa. • haskell-mpi: bindings to MPI, the message passing interface used frequently on high performance super-computers to allow programs to run on many nodes in parallel with easy communication. • There was even some work on LLVM to produce HTML output showing register allocations (as an aid to those writing new code generators etc.), which has now been included upstream. This work did not use Haskell, but it did happen at AusHac 2010. • And much more! This is a great chance to collaborate with others and get feedback on your work, while having heaps of fun and meeting other Haskellers, to verify they do actually exist! And don’t worry if you can’t think of a project to work on; just come along and pitch in with whatever strikes your fancy! If you’re interested in coming and have a project you’d like to work on, check out the wikipage http://www.haskell.org/haskellwiki/AusHac2011 where you can add your project ideas, or just take a look and see what others will be working on that you can help out with. People of all skill levels are welcome, from complete beginners to Oleg-level sage masters. We’re more than happy to help you learn Haskell if you’re just starting out or help you solve that little niggly bit in your code. If you’re interested in coming along, fill out our registration form http://axman6.wufoo.com/forms/aushac-2011-sign-up/. Registration is required so we know numbers and for you to get access to the university Wifi. Even if you’re not sure, fill it in to express your interest, obligation free. We’d rather know we have room for too many people than not enough. So come along! And if for some reason you don’t enjoy yourself, registration comes with a money-back guarantee! Hope to see you there, -- Alex Mason and Ivan Miljenovic, AusHac organisers P.S: If you have received this email directly, it is because you have shown previous interest in AusHac by signing up via the previous signup. If you do not wish to receive any more email regarding AusHac, please email me (axm...@gmail.com) and I'll be sure to take you off the list of interested people. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell Platform 2011.2.0.1 now available
Hi, Am Samstag, den 16.04.2011, 11:17 -0700 schrieb Don Stewart: On Fri, Apr 15, 2011 at 11:50 PM, Joachim Breitner nome...@debian.org wrote: Am Freitag, den 15.04.2011, 15:44 -0700 schrieb Don Stewart: We're pleased to announce the 2011.2.0.1 release of the Haskell Platform: a single, standard Haskell distribution for everyone. Download the Haskell Platform 2011.2.0.1: http://haskell.org/platform/ or use Debian unstable, which ships this version of the platform since five days already: http://people.debian.org/~nomeata/platform.html Good work! Is the link to Debian on the http://haskell.org/platform homepage correct? yes, that is an appropriate link. * We only ship it already because the file on http://code.galois.com/darcs/haskell-platform/haskell-platform.cabal has already changed earlier, which was linked by http://hackage.haskell.org/platform/changelog.html so we thought this is already official and released and we just missed the announcement. Do you watch the haskell-platf...@projects.haskell.org mailing list? There we announced the freeze, and the initial release candidates. I was hoping that -cafe is enough, but I guess I don’t get around. Subscribed. Greetings, Joachim -- Joachim nomeata Breitner Debian Developer nome...@debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C JID: nome...@joachim-breitner.de | http://people.debian.org/~nomeata signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] http://trac.haskell.org/ not redering correctly
Hi all, Trac pages aren't rendering correctly. It seems the HTTP server can't find the CSS files. See below. Cheers, Erik erikd wget --proxy=off http://trac.haskell.org/trac/chrome/common/css/ticket.css -O /dev/null --2011-04-17 20:11:53-- http://trac.haskell.org/trac/chrome/common/css/ticket.css Resolving trac.haskell.org... 178.63.91.44, 2a01:4f8:121:6::1:10 Connecting to trac.haskell.org|178.63.91.44|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2011-04-17 20:11:56 ERROR 404: Not Found. erikd wget --proxy=off http://trac.haskell.org/trac/chrome/common/css/trac.css -O /dev/null --2011-04-17 20:28:36-- http://trac.haskell.org/trac/chrome/common/css/trac.css Resolving trac.haskell.org... 178.63.91.44, 2a01:4f8:121:6::1:10 Connecting to trac.haskell.org|178.63.91.44|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2011-04-17 20:28:40 ERROR 404: Not Found. -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Template Haskell question
I'm interested if it's possible to use functions from some module without explicitly importing it. In ghci it's done on the fly, like this: Prelude Data.Map.empty Loading package array-0.3.0.2 ... linking ... done. Loading package containers-0.4.0.0 ... linking ... done. fromList [] But without gchi it seems impossible. I have the file Test.hs: {-# LANGUAGE TemplateHaskell #-} module Test where import Language.Haskell.TH x :: ExpQ x = global $ mkName Data.Map.empty When I load it in ghci, all works: $ ghci -XTemplateHaskell Test.hs *Test $x Loading package pretty-1.0.1.2 ... linking ... done. Loading package array-0.3.0.2 ... linking ... done. Loading package containers-0.4.0.0 ... linking ... done. Loading package template-haskell ... linking ... done. fromList [] But when I try to use it from other module, it fails. File Main.hs: {-# LANGUAGE TemplateHaskell #-} module Main where import Test main = do print $x $ runhaskell Main.hs Main.hs:5:9: Not in scope: `Data.Map.empty' In the result of the splice: $x To see what the splice expanded to, use -ddump-splices In the first argument of `print', namely `$x' In the expression: print ($x) -- All the best, Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Killing threads in foreign calls.
I am building an application that uses Postgres for storage. If a query runs too long, I would like to kill the querying thread, releasing its lock on the connection; if the connection is a in a bad state -- for example, busy -- I would like to clean up the connection. Unfortunately, killing calls in to libpq seems not to work. I have put a minimal example on hpaste: http://hpaste.org/45774/minimal_pg_contention_example If you install libpq with Cabal, you can run it. In the example, the main thread spawns a worker thread that queries Postgres, running SELECT pg_sleep(10);; the main thread waits half a second and then tries to kill the worker. Unfortunately, the worker always manages to get as far as printing complete. In the code, I call `Database.PQ.exec': http://hackage.haskell.org/packages/archive/libpq/0.4.1/doc/html/src/Database-PQ.html#exec This in turn calls a `safe' binding, `c_PQexec', to `PQexec' in the C library: http://hackage.haskell.org/packages/archive/libpq/0.4.1/doc/html/src/Database-PQ.html#line- There are async interfaces, too; they do not seem to be any more killable then the sync ones. Maybe the problem is that you can't kill a thread while it's in a foreign call? I do not see any documentation to this effect; but I may have missed it. -- Jason Dusek () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Killing threads in foreign calls.
This is a fairly nontrivial problem. First off, let me tell you what you do not /actually/ want to happen: you don't want the OS level thread performing the foreign call to actually be killed; most C code is not written a way that can gracefully recover from this, and unless you have explicit indications from the Postgres library that it use pthread_setcancelstate (and you, of course, have the cross-platform issue.) You need some way of making the Postgres call return early, with an error code of some sort. If Postgres has a signal handler that does this, you can use something along the lines of here: http://blog.ezyang.com/2010/11/its-just-a-longjmp-to-the-left/ If the asynchronous API has the ability to cancel a query given some handler, you instead want to set up a custom kill thread function that checks if a thread has an active query and then performs another FFI call to perform that cancellation. If the library doesn't have a way of doing graceful cancellation, you're kind of out of luck. Unfortunately there is no golden touch for making this work. Cheers, Edward Excerpts from Jason Dusek's message of Sun Apr 17 15:31:11 -0400 2011: I am building an application that uses Postgres for storage. If a query runs too long, I would like to kill the querying thread, releasing its lock on the connection; if the connection is a in a bad state -- for example, busy -- I would like to clean up the connection. Unfortunately, killing calls in to libpq seems not to work. I have put a minimal example on hpaste: http://hpaste.org/45774/minimal_pg_contention_example If you install libpq with Cabal, you can run it. In the example, the main thread spawns a worker thread that queries Postgres, running SELECT pg_sleep(10);; the main thread waits half a second and then tries to kill the worker. Unfortunately, the worker always manages to get as far as printing complete. In the code, I call `Database.PQ.exec': http://hackage.haskell.org/packages/archive/libpq/0.4.1/doc/html/src/Database-PQ.html#exec This in turn calls a `safe' binding, `c_PQexec', to `PQexec' in the C library: http://hackage.haskell.org/packages/archive/libpq/0.4.1/doc/html/src/Database-PQ.html#line- There are async interfaces, too; they do not seem to be any more killable then the sync ones. Maybe the problem is that you can't kill a thread while it's in a foreign call? I do not see any documentation to this effect; but I may have missed it. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Killing threads in foreign calls.
On Sun, Apr 17, 2011 at 20:26, Edward Z. Yang ezy...@mit.edu wrote: This is a fairly nontrivial problem. First off, let me tell you what you do not /actually/ want to happen: you don't want the OS level thread performing the foreign call to actually be killed... From this I gather, one can not generally kill Haskell threads while they are in the midst of foreign calls. I guess interrupting execution to terminate the program is special since you don't expect anything to work properly afterward. If the asynchronous API has the ability to cancel a query given some handler, you instead want to set up a custom kill thread function that checks if a thread has an active query and then performs another FFI call to perform that cancellation. It turns out the PGcancel exists for this purpose. Is it safe and reasonable to make query cancellation a ThreadKilled handler in the query thread? I gather I need to write the busy loop for polling for data in Haskell. Although libpq has a procedure -- PGgetResult -- that polls for data, it would not respond to killThread. -- Jason Dusek () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Oddness with binary-0.5.0.2 user install
Hello folks, The docs for binary-0.5.0.2 on Hackage claim that their is a Binary instance for lazy ByteStrings, but there does not seem to be such an instance in my local install of binary-0.5.0.2. In addition, the docs on Hackage claim that there is an Applicative instance for the 'Get' type, which my install is also lacking. I've verified this in ghci and by looking at my own locally generated haddocks. The module structure for the 'binary' package is pretty straightforward - so I don't think I'm missing any imports in ghci. Has anyone seen this before? Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Oddness with binary-0.5.0.2 user install
On Sun, Apr 17, 2011 at 7:48 PM, Antoine Latter aslat...@gmail.com wrote: Hello folks, The docs for binary-0.5.0.2 on Hackage claim that their is a Binary instance for lazy ByteStrings, but there does not seem to be such an instance in my local install of binary-0.5.0.2. In addition, the docs on Hackage claim that there is an Applicative instance for the 'Get' type, which my install is also lacking. I've verified this in ghci and by looking at my own locally generated haddocks. The module structure for the 'binary' package is pretty straightforward - so I don't think I'm missing any imports in ghci. Has anyone seen this before? Antoine So I just did a cabal install binary --reinstall and it only broke two packages and also fixed the issue. The Applicative instance was guarded by some ifdefs, but I didn't see anything similar for the lazy bytestring instance. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] import functionality in DSLs
On 4/16/11 9:55 AM, Felipe Almeida Lessa wrote: On Sat, Apr 16, 2011 at 10:29 AM, Nikhil A. Patil patil.nik...@gmail.com wrote: doit :: DSL Term doit = do (+)- (+) n0- n0 k- k -- begin beautiful DSL code let x = k + n0 return $ x + x I guess the core problem is that on each time you say '(+)- (+)', you may actually get something different depending on what 'define_function' does. You say yourself that these functions change a hidden state. So, without any internal changes, I doubt you could do something better. That really depends. For example, first assume we've hoisted things out: module DSLPrelude where import qualified Prelude (+) = define_function (Prelude.+) 2 ... Now, rather than having the define_* functions perform side effects themselves, instead we could have the generated (+) register itself in the state the first time it's called in each DSL, assuming the DSL has (or can have) a way to keep a log of which things it has used (i.e., could run when executed). This also has the benefit that the DSL can prune out definitions that are unused, and collapse any duplicate definitions it detects. Of course, the downside is that it means (+) is monadic now, which may get in the way of your beautiful DSL code. Whether it's worth it or not depends on what the DSL is for. If it's pseudo-assembly, then it should be fine; if it aims to be more of a high-level mathematical notation, then not so much. Though Luke's -XRecordWildCards approach was my first thought. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Template Haskell question
Hello, assuming you mean avoiding the import of Data.Map in the module *using* x, you can use name quotations: A.hs: {-# LANGUAGE TemplateHaskell #-} module A where import Data.Map import Language.Haskell.TH x = varE 'empty B.hs: {-# LANGUAGE TemplateHaskell #-} module B where import A a = $x empty = -- No collision; the 'empty in A.hs becomes a fully qualified -- name according to what's in scope in A.hs, so 'a' has type -- Map k a To avoid the import in A.hs too: module A where import Language.Haskell.TH import Language.Haskell.TH.Syntax(mkNameG_v) x = varE (mkNameG_v containers-0.4.0.0 Data.Map empty) By the way, 'global' currently is a synonym for 'varE'; I guess it used to be something different and remains for backwards compatibility. Cheers, Daniel On 2011-April-17 Sunday 18:42:15 Alexey Karakulov wrote: I'm interested if it's possible to use functions from some module without explicitly importing it. In ghci it's done on the fly, like this: Prelude Data.Map.empty Loading package array-0.3.0.2 ... linking ... done. Loading package containers-0.4.0.0 ... linking ... done. fromList [] But without gchi it seems impossible. I have the file Test.hs: {-# LANGUAGE TemplateHaskell #-} module Test where import Language.Haskell.TH x :: ExpQ x = global $ mkName Data.Map.empty When I load it in ghci, all works: $ ghci -XTemplateHaskell Test.hs *Test $x Loading package pretty-1.0.1.2 ... linking ... done. Loading package array-0.3.0.2 ... linking ... done. Loading package containers-0.4.0.0 ... linking ... done. Loading package template-haskell ... linking ... done. fromList [] But when I try to use it from other module, it fails. File Main.hs: {-# LANGUAGE TemplateHaskell #-} module Main where import Test main = do print $x $ runhaskell Main.hs Main.hs:5:9: Not in scope: `Data.Map.empty' In the result of the splice: $x To see what the splice expanded to, use -ddump-splices In the first argument of `print', namely `$x' In the expression: print ($x) -- All the best, Alexey ___ 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