Live data from Hacker News

Ask HN: Which functional programming language is the popular enterprise choice?

news.ycombinator.com

71–80 of 91 posts

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#71
post #2

I'd guess Scala is the most popular choice, but for nearly every language you'll find a company using it for at least parts of their products.

I like Scala, but it's still got mutable state, for loops, and lots of other imperative trappings. It's got some functional features, but I don't consider it to be a functional language (IMHO). If Scala is functional, then so are Ruby, JavaScript, and a host of other languages with higher order functions and the ability to be immutable, so long as you make the effort to not mutate anything (though anything is immutab…

> I like Scala, but it's still got mutable state, for loops, and lots of other imperative trappings. It's got some functional features, but I don't consider it to be a functional language (IMHO). If Scala is functional, then so are Ruby, JavaScript, and a host of other languages with higher order functions and the ability to be immutable, so long as you make the effort to not mutate anything (though anything is immutable by that logic). That doesn't make Scala bad. I actually enjoy writing it most days, but I think it's not quite accurate to call it a functional programming language.

Immutability != FP And "It's got some functional features..." isn't fair to say because other FP languages contain lesser features compared to Scala - which is an other thing.

> According to the Red Monk rankings, Haskell is close to Scala in usage. The learning curve is much higher, but I love writing it. I love the clean, simple code that Haskell pushes me towards, and it usually does the right thing the first time I run it. It seems to be gaining traction lately, and Stack has me excited about the possibility of things ramping up even further.

Haskell would be good if it could handle state and some basic features for code reusage - so we could create uis and everyday stuff seemlessly. But the real-real-world haskell code is beyond ugliness. It's nice when you start with it - creating fibonacci, Monad, little game loops etc. But when you want to create something...

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#72
post #61

Earlier quoted context omitted.

You mind pasting an example? I typically find higher kinded types, monads etc to be more of a pain than the problems they're solving (builders & constructors not really that painful IMO), but am really trying to keep an open mind.

