
Ask HN: How will pure functional languages impact the web? (PureScript and Elm) - hultner
I&#x27;ve lately had some experience functional languages targeting web browsers, such as Elm[1] and PureScript[2] which feel very native to the web. Then there&#x27;s some pure Haskell Compilers such as GHCJS[3] and Haste[4].<p>So now I&#x27;m wondering how HN readers think this will impact the future web environment?<p>[1] http:&#x2F;&#x2F;elm-lang.org&#x2F;<p>[2] http:&#x2F;&#x2F;www.purescript.org&#x2F;<p>[3] https:&#x2F;&#x2F;github.com&#x2F;ghcjs&#x2F;ghcjs<p>[4] https:&#x2F;&#x2F;haste-lang.org&#x2F;
======
itamarst
They won't impact the web because they have no side-effects.

(Sorry, couldn't resist the joke.)

~~~
purescript
Just model this as taking an old, immutable web to a new one.

    
    
        impact :: Web -> Web
    

Persistent data structures will let us reuse the best parts of the old web
efficiently.

------
dreamdu5t
In the short term, not much because there is a lot of inertia behind
organizational programming knowledge, and the target runtime influences
language choice (why JavaScript has become popular).

In the long term, I think expressive type systems will dominate programming.
Simply because they allow programmers to provably generate correct programs
without bugs. If the industry always used languages with a type system
expressive enough to fit their needs, horrible errors like WannaCry would be
eliminated (a classic buffer over-read due to programming with inadequate
types). Of course, pure functional languages are at the forefront of type
systems, though they aren't mutually exclusive (Rust for example).

------
hultner
Update: Links in the article isn't clickable so I've attached them below as
well.

[1] [http://elm-lang.org/](http://elm-lang.org/)

[2] [http://www.purescript.org/](http://www.purescript.org/)

[3] [https://github.com/ghcjs/ghcjs](https://github.com/ghcjs/ghcjs)

[4] [https://haste-lang.org/](https://haste-lang.org/)

\------

I've previously been programming in Haskell and lisps before that so I have
some experience with functional programming. From my experience the Haskell to
JavaScript compilers aren't great in practicality as they provide a quite
clunky developer experience and does not feel native to the web.

Elm and PureScript however integrates almost seamlessly and Elm in particular
provides a smooth developer experience. I also find a nice resource[1] which
eases the transition for a haskell developer.

Would love to hear your thoughts!

[1] [https://github.com/eeue56/haskell-to-
elm](https://github.com/eeue56/haskell-to-elm)

