If you are creating a distributed system, then Erlang/Elixir is probably what will be the most productive and expressive language, bar none. Outside of that, ReScript has a lot of potential and Ocaml can be nice if you like that syntax instead.
Common Lisp!
It can be a little esoteric if you don’t have experience with the paradigms, but I’ve never used a language that felt more free.
On SBCL you have typing support, CLOS provides an OO interface, and it lends itself well to functional style programming (despite not having a type system as powerful as say Haskell). Additionally, the ecosystem is quite stable and mature, any library of functionality you might need is likely available.
Plain Old Human language. Remember comments? Remember moments when things get very complicated and docs and comments become your only help?
That mostly because none of the languages is the best. Some of them better in some places and worst in others.
For example: Java. Amazing library range, enterprise support and feature and community reach. Java also fail in shambles when you need a low level or guaranteed performance. Erlang. Robust distributed and fault tolerant. Now try to create something that is not network, agent oriented and should work locally only.
Every language has a niche. Look at javascript. JS is only exist because of it’s niche. It wasn’t good as a language, but it was the only one viable solution in it’s niche.
Same with assembly. Nobody sane would use assembly if it wasn’t that close to the metal.
There are time tested solution in every niche and it is wise to know why they still there and what drives them.
I think you took more effort into answering the “other side” of his question.
You are absolutely right. At first I just wanted to add my favorite language to the bunch, but then I realised that this isn’t really answering anything, because the use case matters most.
You can use any language to programm solution to any problem in any environment. And given that here we have many developers fixing many different problems we will end with just a collection of all possible languages and problem/solution permutation.
Language doesn’t matter. Solution and solution logic matter. And most times we are using a Plain Human Language to crate a solution and then encode it.
The qualities you describe are a function of the programmer’s talent and their familiarity with the language, not the language itself. So there are no ‘correct’ answers, just opinions.
IMO Scala is one of the best programming languages out there. I know it might sound like zealotry because Scala is already way past its hype curve, and the “Through of disillusionment” already caught a fair bunch in ways that more recent and hyped languages haven’t yet, but it’s not only still very relevant today, but more and more so (IMO).
So, what’s to like about Scala? Like most of things, those are two-edged swords:
1- multi paradigm
To my knowledge Scala is the only language that unifies object oriented programming and functional programming so seamlessly. You can pick the right tool for the job, opting for imperative-style where it’s fit and choosing elegant composable/curried when appropriate, without having to bend your mind as much as you would with Haskell/clojure/OCaml/F#/… where things are more one-sided. The downside is that different programmers will have different takes and preferences as to what’s the most adequate style might be, and a same codebase might look very different from one place to the other.
2- type system
Scala has one of the most advanced type system. Nothing Rust or Kotlin might match any time soon, or ever. Scala’s implementation of GADTs, combined with its powerful pattern matching enables concise and idiomatic abstractions. Many of which are zero-cost thanks to things like opaque types, inlining, tail recursion, … There is a whole area of the Scala community striving to make invalid states irrepresentable (your code won’t compile if your instance of a pizza is missing a topping), which makes such libraries self-documenting and easy to use. The downside is that nothing prevents you from climbing the abstraction ladder and encoding everything in the type system when all you need is a simple trait/generic, and that’s a human/complexity management problem tooling and the language can hardly mitigate.
3- scalable
The author of Scala (who was a long-time Java compiler architect) wanted Scala to scale from shells one liners to complex multi-cluster distributed systems, and delivered on that. You can start small with a scala-cli proof of concept, transition to a mid-scale “python with types” kind of project, and grow up to very large and complex projects. Beyond the JVM, you can target the browser with scala-js and share models and validation logic between the front and back ends. You can target native binaries for instant startup/low footprint executables that are cheap to spin-up as microservices.
4- has a foothold in academics
A whole team at the EPFL is pushing boundaries of programming languages and using Scala and its compiler as a ground for experimentations. Scala 3 has a proven sound type system thanks to its foundations on the DOT calculus. Effects and Capabilities are being researched as part of the project Caprese to offer a solution to “what color is your function” (mixing sync and async), of memory management/lifecycles (more generic than rustc’s), of pure/side-effectful code, etc. The downside is that this gives an impression that Scala’s development lacks focus, but arguably those happen in distinct development branches and by different people.
Anyway, feel free to continue the discussion on: !scala@programming.dev
Yeah … but Scala is insane, you can fundamentally redefine the behavior of reserved words.
Since when?
Scala lets you define new operators, but only in the sense that any method can be used in operator notation and method names don’t have to be alphanumeric (e.g.
++
is a valid method name).Scala lets you quote reserved words in order to use them as identifiers. They’re quoted, though; an unquoted reserved word cannot be used as an identifier.
Several Java operators, including
instanceof
, are just methods in Scala. They are special in that they arefinal
and don’t cause NPE when called onnull
, but they are not reserved words and can, for example, be used as local variable names.Scala isn’t insane, just misunderstood. Its build tool, on the other hand… 😬
Scala isn’t insane, just misunderstood. Its build tool, on the other hand… 😬
Good thing is, mill brings a lot of sanity into this space. It’s been years since I’ve had to use sbt on a regular basis, and every time I looked at it since was with incomprehension and disgust. I don’t think sbt is improving in ways that makes it friendlier. Nowadays scala-cli is all the rage, and deserved (IMO).