Learning Erlang

I’m learning Standard ML in Principles of Programming (15-212). I didn’t think I would like the functional programming paradigm but it’s starting to grow on me. Having functions as first class values allows you to do some pretty neat things that would be a pain in other languages and some of the programming idioms are quite elegant. The only thing I haven’t enjoyed is Standard ML and it’s strong type system. The syntax leaves much to be desired as well, but this seems to be common among functional programming languages. As you can probably tell by the title of this post, I decided to learn Erlang in my free time.

The main reason I chose Erlang over say Haskell, Clojure, or some other functional language is my interest in concurrency and scalability. From what I’ve read people have had a lot of success with Erlang in situations that require concurrency and scalability so it seemed like a good way to satisfy my concurrency itch and my curiosity for functional programming. For the curious, Wikipedia has a short list of some projects using Erlang including some big names like Facebook and Amazon.

I’ve been reading Programming Erlang by Joe Armstrong. It’s a pretty solid book so far. It’s well written and easy to follow. There’s a lot of code snippets for you to try which fits my learning style. I wish there were some exercises at the end each section or chapter to get the reader thinking and writing some code instead of passively reading. My strategy for getting around this so far is to redo my 15-212 homework in Erlang, which has worked out pretty well.

I find my 15-212 homework easier to do in Erlang. It’s dynamically typed so I can add an integer and float together (what a concept!). I know you can do that in SML if you call the real function but it’s a pain and makes the code hard to read. Also, guards are awesome. One of the things that really annoyed me about pattern matching in SML is that while it was a very elegant, you still had to resort to if/else to check for things like inequalities and greater than or less than relationships. Guards in Erlang let you do this in natural way that feels like an extension to pattern matching.

Erlang is great so far. I’m starting to get into the concurrency features of Erlang so hopefully I’ll have more interesting things to post later.

Finem Respice

I have a policy when it comes to rating experiences: never rate experiences until they’re over, only in retrospect, because you’ll most certainly hate it at the time if you’re rating it in the first place. I remember the councilors saying that high school is going to be some of the best four years of my life. I was a freshman then. Now I’m done, out of high school, done with the wonderful land of free education. It’s been an interesting four years to say the least. There’ve been ups and downs, but overall it’s been an awesome ride.

I can’t say it will be the best years of my life since I have still a long life to live ahead of me, but they were right about one thing: you will change more than you know and so will your friends. When you first enter as a freshman, the counselors make you fill out a questionnaire with some random questions about yourself. Four years later, they show it to you again just to prove their point about how much you’ve changed.

As a freshman I was timid and shy around strangers and socially inept at times. Now… I think I’m just socially inept. Two out of three isn’t too bad. I’ve become a somewhat competent technologist too, but I’ll save that for another blog someday. My philosophy on life has changed significantly for reasons I don’t remember at the moment. It goes something like this: overcome one hurdle at a time; when you knock one down, look back to see what you did wrong, but focus on getting over the next hurdle. More recently, I developed another when I had an introspective moment this year: don’t care so much about what people think.

Thinking back, I can remember the many different phases I went through, particularly this year, where I behaved and thought differently in each. Sometimes the transition between each phase was gradual and at other times it would be quite sudden.

The friends you have as a freshman may not be the same friends you have as a senior. The reality is that although you may hold onto a few close friends all the way through high school, many of them will change and you will make new ones along the way. I met most of the people I hang out with now in my junior year: Luke, Abbi, Melissa, Sadie, Brian, Julia. Interestingly enough I got to know most of you through IB Physics. Matt and Brett, my homies, my partners in crime, you guys are awesome. We’ve been making ruckus together for all four years. Rock on at OSU and try not to get into too much trouble.

I’ve learned to appreciate the immeasurable value of mentors in one’s life. At the time you don’t think much of it, but afterwards you appreciate how much time they’ve set aside to make sure you succeed. I’m not sure what motivates them, but it is a gift that exceeds all others. I have been fortunate enough to have two mentors during my time at Gresham. The first is Stephen Scannell who without him, there would be neither InvenTeams nor FIRST Robotics for me. The second is John Walker, who has imparted many words of wisdom and helped me realize, perhaps, the human side of technology. If I ever write a book about my life, both of you will most certainly get a shout-out. It’s been an honor.

I mercilessly teased some of the lower classmen about how many days of high school they have left (actually, I only talk to one so you know who you are), but part of me is envious of him. A small part of me doesn’t want to let go. There are a lot of people I don’t talk to much outside of school. Previous summers have always been fairly easy to cope with. I think part of the reason for that is that I knew that I would get to see everyone again in the fall. But this summer is different because we’re all headed off in different directions, or at least many of us will be. We were all traveling the same road for a while, but it is nearing the time where we all must choose our own path and follow our own destiny. Perhaps they will converge again at some point, or at least cross.