Re: [Haskell-cafe] The wheather is ⊥
It depends whether that's NaN ºC or NaN ºF. 2009/2/15 Fraser Wilson blancoli...@gmail.com: Is that really cold or really hot? On Sun, Feb 15, 2009 at 11:27 PM, Henk-Jan van Tuyl hjgt...@chello.nl wrote: The temperature is now NaN°: http://traviswalters.net/?p=58 -- Met vriendelijke groet, Henk-Jan van Tuyl -- http://functor.bamikanarie.com http://Van.Tuyl.eu/ -- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- http://thewhitelion.org/mysister ___ 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-cafe] Haskell and Java
+1 Due to the commercial environment I work in, there's really no chance of me using Haskell at work unless it runs under JVM or CLR. Brian, consider yourself nagged! And if there's anywhere you need some help, please yell. Neil On Fri, Sep 12, 2008 at 8:44 AM, John Goerzen [EMAIL PROTECTED] wrote: On Wed, Sep 10, 2008 at 05:35:20PM -0400, Brian Alliet wrote: On Wed, Sep 10, 2008 at 02:12:00PM +0200, Marc Weber wrote: There used to be. http://www.cs.rit.edu/~bja8464/lambdavm/ (Last darcs change log entry: Sun Oct 21 03:05:20 CEST 2007 Brian Alliet [EMAIL PROTECTED] * fix build for hsjava change ) Sorry about this. I hit a critical mass of darcs conflicts (I look forward to giving git a try) around the same time I got really busy at work. I've been meaning to get back into it (and update it to GHC HEAD) but I haven't received sufficient nagging yet. Please yell if you're interested in LambdaVM. At the very least I should be able to help get whatever is in darcs compiling. I for one would welcome the ability to compile Haskell programs into Java bytecode. One issue I have right now is the ability to get my code into the hands of a wide audience, since the Haskell toolchain is not widely installed by default. That and I tend to use a ton of Haskell modules, and there isn't a just install all the deps in ghc yet ;-) -- John ___ 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-cafe] Re: STM in F#
On 18 Jan 2008, at 09:01, apfelmus wrote: Don Stewart wrote: http://cs.hubfs.net/blogs/hell_is_other_languages/archive/2008/01/16/4565.aspx I imagine this can only ease the process of learning Haskell, and broaden the base of possible Haskellers, as more people on using .NET stuff become familiar with modern typed FP. There's a reason the STM monad hatched in Haskell: how does the above STM in F# handle side-effects like launchMissile ? It is presumably handled the same way that all such things are handled in non-pure or imperative languages... a dire warning in the documentation not to do this. - Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GUI
I have just successfully built Gtk2Hs against the native Mac OS X port of Gtk at: http://developer.imendio.com/projects/gtk-macosx This implies we can now use Gtk2Hs on the Mac without X11. The sample apps still look rather alien compared to normal Mac apps, but they are a big improvement over the X11 version. Regards, Neil On 12 Dec 2007, at 19:40, Miguel Mitrofanov wrote: Is there any really cross-platform GUI library for Haskell? Gtk2Hs is good (I suppose), but it requires X. OK, I have X, but it's not native on my Mac; some Mac users don't install it and almost all Mac users don't always run it. I was able to install wxHaskell (after some hacking - this was really painful); and Blobs editor compiled successfully, but then resisted to run. Tk-based libraries seem to be good, and Tk can be run natively on Mac (i.e., without X), but none of them seem to compile. Sorry if this message seems like I'm angry; I am, but that's only for a moment. ___ 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-cafe] ANN: Shu-thing 1.0 and Monadius 0.9
Hi Gwern, Shu-thing is great fun! I think Monadius isn't compiling because most of the source files are missing; you only have Main.hs in there. Regards Neil On 4 Dec 2007, at 01:53, [EMAIL PROTECTED] wrote: Hi everyone. With the permission of the authors, I'd like to announce the release upload to Hackage of two games written in Haskell (you may've seen them mentioned here once or twice before): *Monadius *Shu-thing They are both scrolling 2 dimensional arcade shooting games which use 3D vector graphics. Shu-thing is a fairly simpler upwards scrolling shooter with one level and geometric objects; Monadius is a sort of clone/homage to the classic arcade game Gradius, and I find it quite fun (although I have yet to beat it). You can find screenshots and original here: *http://www.geocities.jp/takascience/index_en.html#haskell The Hackage pages: *http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Monadius-0.9.20071203 *http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Shu-thing-1.0.20071203 -- They both have dependencies on GLUT, and it's definitely advisable to have 3D acceleration enabled on your system. I've only tested them with GHC 6.8.1 and up (where they work fine) on my Gentoo Linux box. You should be able to 'cabal install' Shu-thing, but Monadius doesn't compile successfully for reasons I don't understand. -- My changes to the programs in question are not terribly major - largely Cabalizing them, formatting and making stylistic changes, stomping most -Wall messages, and occasionally changing algorithms or attempting to optimize them. In the case of Monadius, I removed all the Windows-specific material (the audio files were apparently copyright violations, so no big loss) and improved storage of replay files. I'd like to thank Takayuki Muranushi for answering my questions about the code and giving permission to update them. I hereby release all my changes into the public domain. -- gwern ___ 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-cafe] Dynamic thread management?
multicore box ;-) It's my main show-stopper right now. Any clues on how to get access to one, eg via ssh? 32-core or higher would be favorite ;-) but I guess even just a 4-core or so is enough for proof-of-concept? I think you'll have plenty of work to be before you get to the stage of needing a box with more than 4 cores. Even a dual core machine is likely to be enough for initial experimentation, I would say. ... or build a minimal vm, enough to get 3 or 4 somewhat interesting algorithms / programs to run, and get automatic threading working on a couple of targets, eg on maps, and whatever [ x | x - somelist ] these things are called. (folds are a little harder from an implementation point of view, so can be a future upgrade). The other thing to consider is that there are several other VMs out there, including many under open source licenses, that can be used as a testbed. Examples include the Java VM, Mono, Parrot, LLVM, etc. Would you or Neil fancy being a mentor for this, if I can start to get somewhere on it? Not me! I'm not an academic... I've never had a paper published and I'm not likely to either. Regards Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Erlang VM in Haskell
Joel, This sounds like an extremely interesting (but very ambitious!) project, which I would like to get involved with if I have the time. However, wouldn't it be rather difficult, given that there doesn't seem to be a publicly available specification for the Erlang VM or the BEAM file format -- according to this email thread on the erlang-questions list: http://www.nabble.com/VM---BEAM-Specs-t4215515.html Perhaps it would be interesting to look at a slightly more constrained problem: can Erlang's message passing model (including distributed messaging across a network) and process monitoring facilities be replicated in Haskell? In other words, can we build OTP in Haskell? Regards, Neil On 8/16/07, Joel Reymont [EMAIL PROTECTED] wrote: Folks, I would like to write an Erlang VM in Haskell. I first thought of OCaml but Haskell has SMP and lazy evaluation may come in handy. Plus, I'll need help in this project like in no other and support from the Haskell community has always been outstanding. I'm doing this to learn more about the Erlang internals and to acquire some skills in the process. I'm also hoping to be at least as fast as the existing Erlang VM (written in C) and to be able to extend the VM in a functional language. With C you can implement a threaded VM using GCC labels or switch- style [1]. What is the most efficient approach in Haskell? I'm thinking using CPS and building up a chain of closures. Would this work well? Any other suggestions? The Haskell repo for the initial HEM (Haskell Erlang Machine) is at http://darcs.haskell.org/hem. A much improved HAW implementation will follow in the not so near future. Thanks, Joel [1] http://www.complang.tuwien.ac.at/forth/threaded-code.html -- http://wagerlabs.com ___ 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-cafe] Dynamic thread management?
Hugh, I certainly think it would be wrong to declare that NDP is doomed to failure... not because you would be making an enemy of SPJ (I'm pretty sure you wouldn't!) but because it actually aims to solves a less ambitious problem: the problem of parallelising the SAME task applied to different data, rather than a collection of arbitrary tasks. Because the task does not change, we know that e.g. taking half the data cuts the amount of work in half. Therefore an up-front scheduling approach can work. If you fast forward to about 42 minutes into the London HUG video, you see that Simon talks about the problem of parallelizing (f x) + (g y), and says that he spent quite a lot of time in the eighties trying to make this game go fast [..] and the result was pretty much abject failure. You're absolutely right that a dynamic/adaptive approach is the only one that will work when the tasks are of unknown size. Whether this approach is as easy as you think is open for you to prove. I look forward to testing your VM implementation, or at the very least reading your paper on the subject ;-) Regards, Neil On 8/11/07, Hugh Perkins [EMAIL PROTECTED] wrote: On 8/11/07, Thomas Conway [EMAIL PROTECTED] wrote: There are many papers about this in the Parallel Logic Programming area. It is commonly called Embarrassing Parallelism. Ah, I wasnt very precise ;-) I didnt mean I dont understand the problem; I meant I dont understand why people think it is difficult to solve ;-) (And then I tried to explain by examples why it is easy, but it is true that my communication sucks ;-) ) you'll only get a benefit if you can break xs into chunks of e.g. 10^3 elements or more, and more like 10^5 or more for more usual 'f's. Actually, the number of elements is irrelevant. The only measure that is important is how long the function is taking to execute, and whether it is parellizable. Example, the following only has 3 elements but will take a while to run: strPrtLn $ sum $ map getNumberPrimes [1024, 2048, 4096 ] The following has 10 million elements but runs quickly: strPrtLn $ sum $ map (+1) [1..1000 ] In the second, we start the function running, in a single thread, and after a second, the function has already finished, so great! Were done! In the first, we start the function running, in a single thread. After a second the function is still running, so we look at what is taking the time and whether it is parallelizable. Turns out the vm has been chugging away on the map for the last second, and that that maps are parallelizeable, so we split the map into Math.Min( numberelements, number cores) pieces, which on a 1024-core machine, given we have 3 elements, is Math.Min( 1024, 3 ), which is 3. So, we assign each of the 3 elements of the map to a thread. So, now we're using 3 of our 64 cores. A second later, each thread is still chugging away at its element, so we think, ok, maybe we can parallelize more, because we still have 61 threads/cores available, so now we look at the getNumberOfPrimes function itself, and continue the above type of analysis. This continues until all 64 cores have been assigned some work to do. Whenever a thread finishes, we look around for some work for it to do. If there is some, we assign it. If there isnt, we look around for an existing thread that is doing something parallelizeable, and split it into two pieces, giving one to the old thread, and one to the available thread. Not sure why this is perceived as difficult (added the word perceived this time ;-) ). I think the main barrier to understanding why it is easy is understanding that this needs to be done from a VM, at runtime. It is not possible to do it statically at compilation, but I really need to finish watching SPJ's video before declaring that SPJ's proposal is doomed to fail ;-) Not least, probably not good to make an enemy of SPJ ;-) ___ 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
[Haskell-cafe] ANN: London Haskell User Group
I am delighted to announce the first meeting of the London Haskell User Group on Wednesday 23rd May from 6:30PM. The meeting will be held at City University's main campus in central London, and Simon Peyton Jones will be coming to give a talk. Please see the announcement on the web page for more details and to register: http://www.londonhug.net/2007/04/26/announcement-first-meeting-of-the- london-haskell-user-group/ Many thanks to Simon, and to Ross Paterson at City University for organising the room. Regards, Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Tutorial on Haskell
Well, given that concurrency is a hot topic at the moment, how about something based on STM? E.g. perhaps some kind of instant messaging server? Or Twitter except scalable. By ruthlessly eliminating features, you could get the core of one of these down to something that could be built in three hours. But please, no Santa Clauses ;-) Neil Friends I have agreed to give a 3-hr tutorial on Haskell at the Open Source Convention 2007 http://conferences.oreillynet.com/os2007/ I'm quite excited about this: it is a great opportunity to expose Haskell to a bunch of smart folk, many of whom won't know much about Haskell. My guess is that they'll be Linux/Perl/Ruby types, and they'll be practitioners rather than pointy-headed academics. One possibility is to do a tutorial along the lines of here's how to reverse a list, here's what a type is etc; you know the kind of thing. But instead, I'd prefer to show them programs that they might consider *useful* rather than cute, and introduce the language along the way, as it were. So this message is to ask you for your advice. Many of you are exactly the kind of folk that come to OSCON --- except that you know Haskell. So help me out: Suggest concrete examples of programs that are * small * useful * demonstrate Haskell's power * preferably something that might be a bit tricky in another language For example, a possible unifying theme would be this: http://haskell.org/haskellwiki/Simple_unix_tools Another might be Don's cpu-scaling example http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 But there must be lots of others. For example, there are lots in the blog entries that Don collects for the Haskell Weekly Newsletter. But I'd like to use you as a filter: tell me your favourites, the examples you find compelling. (It doesn't have to be *your* program... a URL to a great blog entry is just fine.) Of course I'll give credit to the author. Remember, the goal is _not_ explain monads. It's Haskell is a great way to Get The Job Done. Thanks! Simon ___ 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-cafe] Lambada and connecting Haskell to a Weblogic server
Joel, Implementing Java RMI in Haskell sounds like a nightmare. Why not use HTTP? You could easily write a wrapper Servlet that speaks XML or JSON over HTTP, and deploy that to the Weblogic server. Unless you don't have permission to deploy anything to that server for whatever reason. Alternatively, how about AMQP ;-) Regards Neil On 11 Feb 2007, at 01:50, Joel Reymont wrote: Folks, Where can I find Lambada these days and would it be of any use to me in trying to connect to a Weblogic server? To make the long story short, my broker's Java software connects to a remote Weblogic server and I would like to do the same. I suppose this would require me to implement Java RMI in Haskell which is non- trivial. I wonder if it would be easier for me to implement a Java server that talks to Weblogic and then connect to that server. What do you think? Thanks, Joel -- http://wagerlabs.com/ ___ 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-cafe] Re: Channel9 Interview: Software Composability and theFu ture of Languages
The question is --- how would an expert describe such a process? Would a professional chef give instructions in the functional or imperative style? I think a sufficiently expert chef would not even need the functional style. Everything would be declarative. Dave Thomas (of Pragmatic Programmers fame) tells of finding his late grandmother's recipe cards, which she accumulated over her entire life. He was able to track their evolution from an extremely pedantic, imperative style, through to the almost Zen-like cards that read: Spice cake: like chocolate cake. No chocolate, add spice. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages
C# [..] has all the problems of language created by committee Whereas Haskell has all the benefits of a language created by committee! Actually, wasn't C# largely created by one man, Anders Hejlsberg? - Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages
No doubt many of you will have seen the interview[1] on Channel9 with Anders Hejlsberg, Herb Sutter, Erik Meijer and Brian Beckman. These are some of Microsoft's top language gurus, and they discuss the future evolution of programming languages. In particular they identify composability, concurrency and FP as being important trends. However their focus is on borrowing features of FP and bringing them into mainstream imperative languages; principally C#. Naturally the subject of Haskell comes up repeatedly throughout the interview. Disappointingly they characterize Haskell as being an impractical language, only useful for research. Erik Meijer at one point states that programming in Haskell is too hard and compares it to assembly programming! Yet the interviewees continually opine on the difficulty of creating higher level abstractions when you can never be sure that a particular block of imperative code is free of side effects. If there were ever a case of the answer staring somebody in the face... I found this interview fascinating but also exasperating. It's a real shame that no reference was made to STM in Haskell. I don't know why the interviewer doesn't even refer to the earlier Channel9 interview with Simon Peyton Jones and Tim Harris - it appears to be the same interviewer. Still, it's nice to see that ideas from Haskell specifically and FP generally are gaining more and more ground in the mainstream programming world. It also highlights some of the misconceptions that still exist and need to be challenged, e.g. the idea that Haskell is too hard or is impractical for real work. [1] http://channel9.msdn.com/Showpost.aspx?postid=273697 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Aim Of Haskell
I think this hits the nail on the head. To be blunt, the presence of so many academics and scientists in the Haskell community is intimidating to those of us that work in industry. Our brains are, after all, not as highly trained as yours, and we care about different things than you do. Now I don't mean to say that the academics and scientists should go away! Far from it. Just that it would be great to hear more about the mundane aspects of programming occasionally. Like, how exactly do I read from a relational database with Haskell? Or process an XML file? Or build an event-driven GUI? And crucially, why does Haskell do those things better than Java, or C#, or Ruby? If somebody could write some articles on those subjects, and get them up on popular websites like Digg or Reddit, this would be far more helpful than yet another monad tutorial. The Haskell web server that Simon Peyton-Jones et al described in their paper would be a great example. But where's the download? How do I get a copy to play with? In the real world, things don't stop with the publication of a paper ;-) I think Haskell has huge potential to improve mainstream programming, if it could only catch on a bit. I don't know how to make that happen, unfortunately (if I did, I would do it, and hopefully get rich in the process). But whatever Haskell needs, it's not getting at the moment. Neil Hello Kaveh, Sunday, December 10, 2006, 6:15:23 PM, you wrote: chosen one. But Haskell seems to be buzz-full research platform. Now again to the top : what is the aim of Haskell project? If it is going to be used in real world applications it needs more attention to real world application developers and their needs. you are right - just now Haskell is a huge technology with non-obvious path to learn. there is some work to make Haskell more pragmatic, but it's an chicken-and-egg problem - we have a small number of pragmatic programmers that use Haskell and therefore it's hard to change Haskell to suit their needs, on the other hand this means that pragmatic programmers can't grok Haskell on the way to make Haskell more pragmatic i especially mention renewal of Haskell standard to include modern language extensions, modern programming environments such as WinHugs or BusinessObjects, development of web/db/gui libraries, and definition of core (standard) libraries set one particular thing that we still lack is something like book Haskell in real world -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ 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
[Haskell-cafe] Compatibility between Data.ByteString.Base and Data.ByteString.Lazy
Hi, Firstly my apologies if this is an outrageously newbie question. I am trying to write a binary protocol parser using Data.ByteString. I have created a module ByteParser containing my parsing utilities, which imports ByteString as: import qualified Data.ByteString as B In my Main module, where all the IO happens, I want to use lazy ByteStrings so I ask for the following imports: import ByteParser import qualified Data.ByteString.Lazy as L The problem is that when I try to call a function in ByteParser with an L.ByteString, the compiler complains that: Couldn't match expected type `Data.ByteString.Base.ByteString' against inferred type `L.ByteString' Does this mean that the lazy version of ByteString is a completely separate, incompatible type from the base version? Obviously I can work around this problem by making ByteParser import Data.ByteString.Lazy instead of Data.ByteString, but then ByteParser would not be able to work with strict ByteStrings. Ideally I would like ByteParser to be agnostic about the use of lazy versus strict ByteStrings. Is this a sensible and/or possible thing to do? Many thanks, Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe