
Advanced Programming Languages (2009) - lelf
http://matt.might.net/articles/best-programming-languages/
======
krebs_liebhaber
> I don't do a lot of artificial intelligence, natural-language processing or
> machine-learning research, but if I did, Haskell would be my first pick
> there too.

This is definitely a dated article, since the obvious choice today would be
Python, but I have to wonder: why _aren 't_ the "more expressive" (which in
this post seems to be a synonym for "functional") languages used in these
fields? I don't have much experience with ML languages, but it seems to me
that something like Elixir (where the whole language is centered around pipes,
parallelization, and operating on data) would be ideal for data science with a
performant native library to back it up.

~~~
bregma
> why aren't the "more expressive" (which in this post seems to be a synonym
> for "functional") languages used in these fields?

90% of all programmers are cargo-culters whose knowledge of programming is
gained from the answers they cut-and-paste from Stack Exchange or Quora. This
is as true of "data scientisis" as it is of "web developers." The result is
that there is a network effect making certain answers determinant of the
language or monthly flavour of xxxScript that gets pasted most often, and
reduces the domain in which further answers are examined.

If you want it in simpler terms: the new dudes looked around and saw all the
cool kids were using Python and only a few boffins (UK) or nerds (USA) were
using anything else, so they knew who to crib the answers from if they also
wanted to look valley cool.

~~~
dahauns
If anything, Python in science is the opposite of cargo cult - it's more like
pragmatic to a fault.

Its ubiquituous in academia/science, has a low barrier to entry, and a large
amount and arguably often unmatched quality of specialized
libraries/frameworks/tools for all kinds of scientific fields. So the first go
to language/ecosystem will of course almost always be python.

I'm definitely not the biggest fan of Python (the language). And there
certainly are more elegant/fitting languages for many problem classes. But the
thing is, from my experience many people in the field are quite aware of this.
But it simply doesn't matter if it's the best _language_ from a developer POV.
It just has to be good enough to get the job done, apart from this the points
above are simply more imporant.

And it's hard to understate the importance of ubiquity in this case:

Python is the code equivalent of a lingua franca in science.

~~~
michaelcampbell
"large numbers of libraries" is almost a subgenre of cargo cult. You're not
programming, you're using code you assume does a thing because either it says
so or you saw someone else do; but not doing it yourself. Python is paying my
mortgage right now and I enjoy using it, but the community around it is no
more enlightened with respect to cargo culting than any other I've seen.

~~~
JoeAltmaier
Yes. So many developers think, I string together some APIs into something that
looks like an app, I've done something. Forgetting those libraries are
designed/tested to work only on whatever subset of the problem space they were
used for previously. They probably don't handle your case; they don't have
explicit capacity promises; they don't work together (don't respect each
others backpressure signals, don't understand each others error spaces etc).

I read open source, then extract the bits of IP I think was useful. Often
rewriting it to fit my case. Its useful source, but as an example to help me
write my app.

{ Please don't use Linux as a strawman (You rewrote Linux?! I don't believe
it!) That's the single largest, most successful (along with maybe 5 others)
open source project. But absolutely not representative of the 1M other
projects out there. }

------
marceloabsousa
"If, on the other hand, you're interested in enlightenment, academic research
or a start-up, the criterion by which you should choose your next language is
not employability, but expressiveness."

There is a big difference between enlightenment, academic research and a
start-up.

For both academic research and start-ups, employability is a very important
component:

\- Doing academic research on "non-employable" languages decreases the impact
of your research and your own employability;

\- In a start-up, you want to pick a language where you can be productive with
your team members, with an healthy community, and where you won't have hiring
problems because you're using an "advanced" programming language.

~~~
TomMarius
> \- Doing academic research on "non-employable" languages decreases the
> impact of your research and your own employability

That is not a metric for choice of language for academic research at all. The
academic research itself is a job, paid with public money, and you better not
hinder it with your career plans. Most computer science research is not on
languages itself, so you need a language expressive enough to allow you study
whatever computer science concept you need to study; it's mostly C and Haskell
around me, but I can't imagine my friends going into embedded C development -
the C they write is very different, as are the practices.

~~~
marceloabsousa
I was referring to academic research in software engineering or PL related
areas.

