Live data from Hacker News

What Elm and Haskell are teaching mainstream JS [video]

begriffs.com

1–10 of 32 posts

Re: What Elm and Haskell are teaching mainstream JS [video]

#2
Reading the site's description of the video, it's more like "how languages like Haskell and Elm are informing the design of Javascript libraries like Redux". So it's not so much Elm and Haskell TEACHING "mainstream" JS (whatever that is) but one library merely taking hints from other programming domains that are relevant to the particular use case it's trying to cover.

Re: What Elm and Haskell are teaching mainstream JS [video]

#4

http://www.purescript.org/ Worth mentioning when talking about this topic. Purescript is a Haskell like language that was designed for the frontend. I'm surprised as it seems like the presenter doesn't even know about purescript.

PureScript is mentioned on one of his slides.

Re: What Elm and Haskell are teaching mainstream JS [video]

#5
It's nice that JS devs are continuing to discover functional programming techniques, but it irks me a little that this is considered to be some sort of new development. JS has always attracted SICP-inspired programmers because of its strong resemblance to Scheme.

Doug Crockford popularised prototypical inheritance and function programming techniques in JS on his blog nearly 10 years ago.

KnockoutJS has been around for a similar amount of time and data flow was a big part of its design. React and Elm are evolutions of design that has been a part of front-end dev for a long time.

Re: What Elm and Haskell are teaching mainstream JS [video]

#6
post #5

It's nice that JS devs are continuing to discover functional programming techniques, but it irks me a little that this is considered to be some sort of new development. JS has always attracted SICP-inspired programmers because of its strong resemblance to Scheme. Doug Crockford popularised prototypical inheritance and function programming techniques in JS on his blog nearly 10 years ago. KnockoutJS has been around fo…

First class functions are only one aspect of functional programming. Immutaility is a core feature which has only recently seen popular adoption in JS, with projects such as immutable.js. Out of the box JS doesn't offer the data structures necessary to code naturally in a Scheme-like manner.

Couple this with the new concept of Virtual DOM as pioneered in React and you get purely functional UI on the web, a radical departure from the status quo of just a few years ago. Defintely a new development for JS. Indeed, React Native suggests that this could be an important development for UI in general.

Re: What Elm and Haskell are teaching mainstream JS [video]

#7
As a year-deep front end developer, I have recently taken a strong interest in functional programming principles and am trying to learn their use-cases.

Does anyone have ideas for small projects I can complete that will really drive home the importance/benefits of functional programming?

Re: What Elm and Haskell are teaching mainstream JS [video]

#8
post #6
post #5

It's nice that JS devs are continuing to discover functional programming techniques, but it irks me a little that this is considered to be some sort of new development. JS has always attracted SICP-inspired programmers because of its strong resemblance to Scheme. Doug Crockford popularised prototypical inheritance and function programming techniques in JS on his blog nearly 10 years ago. KnockoutJS has been around fo…

First class functions are only one aspect of functional programming. Immutaility is a core feature which has only recently seen popular adoption in JS, with projects such as immutable.js. Out of the box JS doesn't offer the data structures necessary to code naturally in a Scheme-like manner. Couple this with the new concept of Virtual DOM as pioneered in React and you get purely functional UI on the web, a radical de…

Exactly. Vanilla JS (and JQuery and friends) have the semantics of mutating a tree (the DOM) in-place. A key differentiator of these functional libraries is the immutable data structure semantics.

Re: What Elm and Haskell are teaching mainstream JS [video]

#9

Reading the site's description of the video, it's more like "how languages like Haskell and Elm are informing the design of Javascript libraries like Redux". So it's not so much Elm and Haskell TEACHING "mainstream" JS (whatever that is) but one library merely taking hints from other programming domains that are relevant to the particular use case it's trying to cover.

On a podcast interview, the author of Redux mentions learning about Elm until later, so it's more like "some libraries have converged on similar design principles".

Re: What Elm and Haskell are teaching mainstream JS [video]

#10
post #7

As a year-deep front end developer, I have recently taken a strong interest in functional programming principles and am trying to learn their use-cases. Does anyone have ideas for small projects I can complete that will really drive home the importance/benefits of functional programming?

Read "Learn you a good haskell" - and practice the exercises in that book.

It helped me a lot to understand the practical side of functional programming.

For a book that maximizes the utility of functional programming in your everyday life I would recommend "functional javascript" by the famous author of underscore.js

Post reply on HN