Live data from Hacker News

Ask HN: Which functional language has the best ecosystem for a web backend?

news.ycombinator.com

41–50 of 80 posts

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#41

Earlier quoted context omitted.

There’s a huge difference between being a functional language and supporting functional paradigms. Nearly every major language does the latter, but if you consider immutability a key functional feature, for example, you’ll sorely miss it when the language doesn’t really support it.

You don't need the language to enforce immutability. If the project is small enough, you can enforce it yourself with a linter or by hand.

Or use something like Immutable.js, but enforcing immutability on anything but a tiny project is likely to go awry. Takes a lot of discipline from everyone involved.

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#42

Today I would say Java/Scala mostly because of jvm access to huge numbers of libraries. But also because of things like Akka. There may be other options depending on whether you consider JavaScript or Go to be a functional language.

There may be other options depending on whether you consider JavaScript or Go to be a functional language.

Do you consider Java a functional language?

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#44

Eco-system-wise you might want to try compiling from a functional language to JS and target Node.js -- Bucklescript or GHCJS would be my choices. That way you get access to all of the libraries on NPM.

I like Fable https://github.com/fable-compiler/Fable

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#45

I find .NET Core (particularly ASP.NET Core with F# via Giraffe - https://github.com/giraffe-fsharp/Giraffe ) extremely good since Microsoft went all open source. I have multiple backends running in a GCloud Kubernetes cluster and develop all my stuff from a non Windows environment. Couldn't be more happy and the speed of ASP.NET Core with Giraffe is fantastic (~100K r/s).

I'd like to add that with F# you get all the benefits of an extremely mature web stack with asp.net core and a huge eco system of very high quality libraries. Frameworks like Giraffe, Suave or Freya make it all possible to write your backend in a functional idiomatic way. Also a big plus for F# is the choice of top notch tooling. You've got Visual studio which works on Windows and Mac, then JetBrains Rider which is awesome and Visual studio code with the Ionide extension. I'd highly recommend anyone to go and check it all out!

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#46

Today I would say Java/Scala mostly because of jvm access to huge numbers of libraries. But also because of things like Akka. There may be other options depending on whether you consider JavaScript or Go to be a functional language.

The only circumstance under which I can imagine someone calling Go "functional" is that, yes, it has first-class functions and closures. But if that's your definition of functional, the term is almost useless because in the modern language landscape, there's pretty much just two or three languages that would not qualify as functional. Sure, they happen to still be the top 3 languages (Java, C, C++), but that would make the entire rest of the landscape functional. Java of course recently grew closures, and C++ has... things... you can do if you really want closures, which would really leave only C as not having closures. Though if you're willing to go so far as to call Go functional, you're not that far from calling C functional because it has function pointers. (In 2018, that may not sound that impressive, but in the 1970s that put it at "at least modestly functional" by the standards of the time.)

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#47
I'd say that in terms of ecosystem, anything running on the JVM is probably going to be the broadest; that is, you'll have the most choices (mostly Java libs and frameworks) to decide from. In terms of functional libs/frameworks, that number will drop a lot, but in practice you'll probably have what you need.

If the JVM or Scala/Clojure doesn't sound like a good time, F# is a good option (I'm biased as I work on it). The ecosystem is similar in that most libs/frameworks on NuGet are for C# developers, but in practice you really won't need them for a web service. Giraffe, Suave, and Freya are three choices that will run on .NET Core today.

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#48

I'd say that in terms of ecosystem, anything running on the JVM is probably going to be the broadest; that is, you'll have the most choices (mostly Java libs and frameworks) to decide from. In terms of functional libs/frameworks, that number will drop a lot, but in practice you'll probably have what you need. If the JVM or Scala/Clojure doesn't sound like a good time, F# is a good option (I'm biased as I work on it).…

Out of these 3 (Giraffe, Suave, and Freya) which one do you recommend to a F# newbie?

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#49

I find .NET Core (particularly ASP.NET Core with F# via Giraffe - https://github.com/giraffe-fsharp/Giraffe ) extremely good since Microsoft went all open source. I have multiple backends running in a GCloud Kubernetes cluster and develop all my stuff from a non Windows environment. Couldn't be more happy and the speed of ASP.NET Core with Giraffe is fantastic (~100K r/s).

I'd like to add that with F# you get all the benefits of an extremely mature web stack with asp.net core and a huge eco system of very high quality libraries. Frameworks like Giraffe, Suave or Freya make it all possible to write your backend in a functional idiomatic way. Also a big plus for F# is the choice of top notch tooling. You've got Visual studio which works on Windows and Mac, then JetBrains Rider which is a…

I am also leaning towards F#. What do you use for json serialisation? Any guide which describes basic steps to put together a web api.

Re: Ask HN: Which functional language has the best ecosystem for a web backend?

#50
post #20
post #15

Clojure! the thing I like most about a lot of the libraries is how they seem to blend so seamlessly. I don't know if it's an artefact of just being a lisp or just a lot of the developers sharing a mindset, but the whole experience feels less janky.

agree. Once I discovered Clojure, it's all kinds of fun to write in! The community is great. The ecosystem now has plenty of robust libraries to handle most any heavy-lifting task(s). If you want to play around with getting up and running with a functional clojure backend, I put up this: https://github.com/tuddman/moarweba feedback welcome

Did you ever try F#? I've tried both Clojure and F# and I honestly prefer the latter.
Post reply on HN