Newb alert: a function language to start

10 views
Skip to first unread message

Nikolas

unread,
Apr 2, 2010, 5:57:49 AM4/2/10
to Ghent Functional Programming Group
Hi all,

after the meeting yesterday, I want to learn a bit more about
Functional Programming. But the first thing of course, is picking a
functional programming language. At the moment, I am in doubt between
Erlang and Haskell (mostly because these are the pure functional
programming languages O'Reilly has a book about). How should I make my
choice? And which one has the best/fanciest IDE?

My current programming curriculum:
- Haskell noob (150 min. of "experience")
- Java beginner

Thanks,
Nikolas

Nikolas

unread,
Apr 2, 2010, 6:01:48 AM4/2/10
to Ghent Functional Programming Group
Where the hell is the edit function by the way? I messed up my
title...

Jeroen Janssen

unread,
Apr 2, 2010, 6:03:38 AM4/2/10
to ghen...@googlegroups.com
> after the meeting yesterday, I want to learn a bit more about
> Functional Programming. But the first thing of course, is picking a
> functional programming language. At the moment, I am in doubt between
> Erlang and Haskell (mostly because these are the pure functional
> programming languages O'Reilly has a book about). How should I make my
> choice? And which one has the best/fanciest IDE?

I am ofcourse biased, but I think you can't go wrong by reading the book "Real
World Haskell", and hence learning Haskell. The nice thing about Haskell,
which is not the case in Erlang, is that you get static types with type
inference, which sort of combines the advantages of static typing with the
advantages of dynamic typing. It's also very advanced in the supporte features
(which can blow your mind sometimes).

Anyhow, the real world haskell O'Reilly book is available for free at:
http://book.realworldhaskell.org/

Which is an added advantage ;). Considering IDEs, I use VIM, but Leksah seems
to be coming along nicely, as are the functional programming extensions to
eclipse (but don't have a through experience with those).

Greets,
Jeroen.

Nicolas Trangez

unread,
Apr 2, 2010, 9:03:09 AM4/2/10
to ghen...@googlegroups.com

Based on my experience (which is biased, obviously):

- Functional Programming is not only a language-related thing. FP
languages do enforce you to apply functional paradigms, but you can
easily follow these paradigms in lots of other (more mainstream?)
languages as well: it is easier to learn people a paradigm using a
language they already know, rather than telling them FP is really cool
and useful and interesting, but requires them to learn a new
language/toolchain/... first.

Not talking about Java or C++ or something similar here, rather Python
and Ruby.


- If you're into Java/C#/..., Scala is a really good introduction to FP:
it allows you to write OOP code just like you do already, but also
provides you lots of FP-related features, and pushes you gently into the
FP approach. The book "Programming in Scala" by Odersky et al. (the main
author of Scala) is IMO a really good intro to both Scala as well as the
FP concepts it provides, not only showing them but also explaining
gently why they're useful, and why they're 'better' than the approaches
you're taking already.

The Scala type system is rather interesting as well.

It's the gentle path, so you want ;-) Learning Scala before reading
'Real World Haskell' certainly helped me a lot to understand the latter.

- Haskell is an incredibly interesting language because of the concepts
it adopted and types it provides, but it does require an immediate mind
switch when coming from a non-OOP world (I once spent about 2 hours to
explain a Java-guy how classes and instances in Haskell relate to
classes and instances in Java, it wasn't obvious). "Real World Haskell"
is certainly worth a read (and if you read "Programming in Scala" as
well, you'll notice lots of similarities).

I for one can read Haskell code pretty easily and learned lots of
CS/math things thanks to learning it, but I'm (still) unable to write
non-trivial code (I need some good project to get my hands dirty I
guess).

- Erlang is really interesting from a (very specific) feature
perspective: high-availability, distributed computing, the actor system
and the OTP library on top of it,...

It's a rather 'old' language, but I kind of like it. Some people do
complain about the syntax, but once you figured out ',', ';' and '.' are
used almost the same as they are in 'human' written language, everything
becomes obvious :-)

Do note though Erlang is not a normal general-purpose language. You can
code +- everything you want using it, but it's really targeted to
distributed/high-available/network applications. You most likely won't
use it to solve mathematical problems or write a game. It's really good
at what it's built for though.

One final note: please don't ever make the mistake I made. If you know
Erlang, and take a look at Scala (which also has an actor library in the
standard distribution, as well as the more advanced Akka-library), don't
judge Scala as being a competitor for Erlang, they're both completely
different languages targeting different applications. 'Scala' is not
about 'scalability' as Erlang is (it's a "Scalable Language").

- F# (and most likely OCaml as well, although I never used it though) is
certainly worth a look as well. I only read 3/4th of a book on it, but
it looks really promising and interesting.

- There's obviously all sorts of Lisp dialects. I have no opinion on
them, never looked into any Lisp closely enough. I only wrote some
Clojure (a Lisp-dialect for the JVM) code one day, but need to learn
more about the Lisp-way of programming. Clojure seems to be interesting
because of the deep integration of Software Transactional Memory (STM)
in the language (yet another approach to concurrency ;-)).


As for the IDE question: Vim and a decent terminal are all you need,
luckily none of the above languages require you to learn how to use a
toolchain which enforces you (or some magic IDE) to write 500 lines of
XML-based build 'programs' or other insanities.


My advice: pick some language, learn it, but make sure you don't only
learn the language, but especially the concepts (type system,
higher-order stuff, list manipulation,...). Then pick some other
language and learn it as well (which will be easier since you got the
concepts already) and so on.

And read tons of papers available on the internet in between ;-) Even if
you don't understand a paper completely, you'll pick up some things
already, and re-reading it 2 weeks later helps a lot :-D


Just my .02,

Nicolas

Reply all
Reply to author
Forward
0 new messages