Skip Navigation
143 comments
  • After years, and many languages, I still have to say Ada. Kotlin, Rust, Julia, and Nim are my current contenders to overtake, but here's what Ada does well enough to still be my preferred tool when appropriate:

    • strictness: typically my code works the first time it successfully compiles with few or no bugs. Rust is almost on par in this respect.
    • structure: a corollary of the above is that it forces me to "plan ahead" more than just "start coding" which I find fits my programming style better, and leads to better "Unix Philosophy" product designs. I haven't found any other language that has the same effect other than maybe Haskell.
    • speed: I honestly find that Ada code outperforms C/C++ code most of the time. The only times C/C++ outperform Ada is after optimizations that come at the cost of readability.
    • multitasking: Ada's first-class tasks and protected objects are the only way I've ever been able to write bug-free concurrent programs that are more complex than async/await and/or producer/consumer structures (and I took a dedicated elective on concurrency at university!). Kotlin is almost on par in this respect with its coroutines.
    • hardware: The fact that Ada basically ships with a hard real-time OS built-in and can compile to e.g. AVR means that all my fancy libraries I've written or saved work just as well for a desktop game, a website backend, or an embedded microprocessor. Just look into representation clauses and interrupt pragmas to see its unique powers.
    • design: The whole design of the language has lead it to be the only language where I can consistently return to a multiple year old passion project with no attempt to write maintainable code, and fully understand what its doing and modify it with little effort.
    • tooling: While this is the biggest downside of Ada (see below) gprbuild is still my favourite build tool. I have no idea why strongly-typed build systems aren't more common. Its always a joy to work in gprbuild, once you get gprbuild working of course.
    • static polymorphism: Ada's generics are some of the best I've found. But they have some limitations that leads us into...

    There are some situation where Ada shows its age:

    • static calculation: I love Nim (and Zig, etc) for the ability to run arbitrary code at compile time. It allows me to describe what would normally be an opaquely initialized data structure or code path in a clear and descriptive manner.
    • terseness: Ada is verbose, that's not such a big deal, but I find its just a tad too verbose which can lead to some slight difficulty when parsing code. func/proc (Nim) vs fun (Kotlin) vs fn (Rust) doesn't make much difference to me, but function X returns Y/procedure X starts to add a lot of visual noise to a file.
    • web compilation: The ability for both Kotlin and Nim to compile to either ASM or JS is AWESOME. If I have to write a "full stack" application, Kotlin multiplatform with ktor every day.
    • operator overloading: Only the built-in operators can be overloaded in Ada. It always makes me wish I could overload arbitrary operators. A small thing, but a symptom of...
    • TOOLING: Ada's tooling is BY FAR the hardest I have ever seen to get working. It takes the "eat your own dog food" too far. The fact that even in Arch Linux you have to install a bootstrap package, then the real package shows how hard it is to get a consistent build environment. ALR is helping in this respect, but is still not quite mature in my opinion.

    Here's when I use the alternatives, and their biggest weaknesses:

    • Kotlin: anything where I want both one or more JS artifacts and one or more JVM/native artifacts. Weaknesses: performance, static analysis, on the fence about tooling (gradle is cool, but sometimes seems too over-engineered), Biggest weakness: IDE dependency, writing Kotlin outside of IntelliJ is a pain, which is somewhat fair given who maintains it!
    • Rust: so close to beating Ada, if not for two things: ugly code - so many operators and glyphs that pollute the reading experience, maybe I'll get used to it eventually, but for now I can't scan Rust code, nor pick up and revisit it nearly as easily as Ada; language scale - I find Rust suffers from the C++ design attitude of "we can add this as a language feature" it takes too much mental effort to hold the entire design of the language in your head, which you sort-of have to do to develop software. Java and C are IMHO the undisputed kings in this respect. After reading through the specifications of both languages, neither will ever have any surprises in store for you. There's no magic under the hood or special case. All the cool features are done by libraries and rely on the same simple syntax. Every time I learn a new cool thing Rust can do, its at the expense of another edge case in the compiler that modifies my conceptual model of the code.
    • Julia: multiple dispatch and mathematics plus clean module design and easy unicode incorporation leads to clean code for math-y/science-y code.
    • Nim: templates and macros are excellent, concept system gives access to Rust-style traits without all of the additional "ugliness" of Rust, excellent performance, tiny executables. I just find that the syntax can get clunky. The UFCS easily cleans up a lot of the mess that Rust creates with its added features, since it keeps the parsing the same even when using some fancy language feature.

    Thank you for attending my TED talk :P. Any questions?

  • I'm a big fan of Rust.

    • Excellent tooling. The package/build manager (cargo) just works, the compiler's error messaging is simply unmatched and the IDE story is excellent thanks to rust-analyzer.
    • Rich ecosystem. There's a crate for almost anything you could need, and endless piles of learning resources.
    • You get the speed and low-level control (if necessary) of C/C++ without all the pain and legacy baggage.
    • The community tends to care a lot about correctness and API design, which is reflected in both the core language and the ecosystem. Rust doesn't try to hide complexity and pretend things are simple (like Go) - instead, it gives you the tools to manage it head-on.
      • Example: if a function can fail, then it returns a Result and you have to explicitly handle the possibility that something went wrong. There's no forgetting a null check and slamming face-first into a NullReferenceException or segfault in some other part of your code.
    • It's expressive. Iterators, generics/traits and other language features make it easy to communicate what's going on to both the machine and other humans. Even the syntax is designed to support this - you can tell a lot just by looking at a function signature.

    Obviously it's not all perfect, however.

    • Compile times can drag you down. (rustc is always getting faster, of course, but it'll probably never be as fast as Go or JVM/NET.)
    • It can be difficult to read at times, especially when code starts leaning heavily into generics and lifetime annotations.
    • Speed and control comes at a cost. No garbage collector means that anyone coming from a managed language (which, hello, that was me) is going to have to rewire their brain to deal with lifetimes, ownership and mutability XOR aliasing. You eventually develop an intuition for how to structure your code to play nice with the compiler, but that takes time.
    • New language features can take a long time to be stabilized and released. The advantage is they tend to be baked all the way through from day one, but the slow pace can be infuriating, especially when big ecosystem advancements are hung up on key additions.
  • Haskel, It's kind of hard to do some stuff which are easy in other languages but if you find a good problem to solve with it, it's amazing how expressive you can be and how short your code gets compared to all the boilerplate code you have to write with other languages.

  • Lisp.

    It just feels extremely natural to me, so it's difficult to pinpoint specific features I like. But two such features stand out: the parantheses-based syntax and the extreme interactivity.

  • I've used over a dozen languages, from BASIC to Haskell to C++.

    If I were starting a new project today, it would probably be in Go, or in Python with static typing using mypy. Unless the project was itself a language or something language-like, in which case I couldn't stay away from Haskell and monadic parsing.

    If I were looking to learn a language that I haven't worked in before, it would probably be Rust or Clojure.

    Go is really fast, works well with "the Unix philosophy" (although maybe I should say "the Plan9 philosophy"), and has pretty excellent tooling.

    Python is everywhere and there are libraries for everything. However, Hindley-Milner has been part of the CS canon for my entire life and there is zero excuse for a language not having type inference today.

    Haskell gives access to the best goddamn parser library ever: Parsec. Screw the category theory; combinators are the Correct formalism for parsers.

    (If you're still reading this: Read Graham Hutton's Programming in Haskell, second edition.)

    (I made the mistake in my last job of getting 80% of the way into writing a new tool — a "configuration as code" utility for configuring load balancers — before I realized that it was, in fact, a compiler and would have been much cleaner if architected as a compiler instead of as a glorified ETL tool.)

    Rust is what the Lemmy backend is written in, and I have terrible ideas of trying to stick my fingers in there and hope they're not bitten off.

    Clojure is what a few of the most productive programmers I know work in, so there must be something good in there. Also, it's been almost 20 years since I last used a Lisp for serious work.

  • It's a tie between Julia and Nim for me. Both have a high-level, readable syntax while also being natively very very fast.

    Julia is great for exploratory numerical/scientific computing, e.g., AI, simulations, etc. It especially has amazing math syntax and unicode character support, making for really elegant math code.

    Nim is a systems programming language, and I've been starting using it for embedded systems lately. I think it could be really good for running machine learning on embedded devices, as C/C++ are kinda miserable for that, but MicroPython is way too slow and not well suited for production embedded systems imo. Plus it compiles to C and C++, so you can compile it and run it on any device for which you have a working C or C++ toolchain.

  • I haven't done much with it at all but Dart felt nice while I was using it.

    Out of the ones I use often prob C#.

  • Oh my favorite is Crystal. It's a statically compiled dialect of ruby.

    It supports:

    • Most of the ruby goodness: custom DSLs, patching classes/mixins (monkey patching instances is not supported)
    • Compile time type checking (but it also uses duck typing)
    • Coroutines / fibers that work across multiple threads (multi-thread support is still experimental, but from my experience works well)
    • Possible to create small self-contained binaries (like go-Lang apps).

    As much as I love the expressiveness of crystal, there are a few cons:

    • It's slow to compile. Due to the dynamic nature of the language, the compiler needs to parse a lot of files (think C/C++) before it creates a binary.
    • The number of libraries is very immature at the moment. Crystal is a young language and is missing support for things like aws.
    • The library management mechism (called "shards" akin to ruby gems) is not great (in my opinion). There are helpful tools to create the scaffolding, but if you're pretty much stuck with the defined structure. For example you cannot have a single git repo that provides a library and an application that uses it.

    Other than that, the type checking but with ruby-like syntax is awesome!

    edit: fixed formatting

  • Perl. I can use it after awhile away without having to look up how to do things. It adapts to the best style for what I need to do.

  • HTML 4, cause I leaned it in 1998 when I was 10 and it's the only language I know (besides English) .

143 comments