Showing posts with label haskell. Show all posts
Showing posts with label haskell. Show all posts

Saturday, 16 August 2008

Himerge (and Haskell) out to the street!

Long ago I decided to help taking Haskell a bit more outside of its own walls; I mean, it is not fair that Haskell applications and tools _only_ have to be used by Haskell programmers (this is currently the main situation) , but they should be also exposed to the outsiders, even to those with no programming experience at all!.

This point has been the main purpose of Himerge since the beginning; one of my projects that tries to throw Haskell into the world, and see how it behaves there. To get applications that you can use in a daily basis; so, daily needs can be solved and pointed out is , in my humble opinion, the only way to overcome the chicken/egg problem many new languages and paradigms have to face.

After a couple of years developing Himerge (in my spare time) , I am quite happy to see many users use it as their main graphical front-end for portage in a daily basis; and though most of the time they funnily react to the fact it is written in such a mysterious functional language; after giving it a try for a while, they realize it is not that bad, and that is actually usable! :-)

I recently wrote an article about Himerge (with some comments about Haskell) to the LinuxIdentity magazine for the special Gentoo 2008.0 edition, and which it is available in store since a couple of days ago (August 14th).

Though Himerge is quite easy and very intuitive to use, it lacks proper documentation; so this article is a first step toward collecting such a information, and at the same time, it's a way of showing to the people, that Haskell is not only fun; but it is also usable and that they need to watch it out, because it's already outside in the street :-)

Regards and Let's go for a walk!

Monday, 7 July 2008

GHC 6.8.2 stable! (Himerge 0.21.9 too!)

As it reads in the topic, excellent news!

We have finally decided to get GHC 6.8.2 stable in our official Gentoo portage tree. Lennart Kolmodin filled a stabilization request yesterday to get this GHC version stable along with many of their existing libraries.

As we all know, since the Glasgow Haskell Compiler went modular, our dev-haskell/ category has increased its size considerably and the maintenance effort too; so, though we have probably got a bit late stabilizing these packages, we have carefully worked with most of them, and they have been already publicly available for anyone willing to test them from our Gentoo-Haskell overlay since many months ago.

This stabilization will greatly reduce the burden for working with Haskell packages in Gentoo now. Users don't need to keyword most of these packages versions by themselves, and a simply emerge command will suffice to get all the glory out of them :-). Therefore we expect and encourage users to test the stabilized packages and report at bugs.gentoo.org any bug found.

With this important stabilization, Himerge version 0.21.9 also got stabilized, which is the latest and most stable release of it. Now the process of installing this program will be smoother since all their dependencies are marked stable too and a simple 'emerge himerge' will make it.

As explained in the bug #230919, these packages are only stabilized for x86/amd64 , more arches to follow.

All the kudos go to the arch teams and everyone who has helped us to test packages and detect bugs during all this time.

Regards and Enjoy!

Friday, 20 April 2007

Haskell for GUI Programing

Haskell has two popular graphical toolkits, Gtk2Hs and wxHaskell. I have only used Gtk2Hs, therefore, my comments come from my experience with it, but since i will speak about GUI programing in general, i guess they could perfectly apply for wxHaskell too.

Programing on Haskell offers many benefits; and i have found it gives a good combination of simplicity and robustness for the graphical user interface development model.

Simplicity: it's very easy to program graphical user interfaces on Haskell; you can get a window and a very useful widget inside it with few lines of code. Haskell as a declarative language takes to the extreme the rapid application development cycle, I'd dare to say that it perfectly can compete with the so called scripting languages in this regard.

GUI programing using gtk2hs is just a big IO monad; and though many Haskell'ers can find this 'ugly' , don't fool yourself, monadic programing and the 'do' notation offers a concise and clean way of writing easy-to-read imperative-like code, and it's when the code becomes bigger and bigger when you realize of its beauty; graphical interfaces can gradually grow very much, so i see this like an advantage and good reason for using Haskell too.

Robustness: I think we pretty much know the main difference and advantages of Haskell over other traditional programing languages here (laziness, purely functional, type inference, etc) and how all these features make a perfect combination to keep your program bug-free and easy to change/fix ; for example, it's amazing to see how you can design and develop a whole graphical user interface without mutable variables or global variables (i admit i found this a bit difficult to believe before using Haskell) ,but it's possible! , and it offers so _many_ advantages, the more significant for me has been the lack of bugs coming from these imperative features, it also helps you to reason about the layout design from other perspective, which is very interesting and benefits a more modular approach instead of an ad-hoc design where you just keep updating bunch of global data structures in-place through signals and events.

Other definitive characteristic that makes robustness possible is the static typing and type system. Haskell helps you to reason about 'types' all the way down along your code, and that's not less true for GUI programming. Many dynamic and weakly typed languages have tried to show to the programming community they are the best way of getting GUI stuff done right and they usually strength the fact of rapid development cycles in opposition to lower-level approaches; really, i can understand this position a bit, most of the first GUI systems came from these kind of languages, nevertheless, i think most of them are in disadvantage with Haskell due to the type system.

Types help both to the machine and to our human brain to think in terms of a common abstraction as an interface for an universe of different values. We can reason 'in harmony' with our computer in an easier way through these abstractions than with a dynamic, typeless language. This kind of reasoning, evidently, will help to the programmer to get more robust programs (and i think i don't need to explain here why that's important for GUIs) and at the same time i have realized this reasoning fits well into the different GUI components representations too; what i am saying here, is that types are practically (and conceptually) a better representation than the objects offered by most of the object-oriented programing languages to work and manipulate graphical elements, and i highly think this is going to contribute to the popularity of Haskell in the future, as a possible replacement or improvement for many aspects of the OOP approach.

And if those aren't enough reasons to use Haskell for GUIs; here is the third one: it's fun.

Since Haskell gives you so many features to make simplicity and robustness of code a reality without too much effort, you pretty much can enjoy coding without worrying about low-level details or possibles unwanted side-effects behaviours, what else could you ask for? :-)

Ok, too much keyboarding for now ... if you still aren't convinced, there is only one way of knowing for sure, just give it a try!

Cheers,