6 ms·
In part, this is due to Haskell et al. are statically typed, which provides a higher safety guarantee than dynamically typed languages like erlang.
by meridional 11y ago
In part, this is due to Haskell et al. are statically typed, which provides a higher safety guarantee than dynamically typed languages like erlang.
- krat0sprakhar 11y agoAlthough this reason sounds plausible, it is quite surprising since one of the first functional languages - Lisp was dynamically typed.
- nilved 11y agoLisp isn't a functional language.
- vitno 11y agoThis person is getting downvoted... but it isn't. Lisp, especially in it's early implementations is highly imperative. This is why when people talk about Clojure they always talk about Immutability, it's part of what forces a functional style on the language.
- incepted 11y agoYou're both right and wrong, it's just that "functional" has a lot of different definitions and nobody can agree on which one is correct. As a result, "functional" has become pretty much meaningless when describing a programming language.
- catnaroek 11y agoFunctional programming has always been the name of a programming paradigm that treats computation as the evaluation of mathematical functions.
- incepted 11y agoThat's one of the many definitions we have for it, yes. Plenty of people will disagree with it too.
- sova 11y agoPlease correct me if I am off the right track here, but is not the distinction the fact that: in a "functional language" or maybe "parenthentical up-cup evaluating language" functions are invoked in an encapsulating way, and no state is kept between function-cup-up-segments-of-code, but there is a R.E.P.L that (replies) when you invoke a (parens) which is, in LISP-land known as a program. However, now that I have mind-dumped that ^ I recall haskell and erlang also being called "functional" but I don't know their syntax any more than a chimpanzee knows that the sun is round.
- catnaroek 11y agoFunctional programming is a programming paradigm that treats computation as the evaluation of mathematical functions. A function is a rule that assigns, to every element of its domain, a unique element of its codomain. Note that the above definition says nothing about how functions are to be evaluated: strictly, lazily, memoizing previously computed results, or using magic. No general-purpose programming paradigm can make such decisions for the programmer.
- seiji 11y agoThat's a very HN comment. Completely wrong but delivered with strong convictions. Lisp doesn't actually exist. Lisp is just axioms. You run an implementation of Lisp allowing various operations. Some flavors actually have (practically) zero mutability. You just create functions and cons cells and the rest of the world gets built on top of those. But, pure functional systems are useless (to be purely functional would mean you can't even do I/O... your program would just heat up the computer, which, in a way, is its own form of output, so you can't ever be fully functional). Every functional language gets non-functional at some point for data processing, bootstrapping, loading/saving programs, and the best functional languages even have optional mutability constructs for performance (see: !). You can't create the most performant data structures possible if all your operations require path copying, but mutability should be reserved for internal high performance library creation and avoided in business logic/application level code to make systems easier to reason about.
- catnaroek 11y ago> Lisp is just axioms. Do you even know what an axiom is? (In mathematical logic, of course.)
- goblinking 11y agoDo you even lift bro?
- dang 11y ago> Do you even Any comment that begins with that is unlikely to be a good fit for HN. Please post civilly and substantively, or not at all. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newswelcome.html https://news.ycombinator.com/newswelcome.html
- catnaroek 11y agoNot saying nonsense (“Lisp is just axioms”) is part of being civil.
- pjmlp 11y agoCS language papers from the 50 and 60 don't share that opinion.
- coldtea 11y agoIf you have been around 10 years ago, including on HN, everybody considered Lisp not only "a functional language", but "THE functional language". Heck, Haskell was barely ever mentioned. Not to mention that the whole idea of functional programming was introduced to the programming world with McCarthy and Lisp. (Except if you want to say that "Lisp is not functional, it supports many paradigms" -- but I find that tired. It is, at its core, functional).
- tel 11y agoJust to double down on the points of some other commenters here: "Functional" is a pretty difficult word to pin down these days. That said, there seems to be a clear camp in what might be better called "denotational" programming which centers around the ML-alike languages, the dependently typed languages, and Scala. Lisp is not much at all like these languages. Nor is Erlang, though it is vastly closer.
- catnaroek 11y agoI wouldn't call Scala a “functional” language. It's an object-oriented language that happens to be able to encode many Haskell idioms, with varying degrees of awkwardness. But you can write Java in Scala too, and, in the eyes of some, the result will even be more natural. Out of curiosity: Would you consider Prolog a language in which you can do “denotational” programming?
- joostdevries 11y agoI would call Scala a functional language. In the sense that object-orientation and FP are not eachothers opposite. Imperative and FP are. I guess awkwardness is in the eye of the beholder. I think it's an elegant language with which it is a joy to develop large code bases.
- catnaroek 11y agoI never said object-orientation and functional programming are opposites. (You can use objects to compute mathematical functions.) And, for that matter, imperative and functional programming aren't opposites either. (You can use imperative procedures to compute mathematical functions.) See: https://news.ycombinator.com/item?id=11180173 https://news.ycombinator.com/item?id=11180173 . The awkwardness I'm talking about comes primarily from the non-orthogonality of Scala's features. For instance, there are situations where subclasses and implicits are both reasonable alternatives for a given programming task. On the other hand, in ML and Haskell, it is often clear which language feature is the right tool for the job.
- deleted 11y ago
- akio 11y agoErlang does has static analysis though, through Dialyzer. http://erlang.org/doc/man/dialyzer.html http://erlang.org/doc/man/dialyzer.html