re: Biggest Haskell unit in the world

If any of you antipodeans feel like sharing tales of Haskellisation, I can guarantee you an eager audience of at least 1. Cheers, --Ham
Hi folks, What follows is just my own view of the situation, other people from this department may think differently: At Melbourne we moved from Miranda to Haskell about 2 years ago. I think Miranda replaced Pascal as the first language taught to students, but that was a long time ago and I wasn't here at the time. Miranda was very successful as a first language. However, it suffered from some problems which ultimately led us to look for a replacement: - it was a bit of a toy language, and didn't scale well to use in later year subjects. - it wasn't open, which made it difficult for students to use at home. - it was being overtaken by languages like Haskell in the research community We considered a few languages to replace Miranda. Haskell was the most obvious candidate. One of the main reasons for choosing Haskell was the quality of Hugs. Having such a large body of students really requires that they be able to do a lot of their work at home. Without Hugs, I dare say we would have been looking more seriously at other languages. The transfer from Miranda to Haskell was quite straightforward. Training staff was not a big problem. Type classes and monadic programming being the only tricky topics for people with Miranda experience. You can find our paper on "Haskell for Miranda Programmers" on http://www.haskell.org/bookshelf/ We still tend to teach the Miranda "subset" of Haskell, which is a bit of a pity. It is the overall intention of our first subject to introduce problem solving and algorithms to students. In some ways the language is a secondary issue, however, we believe that functional languages are a good setting for this. The use of Haskell is filtering up through the later-year subjects, as both staff and students become more comfortable with it. I think that many of our students do not appreciate some of the strong features of declarative programming until third or fourth year when they are faced with larger (more difficult) programming tasks. There is still a conception amongst some of the students that FP is not really part of "Real World" programming, and that it is merely of interest to academics. We try hard to refute this notion. Regards, Bernie.