I think your view of academic research is nice but perhaps a bit naive.
Academic research in most countries is filled with pressure from private money
to achieve valuable outputs to feed the private sector.

~~~
TomMarius
Huh, that's not the reality around me, in CZ/SK/DE/AT/PL in EU.

~~~
newen
In US universities in machine learning fields, a lot of labs work with private
companies or do interships during summer at private companies and the grad
students eventually graduate and get a job at the private company. Software
engineering research might be similar but not sure.

------
goto11
Every developers should know at least two languages (more is of course better,
but two is the minimum for a professional). The optimal way to select:

(1) Learn the language which is most prominent or employable in your preferred
industry (e.g. Java for enterprises, Python for science, JavaScript for
frontend).

(2) Learn the language most different to the first, regardless of its
popularity and employability. Eg. Scheme if you know Java, Haskell if you know
Python, Assembler if you know JavaScript. (There will probably be some
disagreement about which languages are to most different to each other, but
you get my point.)

~~~
Koshkin
I think Python and C are simply a must, whatever the language you use in your
daily job and whatever else you might want to learn. You cannot seriously call
yourself a programmer if you are afraid of C, and Python is too useful as an
ad-hoc tool to be ignored.

~~~
pjmlp
Nice to know that those early years doing Z80, 8086, 68000 and Turbo Pascal
TSRs and demos wasn't programming.

