In chronological order I've worked with and tried:
- Common Lisp (actually started that in 2008)
- Haskell
- Erlang
- Scala
- F#
- OCaml
Common Lisp
Those of you who are following this blog know that I've started with Lisp over a year ago. It's been a very pleasant and enriching experience. I love the parentheses because they just 'disappear' when you get the hang of them. I've toyed with macros and though I didn't get all that far with them, I can see the potential that's there. I've even 'missed' that potential in other languages I've used since then. The SLIME environment in Emacs is awesome, makes for a great programming experience. But then there's the libraries in Common Lisp. I've blogged about this before, but since then some new ways of doing libraries in CL seem to have emerged. Though I fear the original problem of the libraries is still there because there's so many ways of managing libraries and mixing them together makes stuff even worse. This is my only real gripe with CL. If the libraries were just a little better and contained in one central place...
Haskell
This is/was the hot new thing. Reddit/Hacker News are filled with posts about Haskell. So I decided to learn it. The syntax is very clear, it's easy to read once you understand it. (no I'm not contradicting myself in that sentence)
Good community, great IRC channel (important for me), lots of libraries are more strong points. Pattern matching! My god, I cannot live without it anymore. List comprehensions... what a joy!
I was so excited about Haskell, until I tried to write something useful. I get the whole safety and purity thing, I think it's great, but it gets in the way of actually creating programs that you use. Maybe I haven't studied it long enough (this might be the theme of this blog post now that I think of it) but it's a little too hard to make stuff in right away. I think I understand Monads, but that in itself isn't a great sign, because I'm not entirely sure. Probably, with (a lot?) more effort I'd be able to use Haskell as my primary language. Is that effort worth it to me? Not at this time no.
Erlang
What a breeze. Compared to Haskell, this was so easy to learn. Of course, learning a lot of the functional idioms with Haskell has helped a lot. I'd imagine Erlang being a lot harder to learn for someone with absolutely no experience with functional programming.
The syntax is a bit strange, but you get used to it quickly. A lot of libraries out of the box, tons of useful stuff in there. The Emacs mode does exactly what it needs to do to facilitate coding. Erlang is made for fault-tolerance and concurrency and those things are spectacularly easy to do with it. I made a little test program (rss feed grabber) with the supervisor behaviour and let it run on my server. I actually forgot about it and when I logged back in after a week and a half, it was still running happily. My internet went down a couple of times, but the little program did exactly what it needed to do and was still doing it.
So what do I not like about Erlang? I'm not sure. It's like it's so easy to use, the challenge of writing 'clever' code is gone. Haskell is too much of a challenge, it feels like Erlang is not enough of a challenge.
I've written a couple of non-trivial things with Erlang, including a couple of web-apps with Yaws. No complaints, everything works like I want it to. But there was no challenge. This is a good thing of course, because the goal is to write stuff that you're going to use later on. Then why do I lack the feeling that I've accomplished something? I love doing things that are a little harder, but Erlang has a strange way of making almost everything easy. If I ever start a programming business, Erlang would be my language of choice.
Scala
I didn't do a lot of Scala. It's subjective and perhaps stupid, but I just don't like how Scala presents itself on my screen. I've never liked curly braces to start with and Scala's syntax looks so forced. Scala does have a lot of potential, I'll have to admit. It has all the features you can dream of, it's fast and with the JVM as the platform, you can use it almost anywhere. I just don't like how it looks.
F# and OCaml
I'm taking these two as one, since they're so similar. I'm only starting out with OCaml but I like what I see so far. The syntax is nice enough for me. Most of the functional stuff I know from the previous languages are available, without being paranoid about purity. For now, it seems to me that OCaml is halfway between Erlang and Haskell when it comes to 'challenge' level. So I wonder if it's worth it to keep learning. Use OCaml at home and F# at work, that's the plan. Not sure if they will beat the practicality of Erlang. OCaml is faster, but speed is not the main requirement. Having fun while writing stuff is the main goal for me really, now that I think of it.
Conclusion
I'm going to have to stop jumping from one language to the other and focus on a single one. That's the only way I'll really 'know' that language. Problem is I can't decide because I'm afraid to make the wrong choice. I did learn a lot of new concepts and idioms, so I feel this journey was fruitful nonetheless. But it's time to settle down and really get to know one language. But which one?
Maybe I can try Factor
or even Perl.
Clean looks nice,
or what about....
6 comments:
If you like learning new languages there's plenty of them who offer novel ways. Concatenative (Forth, Factor) Array (APL,J,Q) and Prolog are definitely worth learning. But in the end you have to pick 2 or 3 that you want to master and spend time on them.
Hi there, nice write up. Last year I've learned basically those same languages :), with the same problem with Scala, it doesn't look nice at all. For me is like Java wanting to be functional. I like that in Haskell, or Erlang, you see a new syntax compared to other languages, say PHP, etc.
As the previous comment say, I started playing with J, they have a pretty nice package here: http://www.jsoftware.com/ and it looks like for statistics is THE language. I've read a bit of Prolog too, now I understand why they say that Erlang syntax is inspired by Prolog.
Regarding Haskell... well, I really liked it, but while I could write some libraries, like one to interface to Redis, I see that my code is not "haskelish" at all. I find hard to get all the Monads and Monads Transformers into my head, and I think that you need to understand that part of the language to be able to do powerful stuff. If I can get past that barrier, I'm pretty sure that Haskell is the language I want to code on, along with Erlang.
I "suffer" from the same problem, but I love ruby. Have your tried it. I intend sticking with it.
However, after reading your article, am itching to try out erlang. Or maybe ...
Scala looks not that bad for me. I do not like erlang's week type. Strong type make me feel safe.
Thank you for explaining this!
Post a Comment