jump to navigation

Great work, Arch Linux! December 7, 2008

Posted by haskelladdict in Linux.
Tags: , ,

As a long time Gentoo user and developer I have always been on the lookout for a Linux distro that can live up to what Gentoo has to offer me in terms of speed, customizability and reliability. For my personal needs, I have never found that Ubuntu, Fedora and friends offer even close to what I am looking for. Recently however, I came across Arch Linux mostly due to their superb Haskell suport. Two weeks ago I installed Arch on my trusted T30 to give it a whirl. To make a long story short, I am extremely happy with it and Arch will stay on that box for good. The install was very easy and I had everything up and running in no time (bootstrapping Gentoo on a 6 year old laptop these days does take some time πŸ˜‰ ). Everything feels very snappy and and worked out of the box (I did have to hack the netcfg script a tad, but this might have been caused by the fact that I use my own custom kernel instead of the one that ships with Arch Linux). Arch’s pacman package manager works like a charm and upgrading or installing packages is a no-brainer. Keep up the good work!



1. K.Mandla - December 7, 2008

Agreed, Arch is a dream come true for anyone who enjoys tinkering with their computer as much as they enjoy using it. I’ll probably always be partial to Crux, just by virtue of its sheer speed, but I’m typing on Arch as I write, and I don’t see myself swapping it out on this machine anytime soon. πŸ˜‰

2. haskelladdict - December 7, 2008

Thanks for your reply and your summary of arch hits the nail on the head. I’ve never had a close look at Crux before but it looks like an interesting project. Maybe some day ….

3. Open Source - December 7, 2008

im agree with K.Mandla
very nice subject
Tutos linux

4. Jamie - January 9, 2009

I just wanted to learn/play with Haskell. I tried Ubuntu 8.10. Install GHC with no problem but I have real problem with cabal install. I did download the libgmp3-dev library and cabal install did went through, but I could not find any cabal binary in it.

Would running Arch allows me to install GHC, cabal et al without any hassles?


5. haskelladdict - January 9, 2009

Hi Jamie,

Installing ghc + cabal on Arch is very straightforward (I’ll outline the steps below). As a matter of fact, Arch’s support for Haskell is supperb (it probably helps that Don Stewart is one of their devs πŸ˜‰ ). However, before dumping Ubuntu you might want to post to one of their forums and ask for advice; another possibility would be the haskell-beginner mailing list. I suspect that there are quite a few Ubuntu users out there that will be able to assist you.

In any case, here’s what you need to do should you go with the Arch route:

1) Install ghc using Arch’s package manager “pacman”

# pacman -S ghc

2) cabal itself and most of the other haskell packages are located
in Arch’s user repositories (called AUR [1]). You can easily follow the steps outlined at [2] to install cabal from there either using one of the AUR installer programs or “by hand”. Whatever fits you best.

Please don’t hesitate to post back if you have any trouble.


[1] http://aur.archlinux.org/
[2] http://wiki.archlinux.org/index.php/AUR_User_Guidelines

6. Jamie - January 9, 2009

Thanks for the tips. I will check haskell-beginner

I installed Arch in Mac OS X’s VMWare Fusion. What is easy way to run Gnome enviroment in Arch?

7. haskelladdict - January 9, 2009

Arch Linux has a a very nice set of wiki pages. For Gnome,
check out http://wiki.archlinux.org/index.php/Gnome

8. Jamie - January 9, 2009

I used to program a lot in C in old days (in 80’s and 90’s) and I have not programmed for a long time. I just discovered Haskell and got the programming bug.

