Future-Proof Programming Languages

3 months ago 4

February 11, 2022

After some rapid progress on projects such as md2blog, everything has come to a screeching halt while I struggle with making future-proof technology choices. This post is specifically about programming languages.

I want code that I write to continue being useful to me in the future. Specifically, I want to be able to:

  • Run my code
  • Recompile my code (in case I end up on a new platform)
  • Reuse my code in other projects
  • Do all of the above with a minimum of hassle (and no multi-gigabyte downloads!)

And this is why I'm stuck on trying to find a comfortable, future-proof programming language.

Here are some ideas on what indicates that a programming language will persist well into the future:

  • Availability of open source compilers and tooling (ideally multiple implementations that are mutually compatible)
  • Support for many platforms
  • Broad usage (both in open source projects and industry)
  • Actively maintained standard library
  • No breaking changes (ideally)

Of course, I'd also like the programming language to be convenient and comfortable, so I'll add to my wishlist:

  • No multi-gigabyte downloads just to get started
  • Not tied to a single platform/environment/tool set
  • Small and simple (in case I want to build my own tools)
  • Easily cross-compiled
  • Simple and transparent build process
  • Readily available libraries (either with source available or from reputable contributors)
  • Ergonomic editing

According to Stack Overflow, the most popular programming languages are:

  1. JavaScript
  2. Python
  3. Java
  4. TypeScript
  5. C#
  6. C++
  7. PHP
  8. C
  9. Go
  10. Kotlin
  11. Rust
  12. Ruby
  13. Dart
  14. Swift
  15. Objective C
  16. Scala
  17. Perl
  18. Haskell
  19. Clojure
  20. Elixir
  21. Lisp
  22. Zig (not actually on the list)
  23. Lua (also not on the list)

Now it's time to ruthlessly eliminate popular programming languages.

Some languages are mostly tied to a particular platform, so they get cut:

  • PHP
  • Kotlin
  • Dart
  • Swift
  • Objective C
  • Scala
  • Elixir

Java and Perl I have experience with, and frankly, they're too cumbersome, so I won't investigate them further.

After some initial pruning, here is the list with my initial thoughts:

  • JavaScript/TypeScript: lots of implementations and modern JavaScript is nice, but no standard library; TypeScript brings some sanity to the language
  • Python: I don't like setting up Python environments, but it's ubiquitous!
  • C#: a great language and standard library, but how much of it is open source? Is it portable? Can I run .NET on a Raspberry Pi?
  • C++: terribly complex, but modern C++ is surprisingly convenient; the build systems are generally awful, though
  • C: probably the most portable and future-proof language ever created, but not very ergonomic
  • Go: "goroutines" seem great and I've heard the tooling is nice, but a garbage-collected language with C-like verbosity doesn't sound convenient for quick prototyping
  • Rust: new and popular, with an appealing memory model, but there's really only one implementation and my first experience setting Rust up on Windows did not go well
  • Ruby: less popular than Python
  • Haskell: it's been a while since I used a purely functional programming language
  • Lisp/Clojure: I love the simplicity of Lisp (namely Scheme), but I have doubts about it being convenient and portable
  • Zig: probably too new and with too many breaking changes, but I like the idea of a more sane alternative to C, and the Zig compiler is very convenient
  • Lua: I used to love Lua, but TypeScript just seems so much more popular and productive these days

Given that this list is already too long, I'm going to eliminate a few options without proper due diligence (either based on prior experience or based on the belief that similar but superior options exist elsewhere on this list). Apologies to the following languages that have been cut:

  • Ruby
  • Haskell
  • Lua

For the next round, I'll do more research and hopefully play around with the languages I'm unfamiliar with.

Some initial thoughts on the languages I'm familiar with:

  • TypeScript: comfortable and convenient, but memory usage and (lack of) parallelism are concerns
  • C#: can this run on a Raspberry Pi? How much of the standard library is closed source?
  • C++: is there C++ environment that is quick and easy to setup?
  • C: a frontrunner, despite its numerous problems

And here are the languages I need to investigate further:

  • Python
  • Go
  • Rust
  • Lisp/Clojure
  • Zig

That's as far as I've gotten. My next steps are to see if C# is viable, determine if there's a convenient C++ environment, give Python yet another try, and then play around with Go, Rust, Clojure (or other Lisps), and Zig.

Read Entire Article