News for hackers. Stuff that matters.
Re:Clojure Design Patterns by modernerd on Friday November 24, 2017 @12:31PM (#15771928)
As Evan Czaplicki (creator of Elm) said:

“If functional programming is so great, why is it still niche? We have a product that can practically eliminate runtime errors, make refactoring much easier, lighten the testing burden, all while being quite delightful to use. What’s the hold up?”

- http://www.elmbark.com/2016/03/16/mainstream-elm-user-focuse...

I'm just getting into Clojure and enjoy working with it so much that I don't care if there are job opportunities at the end of it to justify the time investment and mind-reboot. It's the first language that I didn't feel like I was fighting, and Parinfer has made all those “weird parentheses“ a joy: https://shaunlebron.github.io/parinfer/

That said, there do seem to be more opportunities than last time I looked at Clojure/Scala/Haskell (Functional Works, mentions in HN Who's Hiring) – it feels like people are waking up to FP ideas after React stormed the front-end scene.

Re:Clojure Design Patterns by noncoml on Friday November 24, 2017 @03:00PM (#15772708)
> “If functional programming is so great, why is it still niche? We have a product that can practically eliminate runtime errors, make refactoring much easier, lighten the testing burden, all while being quite delightful to use. What’s the hold up?”

I think they are over-estimating how much people care about runtime errors.

Re:Clojure Design Patterns by hellofunk on Friday November 24, 2017 @06:40PM (#15773629)
I agree. I've worked in both Elm and ClojureScript. In one, I have to constantly deal with compiler errors. In the other, about as much runtime errors. The net time for error handling is the same. But the net time in actually writing code is in favor of ClojureScript, which requires at least half as many lines as Elm (and often much less than half).

Error handling is somewhat over-emphasized in comparison to other things that affect productivity (and maintainability).

Re:Clojure Design Patterns by threeseed on Friday November 24, 2017 @03:34PM (#15772872)
Especially on the JVM where most exceptions need to be explicitly handled and the ones that aren't can be handled in a way that doesn't impact users.
Re:Clojure Design Patterns by noncoml on Friday November 24, 2017 @05:16PM (#15773319)
elm-lang is a front-end only language compiled to JS(at the moment).

JVM doesn’t apply hence.

Re:Clojure Design Patterns by BoiledCabbage on Friday November 24, 2017 @04:08PM (#15773021)
> “If functional programming is so great, why is it still niche?

It's niche because learning a language is the exact opposite of fast iterative process with immediate feedback. The feedback cycle of learning and evaluating a language is 6th months to multiple years, which means it takes a lot to really evaluate one. Then the added issue of network effects (ie needing others to know the language in a team).

Re:Clojure Design Patterns by StreamBright on Friday November 24, 2017 @02:23PM (#15772540)
I am not sure it is niche anymore. Java 8 added many functional features to Java. :)
Re:Clojure Design Patterns by allover on Friday November 24, 2017 @04:46PM (#15773199)
Functional 'concepts' are not niche, but functional languages still are. If you asked your average Java 8 programmer or JS programmer to write an app in Haskell or Elm, they'd struggle.
Re:Clojure Design Patterns by jwdunne on Saturday November 25, 2017 @03:05AM (#15774967)
I'd consider myself an average JS programmer and would love to try writing web apps in Haskell. I've spent some time on Haskell books, fell in love with the type system, got a basic understanding of monads but found it difficult to "move forward".

I think the issue for me is I predominantly build web apps. Can you recommend any resources for building modern web apps in Haskell or at least fitting it into my day to day at work?

Re:Clojure Design Patterns by ff_ on Saturday November 25, 2017 @04:14AM (#15775158)
Try PureScript! [1]

Haskell-like (but taking away some of the pain points), for the frontend, compiles to very readable javascript.

[1]: http://www.purescript.org/

Re:Clojure Design Patterns by jwdunne on Wednesday November 29, 2017 @01:57AM (#15805139)
That looks really cool :) does it still depend on Bower?
Re:Clojure Design Patterns by ff_ on Thursday November 30, 2017 @12:44PM (#15817707)
There's no "dependency" per se, but in practice most of the community still uses bower.

There's an effort to make something better and on the same vibe as Haskell's `stack`, which is `psc-package` [1].

I switched to it for all new projects, and while it still has some rough edges, I don't really miss bower.

[1]: https://github.com/purescript/psc-package

Re:Clojure Design Patterns by hellofunk on Saturday November 25, 2017 @01:16PM (#15777083)
Unfortunately, does not use persistent data structures.
Re:Clojure Design Patterns by purescript on Saturday November 25, 2017 @01:55PM (#15777288)
Yes it does.
Re:Clojure Design Patterns by hellofunk on Sunday November 26, 2017 @02:44AM (#15779881)
So did C++. But you can't program C++ or Java in a functional manner the way you can an actual FP language. Largely due to lack of proper data structures for FP.
Re:Clojure Design Patterns by anon335dtzbvc on Saturday November 25, 2017 @01:10AM (#15774670)
why do we need Parinfer, why not dropping parentheses altogether in favour of itendantion
Re:Clojure Design Patterns by erik_seaberg on Saturday November 25, 2017 @01:30AM (#15774724)
If I type () I have every reason to expect you'll see them, because nobody foolishly writes tools that mangle them.