標籤:

為什麼 Haskell 始終沒法流行呢?

要說難學好像不比 Lisp 和 C++ 難啊


我還是推薦看一下這個:

The Economy of Programming Languages OpenClassroom

看下A History of Haskell , Every Language Fixes Something, Haskell的誕生本身就是出於研究目的的, 並沒有想去解決工業界的什麼痛點或者難點(如果有軟體危機也不是單靠換個語言來解決的), 而且Haskell跟流行的語言一點都不像.

老實說到上個世紀或者GHC沒有主導Haskell實現之前(嚴重地說可以到2010年), Haskell的生產力(不是語言表達力, 主要是庫), 培訓成本跟主流的語言還是有不少差距, Real World Haskell算是個裡程碑, 然而現在也已經過時.

主流語言的變化也逐漸變快, C++/Java也吸收了很多函數式編程語言里的元素, Rust也把之前不少PLT研究積累的成果工業化. 雖然Haskell沒有進入主流但是也影響了不少其他語言, 像Java, Swift里的Option, Elixir里的with都脫胎於Haskell的Maybe Monad, 還有coffeescript之類的語言

然而Haskell裡面各種概念的演變發展是一般的程序員沒法想像的, 要讓所有程序員理解Monad的怕是要寫無數個"深入淺出"的教程, 以及各種以"如何理解", "怎麼用簡單的語言"開頭的知乎問題還有下面無數不同觀點的答案, 何況還有free monad, comonad, functor, applicative... 各種東西.

至於一些"政治文化"因素Philip Wadler寫過些文章來探討:

Wadler: Functional Programming

--

P.S 還是有公司用Haskell的:

Haskell in industry

Case Studies

FP Complete · GitHub

Zalora · GitHub

Galois, Inc. · GitHub

Silk · GitHub ;;;

Soostone Inc · GitHub

Helium Systems, Inc. · GitHub

facebook/Haxl · GitHub ;;;

Well-Typed LLP · GitHub

Tweag I/O · GitHub

Anchor · GitHub

Tsuru Capital · GitHub

biegunka · GitHub

capital-match · GitHub

Ambiata · GitHub

Scrive · GitHub

Haskell Blockchain Company, BlockApps, Partners With Microsoft BlockApps · GitHub

Haskell in Production at Wagon


記住SPJ的教誨:

Avoid success at all costs.

詳細解釋:

RM:

Tell me about Haskell』s unofficial slogan: avoid success at all costs. What』s the origin of it?

SPJ:

I mentioned this at a talk I gave about Haskell a few years back and it』s become quite widely quoted. When a language becomes too well known, or too widely used and too successful - certainly being adopted by Microsoft means such a thing - suddenly you can』t change anything anymore. You get caught and spend ages talking about things that have nothing to do with the research side of things. Success is great, but it comes at a price.

I』m primarily a programming language researcher, so the fact that Haskell has up to now been used for just university types has been ideal. Now it』s used a lot in industry but typically by people who are generally flexible, and they are a generally a self selected rather bright group. What that means is that we could change the language and they wouldn』t complain. Now, however, they』re starting to complain if their libraries don』t work, which means that we』re beginning to get caught in the trap of being too successful.

出處:Simon Peyton Jones: Geek of the Week


Haskell 相比更冷門的比如 coq 已經很流行了,外面的「野蠻」語言也在從他借 feature


多流行算流行。。。


最流行的fp語言可能是clojure,Scala和erlang三門,接下來就是haskell,其他都是各有特色但非常小眾的圈子

題主你長期觀察reddit和stackoverflow就知道了。ocaml,common lisp 和 racket 的人氣一塊加起來也未必能比上haskell

所以,在fp的範圍內,haskell已經算是很流行了

haskell的流行離不開spj的個人魅力以及它自身的社區屬性,要是Xavier有spj那種營銷水平,ocaml至少也是和haskell二分天下啊。「盡量避免成功」只是spj風格的一種幽默而已,表明ghc社區擁抱變革與進步的一個決心,千萬別當真了


不難學…?除了Haskell好像沒別的語言需要那麼多數學知識作為基礎吧。。

C++雖然難,但是完全可以當C with Class寫…

Lisp不難吧?

Erlang都沒流行,更別提Haskell了……


Lisp 哪有 C++ 和 Haskell 難學啊...


推薦閱讀:

Robert Harper 不支持Haskell 的理由是?
Haskell 最有代表性的一段程序是什麼?
國內有哪些公司用Haskell做網站後端的?
Haskell 有哪些威力十足的庫?
有沒有比較實用、成熟的 Haskell 應用?

TAG:Haskell |