
Advanced programming languages (Haskell, Scala, SML, OCaml, Scheme) - gnosis
http://matt.might.net/articles/best-programming-languages/
======
Locke1689
_In fact, experienced functional programmers become adept at encoding
correctness constraints directly into the Haskell type system. A common remark
after programming in Haskell (or ML) for the first time is that once the
program compiles, it's almost certainly correct._

A difficult position to defend but the reason I end up favoring strictly typed
languages over dynamically typed (I'm ambivalent about duck-typed, so Python
ends up being my favorite language for other reason). I love Haskell, as you
may be able to tell.

~~~
DenisM
Here's an argument I always use in such cases:

Imagine this setup: You use a fully dynamically typed language. You write unit
tests and ensure 100% code coverage. You run those unit tests during the build
phase.

Now, is there really difference in terms of guarantees that can be given about
the app after it compiles? This arguably gives you _better_ guarantee than
static typing because it is also protects you from variety of errors such as
using one expression of type FOO in place of another expression of the same
type.

~~~
camccann
_You write unit tests and ensure 100% code coverage._

That sounds like a lot of extra effort; it would be nice to automate the
testing a bit. Maybe some sort of simple declarative system to check that the
code obeys certain constraints. Ideally, you could make your auto-test system
clever enough to actually deduce a lot of the constraints itself, based on the
structure of the code--you'd really save time that way! Then you could focus
your effort on just testing the things your auto-testing system can't check.

I wonder if anything like that exists?

~~~
DenisM
It might be more effort, but having tried it I can tell you it's not _that_
much effort. It also has tangible benefits in that it forces you to think
through the edge conditions, leads to better interface abstractions and
reduces fear of making changes. I don't want to turn this into religious
thing, but if you never tried this I encourage trying it out at least once.

As to your question, that sounds very much like Haskel. They even have a
search engine that lets you search library functions by type signature, and
often time you find the right function just based on that.

~~~
fauigerzigerk
The problem is that 100% code coverage is not nearly enough. Take this Python
function:

    
    
      def f(x, y):
        return x + y
    

and this test function:

    
    
      def test_f():
        assertEqual(2, f(1, 1))
    

There you go, 100% code coverage. Unfortunately we have covered next to 0% of
what could possibly go wrong here.

~~~
DenisM
But we also covered a lot more than a static type check could cover at compile
time, right?

~~~
Locke1689
Like f("2",1)?

------
alrex021
Surprised that Erlang is not in that list.

~~~
gnosis
I don't think it's supposed to be an exhaustive list. There are thousands of
programming languages, and (arguably) hundreds of them could be considered
"advanced". I think this is meant to be more of a sampling.

Still, given all that, Erlang would be on _my_ list. :)

------
magoghm
I'm very surprised that Clojure isn't mentioned.

~~~
aerique
Why, because it's the hyped language du jour?

I actually found it well-written compared to other such articles that have
been linked here before. Although it should have been called "Functional
languages every programmer should know."

My personal list would include: Erlang, Forth, Scheme, Haskell, Prolog and
omit Scala and *ML.

Why Clojure when Haskell and Scheme have already been mentioned? I think the
latter two are more educative than the former.

~~~
magoghm
Because the author seems to like both functional languages and Lisp.

~~~
aerique
Okey, good point :-)

