The first issue of Haskell Weekly News was posted yesterday. It’s amazing how much the Haskell community is growing, and I’m glad to be able to contribute in some small way. New Darcs and GHC versions are not far away, also.
Category Archives: Software
Recent Coding
I’ve been busy coding lately. Here’s what I’m up to:
- A Haskell binding to OpenLDAP. I’ve got the groundwork laid (I can connect and bind to a LDAP server by now). Next up: searching. After that, the rest should be fairly easy. ETA about 1 week. Development sources: fetch with darcs get http://darcs.complete.org/ldap-haskell. See also the related haskell-cafe thread.
- Packaged up and uploaded hsffig to Debian. hsffig will parse C .h files and automatically generate Haskell bindings and prototypes for them. It requires zero human assistance. Very, very, very cool. A little rough yet, but this is exciting stuff. Check out the source package with darcs get http://darcs.complete.org/debian/hsffig.
- Packaged up and uploaded libcdk5, the latest version of the Curses Development Kit (CDK). CDK is a much more high-level tool than ncurses, and lets you say things like “show a dialog box” instead of “draw a border from 3,20 to 3,70 and make it gray”. Check out Debian source package with darcs get http://darcs.complete.org/debian/libcdk5.
- Updated my MissingH Haskell library so it now builds and runs properly on Windows platforms. I now remember how much I detest them. (Urgh, drive letters complicate path manipulation in millions of annoying ways.)
Looking For Text-Mode Widget Library
I’m looking for a text-mode widget library. Something that has dialog-boxes, etc. for text-mode (curses/console/xterm) programs.
I’ve looked at these so far:
- tvision/tv/turbovision: Questionable license situation, unsuitable for Debian
- CDK: Fine on *nix, but unusable on Windows
- CTK: Not maintained for several years, looks dead, not as good as CDK anyway
I want something with a C library, that supports *nix and Windows, and has support for things like menus, dialog boxes, etc. Any suggestions?
Drupal Doesn’t Stop Spam
I run Drupal for this site, as well as some others hosted here. My #1 complaint about it is that the spam solutions in Drupal are ineffective and poorly-designed. The situation seems to have actually gotten a bit worse in the most recent versions of Drupal. Here are my complaints:
- No working support for captchas. (I had lots of problems with captcha.module)
- Spam filter is not very effective, despite being properly trained on huge volumes of spam. I get dozens, if not hundreds, of uncaught spam comments per day.
- The “mark as spam” button has no effect on some very large spams.
- There is no feedback to users whose comments have been marked as spam, indicating to them that the comment will be manually approved.
- There is no auto-expiry of spam comments; they sit in the database forever unless manual action is taken.
- Deleting spam comments — which seems to be the way that people are encouraged to use the spam module — requires: checking one checkbox per message, then selecting “delete”, and repeating this for each page of the spam comment listings (it only puts a few dozen per page; I get about 15 pages worth in a slow day.) Even with some Mozilla toolbar help, this is a slow and cumbersome process.
- No “auto-delete” feature for spams referencing certain URLs.
- Poor recognition of &-sequences in HTML
- Nobody really maintains the spam filter
- Does nothing at all to stop trackback spam
So, my question is: what blogging software has good anti-spam capabilities?
Back when I used WordPress, I used the Captcha module for it, which worked well. (Its normal anti-spam capabilities didn’t.) Drupal doesn’t have a working Captcha module, and everything else is hugely labor-intensive.
Is there something better out there for Drupal anywhere?
I often get the impression that the authors of the spam module in Drupal get less than a dozen spams per day on their blogs. It simply doesn’t scale to places that get hundreds of spams per day.
(Update: Drupal also isn’t very responsive at addressing bugs…)
Linux, Bluetooth and Mobile Phones
I got my first Bluetooth-enabled mobile phone this week, a Motorola v551. I’ve been playing with the Linux utilities for working with mobile phones and have assembled some links. Most of the pages out there seem focused on SMS features of a mobile, or using a mobile phone for Internet access for a Linux box. I’m interested in neither, and care more about phone book syncing and transferring files back and forth between the phone itself and a PC.
- Gentoo’s Mobile phone and Bluetooth HOWTO
- Linux + Phone + Bluetooth, the best guide so far on getting the basics set up on the Linux side
- Gnokii, a very nice mobile phone tool
- KDE Bluetooth Framework looks great from the screenshots. I need to give it a try.
- moto4lin — this looks like exactly what I need for my phone. I think I’ll package it for Debian.
There seems to be quite a community built around hacking Motorola phones as well. The Hofo Guide is the authoritative resource.
HowardForums.Com is also a great site.
Some Haskell Quotes
As seen on #haskell recently:
<Speck> "That's like cheating. It isn't even programming. You just tell it
what to do and it does it." -- My friend upon seeing some Haskell code
<autrijus> Perl: "Easy things are easy, hard things are possible"
<autrijus> Haskell: "Hard things are easy, the impossible just happened"
Teach Yourself Programming in 10 Years
I found a wonderful essay by Peter Norvig entitled Teach Yourself Programming in 10 Years.
Peter Norvig has a wealth of insightful essays I’ll probably be mentioning over the coming weeks.
Why I Love Haskell In One Simple Example
I recently implemented some new Haskell numeric types that, instead of performing calculations, can generate a rendering of the requested calculation or store units with it.
Here you see a transcript of my session with a Haskell interpreter. The mathematical statements I am entering after the “>” are standard Haskell expressions, and, as I demonstrate, normally evaluate to a single result.
Once I get a more powerful simplifier, I will probably write a LaTeX exporting function as well.
The entire implementation of this, BTW, is less than 200 lines.
NumTest> 5 + 1 * 3 8 NumTest> prettyShow $ 5 + 1 * 3 "5+(1*3)" NumTest> rpnShow $ 5 + 1 * 3 "5 1 3 * +" NumTest> prettyShow $ 5 + 1 * 3 "5+(1*3)" NumTest> prettyShow $ simplify $ 5 + 1 * 3 "5+3" NumTest> prettyShow $ 5 * (Symbol "x") + 3 "(5*x)+3" NumTest> 5 / 2 2.5 NumTest> (units 5 "m") / (units 2 "s") 2.5_m/s NumTest> (units 5 "m") / 2 2.5_m NumTest> 10 * (units 5 "m") / (units 2 "s") 25.0_m/s NumTest> sin (pi/2) 1.0 NumTest> sin (units (pi/2) "rad") 1.0_1.0 NumTest> sin (units 90 "deg") 1.0_1.0 NumTest> (units 50 "m") * sin (units 90 "deg") 50.0_m NumTest> ((units 50 "m") * sin (units 90 "deg")) :: Units (SymbolicManip Double) 50.0*sin(((2.0*pi)*90.0)/360.0)_m NumTest> rpnShow $ dropUnits $ ((units 50 "m") * sin (units 90 "deg")) "50.0 2.0 pi * 90.0 * 360.0 / sin *" NumTest> (units (Symbol "x") "m") * sin (units 90 "deg") x*sin(((2.0*pi)*90.0)/360.0)_m
Also, I defined this in my source file:
test :: forall a. (Num a) => a test = 2 * 5 + 3
Now, it can be used:
NumTest> test 13 NumTest> rpnShow test "2 5 * 3 +" NumTest> prettyShow test "(2*5)+3" NumTest> test + 5 18 NumTest> prettyShow (test + 5) "((2*5)+3)+5" NumTest> rpnShow $ test + 5 "2 5 * 3 + 5 +"
You can grab the very early experimental code with darcs get http://darcs.complete.org/num.
Haskell has no built-in support for numeric types with units, arbitrary symbols carried through computations, etc. But it was trivial to add it. This kind of extensibility is a key part of why Haskell is so amazing.
Haskell: A Very Different Language
Free Software Magazine has just posted my article Haskell: A Very Different Language.
The folks at Free Software Magazine are doing a great job on a shoestring. I hope they can continue to do good things out there.
Reiser4 Experiences
I’ve been a long-time user of JFS, but have grown unhappy with it for various reasons. So, I decided to try out XFS. It proved no better than JFS or ReiserFS 3 with data integrity during a crash.
Next step: Reiser4. I’ve been using Reiser4 for the past month or so on three different machines. I must say that I’m quite impressed with it. It is a stellar performer and it also recovers well from crashes. I mount all my filesystems with the nopseudo option, which essentially makes Reiser4 have standard Unix filesystem semantics in every way. I’m very pleased with it so far.