Which New Language Should I Learn for Web Development?

One of my goals for the year is to learn a new programming language. It’s been a while since I learned a new language, and I feel like a lot of the languages I know well (Go, Python, C++) are similar to each other, so I want to try getting out of my comfort zone a bit with a language that feels weird to me.

Requirements ๐Ÿ”—︎

Here’s what I’m looking for:

  • It’s significantly different from languages I know well
  • Web apps are a first-class citizen
  • Makes it easy to build small, simple apps
    • I want the opposite of Angular, which feels overly optimized for large projects
  • Supports backend and frontend
    • It doesn’t have to have a frontend framework, but I want to be able to use the same toolchain for backend and frontend like I can in Go or Python.
    • I don’t want to use something like Elm that’s frontend-only.
    • I don’t want separate build chains for the frontend and backend code (and I’m fine writing vanilla JS with some light backend templating).
  • Compatible with SQLite as a data store
  • Has good support for unit testing
  • Open-source
  • Actively-maintained

Nice-to-haves ๐Ÿ”—︎

  • There’s a good ebook available.
    • Paid books are fine.
  • Low abstraction / limited “magic.”
    • I find languages like Angular and Vue to be too “magical” in that there’s a bunch of Node.js packages in the mix that I don’t understand. And starting out, it feels fine, but once I get beyond trivial programs, I realize the abstractions are leaky, and there are complicated systems under the covers that I don’t understand. The other end of the spectrum is Zig, which feels extremely easy to reason about.
  • Static typing

Non-goals ๐Ÿ”—︎

  • Maximum performance
    • Most of the apps I write have tiny performance requirements. Usually, the only user is me, and other times, I don’t expect more than a few dozen users simultaneously.
    • I don’t want to use something that’s slow for a single user, but I want to avoid things that make tradeoffs in the name of achieving high scale.

How much I enjoy various languages ๐Ÿ”—︎

For reference, here’s how much I enjoy working in some other programming languages I know:

LanguageRatingMy ExperienceNotes
Go9HighGo is beautifully designed for web apps.
Zig8LowVery fun for highly efficient or performant code, though not my ideal tool for web apps.
Python6HighI’ve done a lot in Python but the poor packaging and lack of typing has started to bother me.
JavaScript5MediumI wish there were better packaging / testing tools that didn’t depend on node.js.
Angular2LowWay too magical and complex.
Vue4MediumI loved Vue2 for a while, but I’ve been burned too many times on my app breaking due to some bug or gotcha in the framework rather than in my code.
C++4MediumI haven’t written it in a while. It’s okay in environments like Google with great tooling support, but I wouldn’t enjoy building a C++ dev environment from scratch in 2025.
C6LowSame issues as C++ but I appreciate the simplicity.

Methodology ๐Ÿ”—︎

To research each language, I:

  • Read the features page for the language
  • Read the features page of the dominant web frameworks for that language
  • Looked for examples of simple, “hello world” web apps in each language
  • Asked LLMs to compare language features of languages to languages I know

Candidates ๐Ÿ”—︎

Elixir / Phoenix / LiveView ๐Ÿ”—︎

Elixir is high on my list because a lot of bloggers I think are smart seem to enjoy it. It also seems to have concepts and features that sound weird and interesting.

I like that Elixir has a very official web framework: Phoenix. I’m not crazy about Phoenix depending on Tailwind CSS by default, though it looks like I can turn that off.

The new thing is Phoenix LiveView, which seems to be a way to create web apps without writing much JavaScript because LiveView uses websockets to push backend state down to the frontend without a page reload. But LiveView generates SPAs, and I’m so tired of SPAs and don’t want to invest in them anymore. You can use Phoenix without LiveView, but I get the sense that LiveView is where they’re investing a lot of their resources.

  • Good
    • โœ… Cool language features
    • โœ… Has a compelling solution for web apps
    • โœ… Built on Erlang, so it has access to the Erlang ecosystem
  • Bad
    • โŒ No static typing
    • โŒ LiveView is designed for SPAs
    • โŒ LiveView feels “magical”

Gleam / Lustre ๐Ÿ”—︎

Gleam seems like Elixir’s scrappy little brother. It has a lot of language features in common with Elixir like pattern-matching and pipelining, but it has static typing (nice!).

Gleam doesn’t support metaprogramming, which I have mixed feelings about. In general, I dislike metaprograming and always feel like I’m not smart enough to do it, so in a way I’m happy Gleam excluded this feature. On the other hand, if my goal is to try something new, maybe I should force myself to try metaprogramming.

Gleam’s web framework is called lustre, which has you write HTML in the form of Gleam function calls:

pub fn main() {
  let app =
    lustre.element(
      html.div([], [
        html.h1([], [html.text("Hello, world!")]),
        html.figure([], [
          html.img([attribute.src("https://cdn2.thecatapi.com/images/b7k.jpg")]),
          html.figcaption([], [html.text("A cat!")])
        ])
      ])
    )
  let assert Ok(_) = lustre.start(app, "#app", Nil)

  Nil
}

Honestly, writing HTML like that looks super tedious and ugly, but I’m open to trying it.