At 12:32 PM 6/26/2001 +1000, Bernard James POPE wrote: Disclaimer: Sounds like I'm the gloomy guy writing on this list. Don't let that deceive you: I'm actually a happy guy. And excited about Haskell, even if it doesn't sound that way. Really. :-)
I think that many of our students do not appreciate some of the strong features of declarative programming until third or fourth year when they are faced with larger (more difficult) programming tasks.
There is still a conception amongst some of the students that FP is not really part of "Real World" programming, and that it is merely of interest to academics. We try hard to refute this notion.
And it's a good quest. I see three problems that prevent me from seeing Haskell as a "Real World" language. First, compiler support. Yes, if I'm not mistaken, there are several current compilers (4) and interpreters (2) out there, but they all have serious problems in terms of efficiency (of the compiler itself and of the code generated) and logistics (getting compilers to install and work properly, file management, etc...). Hugs is the only one that seems solid enough in most fronts, but it's IMHO only usable for small programs and for testing. GHC... well, I'm still struggling with my own personal quest to get a binary of the latest version to work for my platform (Windows). Second, debugging tools. So far, I haven't been able to figure out why my program (a parser for C++ comments and strings) generates stack overflows. Nothing I've been able to think up has been of any help. Neither has the suggestions I got from the mailing list. GHC is supposed to have nice profiling utilities but it won't work in my installation no matter what I try (the program crashes), and, in any case, I haven't seen in the documentation any stack-debugging options. Third, it lacks expressiveness. I know it's all meant to make it a simple and robust language, but still, to make "Real World" applications you have to care more for what the programmer needs than what the language needs. A certain amount of controlled and documented ambiguity is a good thing if it enhances the possibilities for the programmer. A parallel meta-language, even a limited one, would be even better. Better scoping wouldn't hurt either (after C++, I just cannot live without those nifty nested namespaces). And explicit performance-tuning constructs would be a blessing, rather than having to hack them in in some indirect way (i.e. the "force" function for monadic parsers, etc...). Then again, my college background is in Telecommunications Engineering, not CS, and my programming background, although extensive, went through the Assembler->Pascal->C->College->C++ route, so my FP background is indeed limited, and therefore I might "still" be missing some points here. The FP way of thinking has hit hard on me, though. I just coded a bunch of parametric functional parsers in C++ using template metaprogramming (similar to the Haskell monadic parsers, but of course non-monadic). Faster than light, and uglier than sin, but it does work indeed. So, now I repeat my plea for help. At this point, I don't care much if I don't get the program to work. But I _NEED_ to know what was wrong. Maybe one of you teachers might want to use the program as an exercise in diagnosing a program for the students? I can send it in a pinch: it's just 9K. Salutaciones, JCAB --------------------------------------------------------------------- Juan Carlos "JCAB" Arevalo Baeza | http://www.roningames.com Senior Technology Engineer | mailto:jcab@roningames.com Ronin Entertainment | ICQ: 101728263 (my opinions are only mine) JCAB's Rumblings is so off-line O:-(

Juan Carlos Arevalo Baeza
And it's a good quest. I see three problems that prevent me from seeing Haskell as a "Real World" language.
First, compiler support. Second, debugging tools.
I agree these could be much better (though I don't think people really whacked on your code with their debugging tools). Unfortunately, research groups (the people who develop the compilers) don't have the resources to both do research and push hard enough on portability, ease of installation, documentation, etc. It'd be great to have people whose full time job was to tie up all the loose ends in the tools (portability, error messages, documentation, etc., etc.), help people use the tools effectively, develop cool libraries, provide consulting services, etc. In other words, it'd be nice to have a Cygnus-like company to support Haskell developers the way Cygnus supports C/C++ developers. Is there a market out there that would make a Cygnus-like company viable? (There are definitely skilled people who would like to form such a company.)
Third, it lacks expressiveness. I know it's all meant to make it a simple and robust language, but still, to make "Real World" applications you have to care more for what the programmer needs than what the language needs. A certain amount of controlled and documented ambiguity is a good thing if it enhances the possibilities for the programmer.
Can you give some examples of what you mean? [I felt our semantics for exception handling had all the ambiguity you could ever want in a language and then some :-)]
A parallel meta-language, even a limited one, would be even better.
If you mean "parallel" as in multi-processor? The work of Hans-Wolfgang Loidl, Kevin Hammond, Phil Trinder, SimonPJ and others on separating "algorithms" from "strategies" seems to be just what you're asking for.
Better scoping wouldn't hurt either (after C++, I just cannot live without those nifty nested namespaces).
Haskell has had qualified names (roughly corresponding to C++'s foo::bar) for a while now. When is this not enough? (I'm curious about the answer, not just trying to flip you off.) btw Java-style hierarchial module names are coming to Haskell (implemented in GHC, NHC and Hugs). See the libraries mailing list for some details.
And explicit performance-tuning constructs would be a blessing, rather than having to hack them in in some indirect way (i.e. the "force" function for monadic parsers, etc...).
The force function is very, very domain specific. It doesn't even make sense to talk about it if you're not talking about parser combinators (maybe only monadic parser combinators). So the best thing to do is to use a well-tuned parser library (or a parser generator) and let the implementor worry about it. Apart from providing good libraries and a nurturing environment in which those libraries can live (see libraries mailing list), there's really not much that the language can do. That said though, it'd be great to be able to add strictness annotations to functions and to be able to use unpointed types (like GHC's Int#). Anyone who has looked at the ugly hacks I added to Hugs' Pretty library (to overcome Hugs' lack of Int#) will see just what I mean. [To be more precise, what I want is that values of type Int# should be strictly evaluated (like Int# in GHC) - I don't care whether Int# is boxed or unboxed (a representation detail).] There's probably a few other things that could be done (suggestions welcome).
my FP background is indeed limited, and therefore I might "still" be missing some points here.
There's a risk that you might view the Haskell'98 report as defining the state of the language. In fact, many Haskell programmers rely on extensions like: - multi-parameter type classes - functional dependencies - existential types - overlapping instances - implicit parameters - concurrency support - exception handling (both synchronous and asynchronous) - the foreign function interface (i.e., ability to call back and forth from C, Java, .net) (The C story is very well developed, Java and .net are starting to become available.) - the "hslibs" libraries (which work on GHC, Hugs and, I believe, NHC) and include support for Posix, Win32, X11, HTML, XML, parser combinators, building test harnesses, and a lot, lot more. Unfortunately, we seem to be stuck between Haskell'98 whose explicit design goal was to be stable and Haskell 2 in which backward compatability (which lead to increasingly unfortunate design decisions in Haskell 1.0--98) would be largely ignored. We don't seem to be ready for Haskell 2 yet: some of the above ideas clearly need revised before being standardised, some are too new to even know if they need revised, some ideas (like those in O'Haskell) haven't even made it into a mainstream implementation. In the meantime, different compiler groups are adding features according to their particular research interests and standardising between themselves as the need arises. (I'm not sure that this is a bad thing - compatability between compilers is limited more by lack of manpower than by lack of agreement or by misunderstanding and communication. The only bad thing is that newcomers might reasonably expect the language standard to reflect the state of the art.)
The FP way of thinking has hit hard on me, though. I just coded a bunch of parametric functional parsers in C++ using template metaprogramming
A language that doesn't affect the way you think about programming is not worth knowing. -- the 'fortune' program -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/

Second, debugging tools. So far, I haven't been able to figure out why my program (a parser for C++ comments and strings) generates stack overflows. Nothing I've been able to think up has been of any help. Neither has the suggestions I got from the mailing list. GHC is supposed to have nice profiling utilities but it won't work in my installation no matter what I try (the program crashes), and, in any case, I haven't seen in the documentation any stack-debugging options.
I would be more than happy to spend a little time pushing your program through the Hat debugging and tracing tools to see what we can find. Nhc98's heap profiling should also reveal interesting things, and I'll do that too if you like. There is a well-known caveat however, that different compilers produce code with different space behaviour, so I can't even guarantee that your program will exhibit a stack overflow when built with nhc98!
So, now I repeat my plea for help. At this point, I don't care much if I don't get the program to work. But I _NEED_ to know what was wrong. Maybe one of you teachers might want to use the program as an exercise in diagnosing a program for the students? I can send it in a pinch: it's just 9K.
Great, send me a copy. And some test data (with expected results, if that is relevant). Regards, Malcolm

At 9:32 PM -0500 6/25/01, Bernard James POPE wrote:
... I think Miranda replaced Pascal as the first language taught to students, but that was a long time ago and I wasn't here at the time.
The switch from imperative to functional must be the hardest, both politically and pedagogically. Does anyone recall how it came about?
... The use of Haskell is filtering up through the later-year subjects, as both staff and students become more comfortable with it. I think that many of our students do not appreciate some of the strong features of declarative programming until third or fourth year when they are faced with larger (more difficult) programming tasks.
I've had several students from my Haskell-based first course (i.e., subject) thank me later on, but the vast majority, lacking reinforcement, seem to lose their ability to think functionally.
There is still a conception amongst some of the students that FP is not really part of "Real World" programming, and that it is merely of interest to academics.
If I could say that about my fellow academics, I would be delighted! Thanks for the enlightenment. Is my envy showing? --Ham ------------------------------------------------------------------ Hamilton Richards, PhD Department of Computer Sciences Senior Lecturer Mail Code C0500 512-471-9525 The University of Texas at Austin Taylor Hall 5.138 Austin, Texas 78712-1188 ham@cs.utexas.edu hrichrds@swbell.net ------------------------------------------------------------------
participants (5)
-
Alastair David Reid
-
Bernard James POPE
-
Hamilton Richards
-
Juan Carlos Arevalo Baeza
-
Malcolm Wallace