~~~
badsectoracula
Koshkin wrote "if you are afraid of C" and IMO if you are writing assembly or
Turbo Pascal you wont (or at least, shouldn't) be afraid of C. Turbo Pascal is
pretty much at the same "level" as C with slightly more stronger typing and a
few extra bells and whistles, but things that cause people to be afraid of C,
like pointers and manual memory management, are still there.

~~~
pjmlp
Yeah, I commented on purpose, because that is what people should learn,
pointers and manual memory management concepts, the language to learn them
should be secondary.

Those that learn to abstract concepts from how they get expressed on the
language of the jour, are better prepared for change in this fashion industry.

I also never understood what it means being afraid of programming languages.

------
andybak
This article might need a date added. It mentions Ruby and Perl as "hot right
now"...

------
hota_mazi
> the criterion by which you should choose your next language is not
> employability, but expressiveness.

What a weird choice.

If you are looking for an out-of-the-mainstream language, you can't really
tell right away if a language is expressive or not before you actually dive
in.

Myself, I go for "exotic looking". I read the brief description of the
language, look at a few snippets, and the weirder it looks, or the most
foreign the main concepts are, the more I'll be interested in studying it for
a few hours.

The point is not to be expressive, it's to stretch my brain.

------
melling
I’m making an effort to learn Scala. It’s enough like Java that I can write as
I would traditionally so I quickly wrote a Word Search puzzle generator.

Next I’m going to try and write a second version in a more functional way.
Then a third...

First version:
[https://github.com/melling/WordSearchScala/blob/master/WordS...](https://github.com/melling/WordSearchScala/blob/master/WordSearch.sc)

------
zests
It would be interesting to see how the Scala section would change after the
release of Java 8 and especially the release of Kotlin. Java 8 introduced the
bare minimum functional programming support in order for the language to be
used functionally. Not to mention libraries came out like reactive streams
which essentially lets you write your entire code as chained function calls
inside of an error monad.

Kotlin then made functional programming a first class citizen. Java is clearly
recognizable inside of Kotlin under a bunch of layers of abstraction and
syntactic sugar. Once you learn Java you can learn Kotlin with minimal effort
and add more language features to your toolbelt as you get more Kotlin
experience -- similar to what the author says about Scala.

Kotlin is probably not as advanced as Scala, and admittedly I've never used
Scala, but it does seem to be taking some of Scala's market share.

~~~
marceloabsousa
"Kotlin then made functional programming a first class citizen" \- what do you
mean by this?

~~~
zests
In Java if you want to map a function over a list you write
`list.stream().map().collect()` and in Kotlin you write `list.map()`. The
functional programming APIs in Java are atrocious. Lambdas are much easier to
write thanks to anaphoric macros and other syntactic sugar. Data structures
are immutable by default. A big one that isn't mentioned often is that
functions can exist outside of classes so your code is not as tied to Java's
style of OOP.

------
quelltext
> it is possible to write an amb macro that "chooses" the right argument to
> make a subsequent assert statement be true.

I'm not too familiar with Scheme's macro feature but how would one go about
that? I was under the impression with macros you get to define what ever
syntax is part if the call, but here in order to achieve what the author
mentions the macro would need to be able to look at surrounding code, to look
ahead for the assert. How is this possible? Is he maybe talking of a compiler
plugin or a macro (not shown) that encloses the entire expression, e.g.
`(make-assert-true-macro (let ...{the code snippet}... ))`?

~~~
Xophmeister
I'm just thinking out aloud, so I'm probably -- if not completely wrong -- at
best sketchy on details! That being said, `amb` could be a function/macro that
uses a continuation in such a way that, when a failure is encountered (however
that may be defined), it can backtrace and try with the next value. By using
continuations with some encapsulation of the call stack, it doesn't need to
envelope the surrounding code and can just "rewind".

------
zozbot234
Finally, an article about PL's that doesn't mention Go or Rust!

(Oh, wait... the article is from 2009? Never mind then. Carry on.)

------
7thaccount
As many have indicated, this article is pretty dated now.

In some ways it argues for a thorium nuclear power plant when subsidized wind
is available. Yeah thorium is great, but we know how to do wind and the buy-in
is cheap right now. You'd have to invest a lot in thorium to make it worth it.

Forgive the crude analogy.

Also, the people building ML models and doing data science aren't always ubber
functional programmers, so Python is easier for them to get going with. Just
like the people writing Enterprise software find Java to be fine.

------
luord
> once the program compiles, it's almost certainly correct.

I'm pretty sure I've heard/read that remark about more than one language. It's
interesting how that "almost certainly" often means "around one percent of the
time" or the definition of "correct" is moved to a different goalpost.

Meaning, of course, that ultimately it is no different from any other
programming language: great coders will write great code and bad coders will
write bad code.

------
agumonkey
I'm really curious what 'advanced' will mean in 2030 ?

procedural programming fully gone and most programs being about metalevel
self-adapting (ml or else) parallel agents ?

~~~
petercooper
I'm only being half tongue in cheek here, but if you follow recent patterns
with the growth of functional languages, perhaps find something being
mentioned in the computer science journals in the 80s or 90s and imagine it at
a bigger scale and with a few twists ;-)

A reinvented version of APL? Some twist on visual programming? Prolog-style
logic programming with a built-in graph database? Or just stick 'quantum' on
the front of anything?

If you care to do such spelunking and guessing yourself, the ACM's currently
open library is a big help! For example:
[https://dl.acm.org/action/doSearch?fillQuickSearch=false&exp...](https://dl.acm.org/action/doSearch?fillQuickSearch=false&expand=dl&field1=AllField&text1=programming+paradigm&AfterMonth=1&AfterYear=1980&BeforeMonth=12&BeforeYear=1999)

~~~
agumonkey
Yeah good point, although I think the FP revival is reaching top of the
current wave. And you know, time and new things have a tendancy to be out of
the ordinary.

One thing that seems very near reality, is logical auto completion or partial
proover edition. Right now and IDE/typechecker will verify there's a logical
path between A and B, but maybe they'll try some capped graph search to find
possible paths when you need to compose some functions. I know I've seen
similar things at very small scale in high end cgi software. Their node
editors will introduce conversion nodes if you try to add scalar to a vector.

------
nromiun
I love learning new languages. But I have yet to see anything that looks like
the enlightenment in the article. Most languages gives you different ways to
accomplish the same tasks. Some languages make some tasks easier and others
hard. It doesn't really matter weather the language is hot, popular or
obscure.

------
zerr
Rust is an advanced language that might go mainstream.

~~~
krebs_liebhaber
I wouldn't call Rust an advanced language. It has some functional-inspired
features (everything is an expression, ADTs, composition/pipes with
iterators), but the language's _raison d 'etre_ is zero-cost abstractions, and
many of the features of Haskell and the like _require_ a GC and costly runtime
checks. See this post on why Rust doesn't have functors, monads, and the like:

[https://varkor.github.io/blog/2018/08/28/feasible-
functors-i...](https://varkor.github.io/blog/2018/08/28/feasible-functors-in-
rust.html)

~~~
zozbot234
Affine types are definitely an advanced PL feature, and the compile time
checking in Rust is largely based on them. ("Affine" meaning that values of
such a type cannot be implicitly copied, but can be implicitly dropped. One
reason why Rust doesn't yet have functors or monads is that it's not very
clear to what extent these would usefully generalize to such a construct.)

------
blunte
Especially in fast changing domains like tech, essays and blog posts must
state publish dates.

------
djhaskin987
I'm sick of the functional programming people telling us that they are better
than we are.

I have written lines of code in Scheme, Haskell, and Common Lisp. I regularly
code in Clojure. I like writing in functional languages too.

But every language makes trade-offs. The imperative languages generally try to
optimize for readability and speed. The functional languages are often
optimized for expression, the ability to easily express yourself to the
interpreter or compiler. There is a trade-off though. These languages all
trade high expressibility for slow execution times and steep learning curves.
This trade-off might well be worth the effort especially if the team is small
but it is a trade-off. It's not like it's objectively better to always program
in the functional languages.

~~~
c3534l
Most people are already familiar with procedural programming. If you want to
grow as a developer, don't just learn more of the same, learns something that
challenges you to work in a different way. If I only knew functional
programming, I don't think I'd understand half of what I understand now. It's
the fact that they accomplish the same things in very different ways that
allows me to see what it is I'm really trying to achieve in programming and
see different ways of doing that. The author even goes so far as to call these
niche. That's what they are: weird little languages that do things very
differently from what you're used to. There is no air of superiority in the
linked article.

------
codesections
2009

(The article is undated but was present on the Internet Archive in 2009,
[https://web.archive.org/web/20090106175608/http://matt.might...](https://web.archive.org/web/20090106175608/http://matt.might.net/articles/best-
programming-languages/))

~~~
bencollier49
Was going to say, the recommendations seem rather dated.

~~~
AnimalMuppet
What would you recommend currently?

~~~
jerf
In the spirit as written (i.e., not necessarily my personal from-scratch
list), drop Perl and Ruby [1], add Javascript (the language itself; not
necessarily any specific framework). Possibly add Rust to the list of
currently-somewhat-exotic languages... depends on how the author feels, it
doesn't 100% fit but it's not completely foreign either. (If you squint hard
enough, it as arguably the closest current entrant in the "Haskell, but
practical to actually use" contest... note I'm not saying it is the Platonic
ideal of such things, but the closest _currently existing_ thing.) Go is
debatably getting into the C++/Java/C# set. I'd also add a note that you don't
need to deliberately learn all of them; one from a given set is enough, pick
up any specific one you may need later on demand. Possible exception for C++
which is so funky that I'm not sure you can just "pick it up", but it's been
completely possibly to build careers in the industry without ever using it.
I'm 23 years in and still yet to touch it professionally.

[1] Neither may be "dead" but at this point I'd have a hard time recommending
either to a young person looking to get started. Python and Javascript are
both clearly better choices for that case in 2020; if you do encounter a Perl
or Ruby codebase you'll be able to pivot just fine from a strong grounding in
Python or JS.

~~~
rictic
If you've internalized many of the interesting ideas of Haskell, check out
Idris: [https://www.idris-lang.org/](https://www.idris-lang.org/)

It builds on the ideas in Haskell (and similar languages) and adds proofs and
first class types to the language. With it you can use the type checker to
prove almost any invariant about your code that you care about. So the obvious
stuff is there, prove that I never access an array out of bounds, sure. But
also: prove that this code obeys this network protocol (e.g. never sends
header before a successful handshake, never sends body before header has
completed, etc).

Ordinarily the best that you can do is expose an API that enforces these
constraints, but nothing is checking that the internals of the implementation
of that API uphold the constraints. With Idris you can move that into the type
system, so that changes that would introduce a protocol violation fail at
compile time.

It's wild! And that's really only scratching the surface. It's still firmly in
academia land, but the ideas present are fascinating and definitely worth
puzzling through.

The book is super good. It's well written, and introduces the ideas gradually
but in a satisfying way: [https://www.manning.com/books/type-driven-
development-with-i...](https://www.manning.com/books/type-driven-development-
with-idris)

