4 Languages in 4 Seasons


Over the past year, I’ve hopped out of my comfort zone of Python to learn some new programming languages. I think I just got bored of Python’s syntax? I was looking for something new, and something that felt cool.

As a general disclaimer, I definitely suffer from a love of underdogs - I love tooling or platforms that feel underappreciated. Aside from poor hardware, that’s how I got into using Linux on my personal computers, and I think it’s what drew me to languages that lean toward functional programming.

I’ve learned a few other languages in the past year (Go, mainly through work and Nim, but only a little bit), but I don’t really think that they struck me as interesting or anything I particularly wanted to write.


Elixir

Elixir was my first foray into functional programming - before that, I was basically just writing ugly Python, overusing map() and filter(). I got into Elixir from a post on Hacker News. I don’t recall what it said, but it was compelling enough for me to look into it. Another factor was that Apache CouchDB was “dropped” on me at Universal, and it is written in Erlang. I didn’t have to particularly learn any Erlang for the project, but I was still interested in it since I hadn’t really heard of anything using the language before.

Elixir essentially wraps Erlang into a much more familiar syntax, and adds some niceties to make it more approachable to a newer generation of developers. The BEAM, the Erlang virtual machine, has a “killer feature” is that it implements a concurrency system similar to the Actor Model. This means that there’s millions of lightweight processes that don’t share memory with each other, and they communicate with each other via message passing. Message passing itself works like a message queue for the process, so while it executes concurrently with other processes, it iteratively processes each message its’ passed. It’s a great way to think about concurrency, and I think it overshadows the other programming languages I’ve poked at, leaving something (first class support for the Actor Model) to be desired.

I’ve written a few personal projects in it (most of them didn’t really go anywhere, of course), and I think it’s becoming the language I’m most productive and comfortable in. A lot of the paradigms within it feel like they just “work” to a large degree, and I’m truly excited for the future of the language. The tooling is immaculate, intuitive, and powerful. The creator of the language is active in the community, and all around great to interact with, it seems.

Out of all of the languages described on this page, I think I can see this one blowing up the most.

A great book for Elixir is Elixir in Action, by Sasa Juric - It does require a bit of programming experience, but its a beginner resource for Elixir that lays out the features of the language and how to be productive in it.


Scala

Scala had sat in the back of my mind for a couple months before I started poking at it. I recall my first real look at it being on a post detailing the release of Scala 3. It seemed like a cool language - a lot of the functional programming concepts that I had an idea of, but also with the power and adoption of the JVM. Coincidentally at Universal, Apache Kafka was dropped on me as a project I was in charge of, and it was basically the same thing with CouchDB and Erlang.

Scala has an albatross around it’s neck, in that some people regard it as something to be a “better Java”. I don’t think this is entirely true, though. after writing with Java for work, I do prefer Scala.

A few things really bugged me about Scala:

  • From my crawl-by, the community felt like a big brawl. Nobody seemed to like each other, and nobody seemed to want to work together.
  • I felt like I needed to be very smart to be productive in it. Many conference talks droned about “category theory” and “type theory” and this and that. That’s all fine, but it felt like it was trying to attract people who want to talk about math all day
  • Getting deep into the typing system becomes very arcane. It seems like there’s a lot to memorize and be aware of, which I just didn’t find exciting. I’ll probably change my mind after writing in more Scala, but it rubs me the wrong way at time of writing.

Some of the goods:

  • Static typing/compilation stops mistakes before they happen
  • Support from the JVM, overall a pretty well engineered runtime environment
  • Low boilerplate for code
  • Fuzzy support for scripting. It doesn’t seem to be an intended purpose, but the functionality is there and it works pretty well

I had read Hands-on Scala, by Li Haoyi. It’s well written and informative (again, beginner to Scala but not to programming), though I think my only criticism is that it feels like an advertisement for the Author’s libraries. In all fairness, they seem to be well written and viable replacements for other libraries/tooling in the Scala ecosystem.

With its’ warts, I like Scala, and I’d be excited to work with it in the future.


F sharp

A lot of the work at Universal was done in .NET for some of their backend services. I wasn’t particularly interested in C#, but I did find out about F# pretty soon after. I don’t have much to say about F#, as I haven’t particularly written a lot in it; just enough to form some opinions.

Some of the Pros:

  • Similar (and arguably better) typing system than Scala; Cool Algebraic data types that a simpleton like me could understand.
  • The language overall feels less smart than Scala, in a good way. I don’t feel like my brain needs to be running at full steam to be productive
  • Community as a whole is small, and aims to productively cooperate.
  • First-class support (or equivalent to C#) from the runtime developers

If it’s not clear, I see F# as a bit of an anti-Scala. It’s a functional language that runs on .NET (instead of the JVM), It feels much easier to pick up, and everyone in the community seems to be cordial.

I did have some cons, though:

  • Syntax is lacking; parentheses aren’t used in the same way as other languages, so it’s hard to keep track of structure when you’re unfamiliar with the language
  • Association with Microsoft feels like a looming storm cloud (though the same could be said with JVM languages and Oracle) (I’m aware this is personal bias and might not directly mean anything)

Unfortunately, I lost a bit of interest in F#. I might pick it up again sometime later this year, but I probably won’t reach for it to solve problems anytime soon.

I didn’t read a book on it, but the Exercism track felt pretty comprehensive. It’s fair to say that I’ll probably revisit it in another blog post, after I complete the Exercism track


Common Lisp

Common Lisp is cool. It’s always something I’d read about on Hacker News, and there’d be constant people talking about how much they loved it, et cetera.

I’m still learning it, and its slow going due to the non-familiar syntax, but it definitely feels like something I’d like to get really comfortable with. Maybe the next iteration of this site :D

You quickly get over the parentheses everywhere, and every text editor/IDE worth an install can do paren matching, so it’s pretty easy to look past after a moment.

I think my biggest issue right now is that the standard library/ANSI Specification isn’t consistent in some patterns, but I think that’s just going to come with time and work.

I’m reading Practical Common Lisp by Peter Seibel, and it’s pretty great. I like that it walks the reader through short, practical projects in a lot of the chapters.

Funnily enough, Poking at Lisp has pushed me towards a few other technologies:

  • Hy; This gives Python a lisp-like syntax - all the batteries of Python, and the syntax and macros of Lisp. I’ve already written a few scripts for my homelab in it.
  • Guix; This is a Linux Distribution (and package manager) similar to NixOS, but it’s centered around Guile Scheme (a lisp dialect) for configuration. I’ve installed it on my laptop, and it seems great! If you can get around the general dogma from GNU, it’s pretty neat, and there’s workarounds for things like the standard linux kernel and Intel wifi drivers.

Conclude

Overall, I’m happy to have learnt these 4 languages, and I’d probably be pretty happy to work with them in the future, for whatever side projects (or work!) they fit into.

When learning niche/unused software, it’s really important to separate the skill from the monetary value (unless that’s something specifically you want). I feel quite fulfilled over the past year for learning interesting languages that I think have improved my programming skill, and will continue to help me a better programmer.