Archive for the 'erlang' Category


The four programming language groups everyone should learn a language well from…

Friday, September 7th, 2007

I saw a reddit question today that was something along the lines of “I’d like to learn 16 languages in a year, which ones should I learn?” This of course sounds ludicrous to me and I definitely advocate against that. I think a better goal for working in a year (and this is stretching it) is to learn a language from the four major language groups (in my opinion) well. This is by no means an authoritative list of languages, but rather a list of languages that just by learning them can teach you things that other languages wouldn’t and thus make you a better programmer.

Lisp - It seems that many ideas and features people look for, Lisp already has, so take some time to learn them here, it’ll definitely make you a better programmer.

Haskell - Everything is a function, and thus you have no side effects. This will teach you to right better code in that you will end up trying to reduce side effects in your Java/C++/Python etc. code.

Erlang/Smalltalk - The beauty of message passing comes out in both these languages, Erlang more in a truly distributed manner. I personally am learning Erlang and love it.

C/Assembly - Working in lower level languages like these two will teach a you a lot about thinking about how you write something will effect different architectures. I know C and haven’t had a chance to really play with Assembly yet.

I’m half way through that list, that is I’ve learned C & Erlang pretty well, next is Lisp. I think those are some of the best you learn. Learn a few things well, the others will come, languages are merely syntax, its the idioms, paradigms and skills that will make you a better programmer, not the language.

My weird CS hangups…

Sunday, August 26th, 2007

I was browsing reddit today and ran across a blog entry by Shannon Behrens. He was discussing odd hangups that different CS people that he knew had, specifically the bright ones. Now I’m not sure I consider myself any sort of beaming, radiant, CS luminary with profound ideas but I consider myself a pretty good programmer.

Shannon mentioned that his major hangup is that he’s an open source fanatic, that is he’ll use a lesser product if it means the difference between using proprietary software and open source software. Now this isn’t a terribly bad hang up in my opinion, though I can see how some might see it as out of hand if you get into the blurry zone of proprietary drivers for video cards and the like. Now Shannon’s hangup sounds a lot like my friend Andrew A.’s hangup. He too is obessesive about using open source software. He is an administrator for a free shell service for developers and with this shell service he uses Debian on the server. Now I offered up my Sun Enterprise 220r as another server for the service to use for users who wanted to play on some Sun hardware. Now it started out that I used Ubuntu on that and though Andrew A. never explicitly asked that I use Debian, he hinted at it because Debian has the “free, open source” philosophy. Long story short, I’m now running Debian on that server.

As for a weird CS hang up for me… I’m zealous about writing concurrent code only in functional or concurrent oriented languages. I refuse to write code that even attempts to be concurrent in anything like C/C++/Java. When I took a course last semester for C & UNIX programming, one of our assignments included fork()/pthreads. It took all my might to make myself write this program in order to fulfill the requirements for the labs. Even at my current job as a research assistant, in order to avoid writing multi-threaded code in Java I converted an ecology computer model into Erlang in order to work with the threading in Erlang instead of Java which turned out to be a fairly large project.

I don’t know what it is, maybe just the pure ugliness of multi-threaded/multi-proc code in imperative or object oriented languages that creates a mental block for me to write that kind of code in languages like Java or C/C++. Note that I’ll write in those languages, just not with concurrency.

ERLANG FOR YOU!

Tuesday, July 31st, 2007

So currently Erlang is the flavor of the week. I pre-ordered the new Erlang book from Pragmatic Programmers, “Programming Erlang: Software for a Concurrent World” by Joe Armstrong. As it turns out Armstrong is also one of the original authors of the Erlang language. Now you ask: “Why would anyone want to use Erlang and whats it good for?” Guess what, you’re in luck, I’m here to tell you in fact.

Erlang is a beautiful mesh of concurrent and functional goodness that makes writing programs a succinct and (mostly) bug-free endeavor. Where Erlang exceeds though is in its concurrency abilities. It has very little overhead for creating new processes, just 300 bytes a piece compared to 1 Kb for other languages like C. These lightweight threads/processes combined with Erlang’s functional nature make it ideal for distributed systems (Oh goody! Exactly what I do in fact!).

After having had some time to play with the language, I have to say its one of the more fun languages I’ve worked in. I started out trying to write some stupid “idea” programs but quickly remembered ProjectEuler.net. I set out a day ago to rewrite some solutions to the Project Euler problems in Erlang and have had no problems. In fact I’ve gotten excellent results from Erlang and am learning a lot as I go.

Anyone who hasn’t looked into Erlang and is looking into getting into functional programming ought to have a look at it before any other language. Its a good way to ease yourself in so you don’t have to tackle the idea of Monads and such too early on which are found Haskell, Clean, and Ocaml, which are some fairly popular functional languages.