I have Mac Mini and MacBook Pro and I was able to install ghc and cabal with no problems, but I have problem installing Gtk, wxWidgets haskell bindings and some others. I have VMware Fusion so I was hoping that other Linux (or any OS) would give me much better and easier platform for developing haskell programs using libraries such as Gtk, wxWidgets and some others (that are in Real World Haskell book that just came out recently.

What are the steps I need to start out using haskell in Arch Linux?

Any specific package name that I can use pacman to install?

I would guess I will need pacman to install ghc, cabal, Gtk, wxWidgets and some others.

Then I would use cabal to install various haskell libraries from hackage.org.


9. haskelladdict - January 9, 2009

Sounds great and I am glad to hear that you have re-discovered the fun in programming πŸ™‚

In Arch there are really two kinds of repositories. The main Arch ones are supported by the Arch developers and contain the core as well as more frequently used packages such as libraries, window managers, etc.. This is also where ghc is located. Packages in these main repositories are managed via pacman.

The vast majority of haskell packages (more than 700 available as I write this) as well as many others are located in the user supported AUR repositories. These are not managed by pacman but rather by one of the AUR helpers (or by hand if you prefer this).
You can find a list of them at [1]. One of them, yaourt, is pretty nice and really just a wrapper around pacman which also considers all package available in AUR.

That said, you would actually never use cabal per se to install any of the many haskell packages in AUR, but rather use yaourt (or
one of the other helpers) to do it for you. yaourt will also take
care of uninstalling packages (which cabal won’t) and pulling in updates once they become available. Of course, under the
hood cabal will be used but this will all be managed transparently without you having to know.

E.g., say you wanted to install haddock from AUR you’d simply type

yaourt -S haddock

and that should be all (any necessary dependencies required to build haddock will also be pulled in as needed).

[1] http://wiki.archlinux.org/index.php/AUR_Helpers

10. Jamie - January 9, 2009

Great. So when someone upload new haskell package in cabal into hackage, then someone copy that package into AUR, is that correct? If so then what is the approx delay between appearing in hackage and the AUR?


11. Jamie - January 9, 2009

I see there is package called “cabal2arch” which creates Arch Linux package from Cabal package in hackage.

I guess if there is package in hackage that does not exist in AUR, then I would just download that cabal package then convert into Arch Linux package then I can install with ‘yaourt’ command. Is that correct?

12. haskelladdict - January 9, 2009

Most of the haskell packages in AUR are maintained by arch-haskell and, honestly, I don’t know how long it takes for new packages on hackage to make their way into AUR. If there is a hackage package missing from AUR that you need you can always email arch-haskell or join the #arch-haskell irc channel and ask if it could be added. Even better, once you have more arch experience you could become the maintainer for one the arch packages in AUR.

Personally, I’ve never tried the cabal2arch tool so I can’t really comment on it. In any case, once you’ve created an arch linux package for your favorite hackage package you can simply build it via makepkg (part of pacman) and then install it, i.e.,

# cd foo — cd into package directory with PKGBUILD script
#makepkg — build foo package
#pacman -U foo.pkg.tar.bz2 — install foo package


13. Jamie - January 9, 2009

Cool, any instruction (i.e wiki) for installing ghc, et al in order?

14. haskelladdict - January 9, 2009

There’s a haskell wiki entry, but some of it is a bit out
of date [1]. I’d suggest to just pull in ghc and then whatever
haskell packages you are interested in from AUR. yaourt
will take care of all neccessary dependencies. To follow the
things covered in Real World Haskell you don’t really need
a whole lot beyond ghc.

[1] http://wiki.archlinux.org/index.php/Haskell_package_guidelines

15. Jamie - January 9, 2009

Very true πŸ™‚

I notice Arch have extensive Haskell packages compare with other Linux platforms.

I just reinstalled Ubuntu 8.10 and install ghc and some other stuff via it’s own package manager (it is old 6.8 one, not the 6.10) and got it working nice. Nice about ubuntu is that it’s desktop is ready to go. I will install Arch next and go from there.

16. haskelladdict - January 10, 2009

Sounds good. Arch (like most other distros) is also still using ghc-6.8 at the moment since 6.10 is quite new and there are a few glitches that won’t be fixed until 6.10.2 if I remember correctly.

17. Jamie - January 10, 2009

That explains about those glitches.

I am curious what is your preferred text editor (the one that supports Haskell syntax)? More likely vim or emacs πŸ™‚ I am very much Brief guy.

18. Jamie - January 10, 2009

gedit (Gnome text editor) would do the job for me πŸ™‚ Nice that it supports Haskell syntax highlighting.

19. haskelladdict - January 10, 2009

I mostly use vim and sometimes emacs (with viper mode since
I really like the vi key bindings).

20. Jamie - January 10, 2009

Hey are you able to compile the GUI version of HRay Haskell program? I was able to compile/run command line (text version) of HRay, but not the GUI one.

21. Jamie - January 10, 2009

did “pacman -S ghc” and it says “error: ‘ghc’: not found in sync db

I guess I need to sync some db, what is the command to do it? Thks!

22. Jamie - January 10, 2009

Seems like networking is not working in my Arch, any command to set up the networking?

23. haskelladdict - January 10, 2009

I am currently away from my dev machines so I can’t comment on
HRay (maybe ask in the forums, the arch-haskell mailing list or the arch haskell irc channel).

Regarding pacman. If you just installed arch you need to sync your
database via

# pacman -Sy

first, then do

# pacman -S ghc

You should also do a

# pacman -Syu

to bring your system up to date. Check out [1] for more details

[1] http://wiki.archlinux.org/index.php/Pacman

24. haskelladdict - January 10, 2009

arch has a lot of great wiki pages. Chances are that if you have a problem the answer is right there. Regarding networking see

25. Jamie - January 11, 2009

I am making good progress with arch. πŸ™‚ What window manager do you use?

What I wanted is gedit window with two terminal windows in 1680×1050 resolution along with Firefox, Adobe PDF reader and some other apps, Gnome is nice, but seem overkill for that purpose. My goal is to write/learn Haskell programs.

How about Xfce, LXDE and some others? I would like to write Haskell/run other Haskell programs that use Gtk2hs. Also like to do some OpenGL stuff.

26. Jamie - January 11, 2009

It is kinda bewildering to see so many different Linux/Unix platforms with each having it’s own different packaging system (pacman, rpm, apc etc…). I thought it would be cool to have community created operating system written in Haskell having simple package system and windowing system. That operating system would be very stable since Haskell promotes bug-free and stable programs in the first place. That would take time but very much doable.

27. Jamie - January 11, 2009

I see we have our own window manager xmonad which is written in Haskell πŸ™‚ Maybe that would do it for my own Haskell development environment.

28. Jamie - January 11, 2009
29. haskelladdict - January 11, 2009

Despite the fact that there are many different Linux distributions the underlying OS is always the same, namely Linux which is written in C/Assembly. Due to the low level of the involved tasks I doubt that Haskell would be a good choice for implementing an OS. It could definitely be used as a means to manage a Linux distribution itself, i.e. package management and what not. As a matter of fact, there already exists a beatiful window manager written in Haskell, Xmonad [1].

[1] http://xmonad.org/

30. haskelladdict - January 11, 2009

Yeah, Xmonad is my main Window Manager. It rocks!

31. Jamie - January 11, 2009

Cool, so it is like installing X-Windows system, then install Xmonad, that is it? No need to install Gnome and the like?

So by installing X-Windows, then Xmonad, then I could run any apps such as apps written in Gtk & wxWidgets, Firefox, Adobe PDF reader, gedit, terminal (from Gnome) et al, is that correct?

32. Jamie - January 11, 2009

What other apps do you use with xmonad? Like dmenu, Xmobar, Dzen, Conky?

33. Jamie - January 11, 2009

True about underlying Linux which is basically the same all around. It would be easier to run Haskell based OS under vritual machine such as VMWare due to consistent I/O drivers thus making it easier to write vanilla device drivers in Haskell.

However it would be interesting exercise of seeing operating system written in Haskell.

I see that there are “test” operating systems written in Haskell such as House, Hop hOp and Kinetic.

Seems like House is still ongoing development and I am not sure if Kinetic is being worked on..

34. haskelladdict - January 11, 2009

I run plain xmonad nothing else. Xmonad is a window manager just like openbox, fluxbox, etc. and you can run any GUI app that you would like (firefox, gedit, what not). However, since xmonad is a tiling window manager it takes a bit of getting used to. Just give it a try to see if it fits your needs.

I haven’t looked at all at any of the Haskellish OS projects, but I presume that the low level stuff is still C/Assembly with probably an Haskell API on top of everything. I may be wrong though.

35. Jamie - January 12, 2009

Great, I think I will like xmonad as it is written in Haskell πŸ™‚ I use Mac OS X for everyday use and wold use Arch Linux with xmonad for Haskell programming under VMware Fusion.

I plan to buy Acer Aspire One and put Arch Linux on it πŸ™‚

36. haskelladdict - January 12, 2009

Cool! I’ve been pondering getting one of these Acers for myself. Please let me know how things go.

37. Jamie - January 13, 2009

Good reading

A Principled Approach to
Operating System Construction in Haskell

38. Jamie - January 13, 2009


House is compiled by ghc stage1. It would be really interesting to bootstrap ghc and make ghci runnable on House. Think about it: House’s shell is ghci, and House’s editor is Yi. Native APIs are Haskell functions. All processes share the RTS code. How exciting it will be! It’s like the Lisp Machine resurrected!


39. haskelladdict - January 13, 2009

Thanks much for the links – they look very interesting indeed and I guess I have some reading to do πŸ˜‰
Have you tried House in your VM yet?

40. Jamie - January 13, 2009

Not yet, will find time to do that. It will be fun.

Let you know I end up ordering Samsung NC10 netbook. Better keyboard, better battery life and good build quality.

Looking fwd installing arch on it and run with Xmonad πŸ™‚

How many virtual workspace does Xmonad supports? Curious…

41. haskelladdict - January 14, 2009

The NC10 looks like nice machine, thanks for pointing it out to me.

Regarding virtual workspaces: According to the man page there are no limits but I have personally never gone beyond 9.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: