Hacker News new | comments | show | ask | jobs | submit login

+1 for your thoughtful reply.

I've tinkered with other functional languages (Erlang, Scheme and Clojure), but Haskell is a stranger beast.

Scheme, Clojure, and most of Erlang are on an entirely different side of a fairly large chasm within the lay term "functional programming". Haskell, ML, Ada, Coq, and even some parts of Scala are just entirely different beasts. The underlying math is far more pronounced, leadi to new terminology and power.

Ada?! It's purely imperative, type-safe language, no? At least that was the impression I got when it was forced on me at university.

Also, ML? I know OCaml a bit, but according to this comparison: http://adam.chlipala.net/mlcomp/ Standard ML has a "ref" type, which in effect allows mutable state. While it lack a bit of a syntactic sugar for this, OCaml's mutable record fields are implemented in terms of refs, so in the end SML isn't "more functional" in this than OCaml. Also, according to this answer (didn't check specs) SML has at least a WHILE loop: http://stackoverflow.com/questions/818324/loops-in-sml-nj which is typical to imperative languages. OCaml makes no attempt to outlaw side-effect (I suppose SML is similar), it allows them explicitly by introducing functions which return () (unit type), which are called purely for their side-effects. There is even List.iter function, which accepts a function executed for each element only for side-effects. And side-effects are not restricted in any way.

On the other hand Erlang has nothing like that - no loops, no mutable state in the language and it's side-effects are restricted to message passing.

While Scheme and Clojure, too, allow mutable state and non-pure functions, the default is immutable and pure for almost everything. In Racket the most used data-structure, a pair (and lists by extensions) is immutable by default and all the functions working on pairs and lists are pure. There is another type, "mutable pair", which is used to construct mutable lists, but I haven't seen it used yet.

Coq is not even turing complete.

Anyway, I much prefer talking about "functional style" than "functional programming"/"functional languages". If you think that one cannot use monads outside of Haskell - you're wrong. The same applies for lazy evaluation, which is available in many languages as extension or special syntactic construct in the language itself.

EDIT: I realized that parent probably thought of AGDA instead of ADA. And so I just installed it to check it out :)

I use Ada (a proper noun) regularly. It is not a functional language, but encourages a lot of the same things that functional people like to talk about. Ada is a wonderful language to use. It's rather boring and uneventful and is not accompanied by buzz words, but most of the Ada folks I know (converts or otherwise) all suggest that they're accomplishing more in less time with fewer bugs than they get with other languages. A lot of the new, buzzy languages seem to be solving problems that Ada took care of in the 80s and 90s. It's definitely worth a look if only to improve your approaches to software.

Edited for fun and grammar!

Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact