An exploration of languages of particular interest.
Idris is a purely functional language with:
- dependent types, where types can depend on values, such as encoding the length of a list in its type
- quantitative types, where you can specify how many of a value exist at runtime. This can be used to erase values at runtime, or ensure only one reference exists to a unique physical entity
- theorem proving, which allows one to guarantee certain properties of runtime values at compile time, such as an integer being within some bounds
Idris shares dependent types and theorem proving with Agda, but is designed for general purpose programming. It is inspired by Haskell, and uses much of the same syntax.
Rust gives the performance and memory profile of C, while guaranteeing memory and thread safety. It achieves this with an ownership memory model and its type system. It is often spoken of as having a steep learning curve, but I don't think this opinion is always justified. It simply enforces the rules you should learn in languages like C, but might not. Moreover, there are a number of ways of explicitly trading performance or safety for syntactic and conceptual simplicity.
Beyond the features of the language itself, Rust boasts an intuitive and reliable package manager, Cargo, as well as some of the best learning resources around, such as the book. I personally learnt Rust using a different book, Programming Rust by Blandy and Orendorff, which I consider amongst the best programming books I've read.
Scala was the first language I explored in depth, following the excellent Programming in Scala, as well as Functional Programming in Scala for the functional side. Scala is object-oriented with a very powerful type system, and supports both imperative and pure functional programming. It does this in an impressively coherent way (using Amin et al.'s DOT calculus, Scala 3's type system is provably sound). It encourages functional idioms, but allows imperative style to enable performant algorithms without sacrificing readability or comprehensibility. The ability to combine advanced FP and imperative constructs in a statically typed language makes Scala unique, though there are discussions in a number of other languages of achieving the same (e.g. in Rust).
A common feeling among developers I've spoken to is that Scala has too many features, too many ways of doing things, and that codebases can become a tangle of different styles and techniques. I wonder if the language may have been simpler, whilst retaining many of its advantages, if it wasn't object-oriented.
Python is the bread and butter of machine learning research, which is why I use it frequently. Python is great for prototyping and small projects: it's straightforward, flexible, and doesn't ask much of you, but presents limitations when you need to build something that will make good use of hardware resources, or hold strong, unattended, under heavy usage.