Gleam hasn’t reached critical mass yet, so there’s a risk that the language won’t be around in five years, but I guess that’s okay. I’m not planning to build a business on Gleam, just play around and learn some new things.

  • Good
    • โœ… Cool language features
    • โœ… Built on Erlang, so it has access to the Erlang and Elixir ecosystems
  • Bad
    • โŒ Relatively new and immature language
    • โŒ Not many learning resources outside of the official docs

Haskell ๐Ÿ”—︎

The people I know who enjoy Haskell tend to be annoyingly smart language nerds who love thinking about compiler and language design. That’s not me.

The thing that made me most curious about Haskell is Alexis King’s “Parse, don’t validate”, which made me appreciate static typing when I’d never cared that much before. I apply Alexis’ ideas in Go, but Haskell expresses way more with data types, which sounds cool.

Haskell has lots of wacky features that feel like they’ll expand my mind like monads, infinite data structures, and algebraic data types, but I also feel like there might be a steep learning curve to becoming productive in the language.

The popular web frameworks seem to be IHP and Yesod. IHP seems to strictly require PostgreSQL, which is a dealbreaker, so I guess that leaves Yesod. But Yesod looks nice. There’s a free O’Reilly book for it, and the simple examples seem straightforward, if a bit alien in syntax.

Haskell / Yesod feels like the stack I should learn, but it doesn’t seem as fun as Elixir or Gleam.

  • Good
    • โœ… Rich, mature ecosystem
    • โœ… More powerful type system than any other language I know
    • โœ… Will maybe help me understand Nix
    • โœ… Lots of learning resources available (including for free)
  • Bad
    • โŒ Code looks kind of ugly to me, but maybe that’s just unfamiliarity
    • โŒ Learning curve seems steep
    • โŒ I’d become a weird Haskell person

Ruby / Rails ๐Ÿ”—︎

Ruby on Rails is attractive because I know a lot of people love it and feel incredibly productive in it. But looking at the language features, I’m not seeing anything that feels new or innovative coming from Python.

My impression of Rails is that it’s an opinionated framework, but the opinions are really good. Rails fans rave about how well the framework abstracts away toil without taking power or customizability away from the developer.

  • Good
    • โœ… Rich, mature ecosystem
    • โœ… Designed to scale down well
    • โœ… Lots of people seem to love it
  • Bad
    • โŒ No static typing
    • โŒ Ruby looks pretty similar to Python, so I don’t know how much I’d learn

PHP / Laravel ๐Ÿ”—︎

I’ll admit that I have an elitist aversion to PHP.

PHP and I had some fun together in college, but when I learned other languages, PHP just felt gross.

In the last few years, I’ve heard that PHP has matured and Laravel makes PHP web development feel professional and smooth, so I took a look.

I found it surprisingly difficult to find examples of basic Laravel apps. The Laravel docs show the commands for creating a basic app, but they don’t show what the code looks like or how it renders. I’m guessing that because part of Laravel’s business model is selling video courses via Laracasts, the public, text-based documentation isn’t so good (Edit: Laravel does not own Laracasts, although some Laravel core developers have published courses on Laracasts).

The closest thing to basic examples I could find were starter kits, which pull in React (no thanks), Vue (no thanks), or Livewire (don’t know it, but it’s in bad company). But it looks like Laravel’s built-in frontend solution is Blade Templates, which actually look pretty nice to me, as far as HTML templating languages go.

  • Good
    • โœ… Supports static typing
    • โœ… From a first glance, I like Blade templating
  • Bad
    • โŒ Language looks gross
    • โŒ I couldn’t find good written introductions to Laravel

Scala ๐Ÿ”—︎

I hear positive things about Scala. The language looks interesting and has a lot of features I’ve never experienced in a language. The syntax looks like a less verbose Java, which is nice.

Scala seems to be strongly object-oriented. I used to like OO, but after years of using Go’s much more restrictive OO features, I’ve come to feel like inheritance and polymorphism are more trouble than they’re worth.

It seems like the dominant web framework is Play, but reading through the documentation, it feels dated and Enterprise-y. The hello world tutorial opens with a complicated chart of Play’s architecture, which is super boring and does not make me excited to learn the framework.

Scalatra is another Scala web framework that focuses more on simplicity, but the documentation is pretty light on examples. Though there is an ebook I could buy.

  • Good
    • โœ… Interesting features around typing like variance annotations and compound types
  • Bad
    • โŒ Scala’s object-oriented aspects remind me of the bad parts of C++, though not quite as bad
    • โŒ Seems tightly entwined in the Java ecosystem, which I don’t enjoy
    • โŒ I can’t get excited about any of the web frameworks

Summary ๐Ÿ”—︎

Gleam feels like the best match for my goals and experience, with Elixir as a close second. Haskell is the language I should learn when I work up the courage and patience.

I plan to experiment a little bit with Gleam + Lustre and Elixir + Phoenix and see which one feels more interesting.

Read My Book

I'm writing a book of simple techniques to help developers improve their writing.

My book will teach you how to:

Read Michael's Book