Sure, here's an example with lenses, taken from actual code I've written: (for { _ This code will take an event, set it's duid, contexts and url. If you squint hard enough it almost looks like: originalEvent.duid = ... originalEvent.contexts = ... originalEvent.url = ... The thing that's cool about lenses is that they compose nicely. E.g., the contexts lens is defined as: val contexts: Lens[Event, Seq[EventContext]]…

another great thing is it's 'replayable'. If the event is stored in an atomic reference, you can get optimistic transactional semantics by running the state monad, comparing the results to the previous by using a CAS, etc. So you have free concurrent transactional semantics from using the state monad.

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#73
post #49

Earlier quoted context omitted.

The language is more restrictive and sometimes it's harder to get something working. Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win. People also have an emotional attachment to their existing tools and paradigms.

"Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win" Actually, you have it backwards. Enterprises care a great deal about long term maintenance and have large codebases. However, they are also very conservative and prefer the tried and tested approach. S…

Well their idea of maintainable is different. They often worry about having to hire intelligent programmers versus whatever mass produced workers.

Same thinking that leads to not using type inference because it's "harder to read".

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#74
post #61

Earlier quoted context omitted.

You mind pasting an example? I typically find higher kinded types, monads etc to be more of a pain than the problems they're solving (builders & constructors not really that painful IMO), but am really trying to keep an open mind.

Sure, here's an example with lenses, taken from actual code I've written: (for { _ This code will take an event, set it's duid, contexts and url. If you squint hard enough it almost looks like: originalEvent.duid = ... originalEvent.contexts = ... originalEvent.url = ... The thing that's cool about lenses is that they compose nicely. E.g., the contexts lens is defined as: val contexts: Lens[Event, Seq[EventContext]]…

Hey, thanks for filling in. So basically a facade over the original object only masking some fields.. yeah, not really my cup of tea personally, I'm fine with approx the same amount of code for a boring builder and/or constructor call to duplicate an object, or, if appropriate, a mutable object. But it's definitely nifty.

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#75
post #49

Earlier quoted context omitted.

The language is more restrictive and sometimes it's harder to get something working. Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win. People also have an emotional attachment to their existing tools and paradigms.

"Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win" Actually, you have it backwards. Enterprises care a great deal about long term maintenance and have large codebases. However, they are also very conservative and prefer the tried and tested approach. S…

I never compared enterprises to startups. I also wouldn't want to generalise. Some enterprises I know have millions of lines of Python code. Personally I'm skeptical that such a codebase is going to be maintainable and that they even 'care a great deal'.

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#76
post #67

Earlier quoted context omitted.

I don't think it's quite there, yet. Everything's in place, and Elixir is a wonderful language, but it hasn't been quite battle tested yet. On the other hand, Erlang is pretty ubiquitous behind-the-scenes, and I wouldn't be surprised if some enterprises do develop their internal software in it. On the third hand, since Elixir uses Erlang's runtime, it'll be subject to less required battletesting for the same reasons…

> JVM-based languages (like Clojure, Groovy, Scala, and JRuby) are quickly gaining popularity in enterprise environments that already use Java They are. Though of the 4 examples you gave, only Scala's really being used to build systems, though Clojure's being used by some who don't mind forgoing static typing. Groovy's a scripting language used for short test and build files, and for Grails. I don't think JRuby ever…

You might be right about Groovy. I've seen JRuby used pretty heavily in enterprise environments, though (usually to integrate Rails with an existing Java-based system).

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#78
post #49

Earlier quoted context omitted.

The language is more restrictive and sometimes it's harder to get something working. Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win. People also have an emotional attachment to their existing tools and paradigms.

"Of course the payoff is immense, you end up with much more maintainable and composable code. However I'm not convinced that many enterprises care much about these properties, as they are often more of a long term win" Actually, you have it backwards. Enterprises care a great deal about long term maintenance and have large codebases. However, they are also very conservative and prefer the tried and tested approach. S…

> If there were 3-4 large enterprise companies with 200kloc+ Haskell projects in use I feel Haskell could see long term 20-30% uptake in the enterprise

I would be very surprised if there were not tens of companies with 200kloc+ Haskell codebases. I know that one of them is an enormous enterprise (but the others that I know of are not).

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#79
post #50
post #27

Javascript / Nodejs it's multi-paradigm: scripting, object-oriented (prototype-based), imperative, functional ( source: https://en.wikipedia.org/wiki/JavaScript ) Many languages known as functional (Scala, F#, Lisp, Scheme, OCaml) are multi-paradigm languages (check out Wikipedia!), purely functional programming language like Haskell are the exception ( https://en.wikipedia.org/wiki/Purely_functional ). And the IO pa…

No IO in Haskell is purely functional. Your Haskell program wires up a computation that is eventually run by the runtime. The wiring up, as described in Haskell, supports referential transparency and composition as only pure code can. Your confusion may arise from people using the term "pure" to differentiate from "monadic".

All I meant is IO (aka input/output) can have side effects outside of the scope of the language environment. Haskell has the IO type to encoding those this side effects: https://wiki.haskell.org/Introduction_to_IO

Re: Ask HN: Which functional programming language is the popular enterprise choice?

#80
post #30
post #27

Javascript / Nodejs it's multi-paradigm: scripting, object-oriented (prototype-based), imperative, functional ( source: https://en.wikipedia.org/wiki/JavaScript ) Many languages known as functional (Scala, F#, Lisp, Scheme, OCaml) are multi-paradigm languages (check out Wikipedia!), purely functional programming language like Haskell are the exception ( https://en.wikipedia.org/wiki/Purely_functional ). And the IO pa…

All I can think is... Poe's Law. https://www.youtube.com/watch?v=ztVMib1T4T4

A CoffeeScript coder who apparently doesn't like JavaScript.
Post reply on HN