Live data from Hacker News

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

news.ycombinator.com

31–40 of 80 posts

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

#31
post #24

js actually supports functional paradigm. So, node.js has the most mature ecosystem for web i guess.

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.

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

#32
I wouldn't call its ecosystem great, but if you like complex type hackery and don't need to do anything very complicated, Ur/Web can get you quite far.

It's very hard to learn, especially if you're not that familiar with Haskell and SML/OCaml, but once you grok it writing CRUD apps is a breeze. Just be prepared to spend a lot of time looking at the standard library's signature files.

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

#33
post #24

js actually supports functional paradigm. So, node.js has the most mature ecosystem for web i guess.

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.

Clojurescript has pretty good Node.js support now and there's a web framework based on Node/Clojurescript - https://macchiato-framework.github.io

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

#34
post #19
post #9

Earlier quoted context omitted.

Scala has a number of good HTTP frameworks, Play, spray/akka-http and Lift come to mind. Spring boot (Java) is also very decent, and Play and akka-http have both first-class Java and Scala API's. Kotlin has the same JVM advantage.

The OP specifically asked for a functional language, though. Java and Kotlin have adopted some ideas from functional languages, but they aren't themselves functional languages, and their HTTP frameworks certainly aren't designed along functional lines. Scala is, amongst other things, a functional language. How much to its HTTP frameworks embrace that?

https://github.com/http4s/http4s Is a a good example of a HTTP Framework in Scala providing idiomatic FP interfaces

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

#35
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).

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

#36
post #21

For backend you'd have Scala on the JVM side and F# on the .NET side.

I second F#. You have access to the full .NET Standard library as well as all of the open source libraries available. I personally found it more of a joy to use than Scala, but that may be due to my knowledge of and experience with .NET.

F# on .NET Core is stable and there are templates for an F# web application.

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

#37
Been using F# in a web-backend capacity for about two years now. Language is great, hits a very sweet spot when it comes to productivity, tooling (F# has some of the best dev tools out there), etc. Interop with the rest of .NET is pretty much seamless, so there's no lack of good libraries.

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

#38

Elixir/Erlang are one among best functional programming languages for web today. Phoenix is a very performant and productive web framework. You can build a typical web app really fast using Phoenix and Elixir.

You mentioned Erlang, where do you normally use it?

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

#39
I'm surprised nobody mentioned good-old Common Lisp. With quicklisp you get access to a ton of libraries.

For example you might be interested in: http://8arrow.org/caveman/

Lisp ecosystem is really mature and gives you a lot of freedom.

Dynamic typing, interpeted language, homoiconity, tons of great battle-tested libraries etc., Lisp is truly a great language for backend web development.

Even this very site runs on a homebrew lisp dialect (Arc) running on Dr. Racket (Scheme). If even that bizarre setup (sorry PG :)) can handle this much traffic on a single server, you shouldn't worry about speed or scalibility if you opt for Common Lisp.

Post reply on HN