Live data from Hacker News

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

news.ycombinator.com

51–60 of 80 posts

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

#51

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.

I gave Scala a try today. After coming from F#, I feel like I am dragging my feet. So, Scala definitely doesn't work for me.

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

#52

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?

Giraffe and Suave are likely to be easier for a newbie, and both have the "Suave programming model" for API routing, so you'll find the way to set things up is very similar (despite a few different names, such as WebPart and HttpFunc). Both run on .NET Core as well. The main difference is that Giraffe sits atop the Kestrel HTTP server which ASP.NET Core is built on, whereas Suave has its own web server implementation.

I wrote a blog post about using Giraffe here: https://blogs.msdn.microsoft.com/dotnet/2017/09/26/build-a-w...

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

#53
We at Crowded (https://crowded.co) have had some very good successes with running F# on .NET Core, both with giraffe and just bare ASP.NET Core. The ecosystem has no shortage of good tooling and libraries, all well maintained by knowledgeable authors. Application performance and our development productivity is excellent, osx/linux tooling took a while to mature but is only getting better than ever now.

The choice we made when .NET Core was still in development (pre 1.0) for it to become our main stack is definitely paying off!

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

#54

I have been using Elixir for the past more than 2 years and got say that it has an awesome ecosystem for overall web development, I've been using and writing open source libraries and they are looking pretty solid as well. The company I work for also uses it as its main backend for the past almost 3 years and it has been working nicely since then. Hiring also got way easier, not only because of the existing developer…

I second that Elixir's ecosystem is exceptionally great for such a young language. I love working with it.

That said, I'd wager it can hardly be called a functional language. Sure, you can't write for loops, but every Elixir process encapsulates a little piece of mutable state. Elixir and its ecosystem allow and encourage you to have (very) many processes, and thus many global singleton-like pockets of mutable state. It's a powerful and pragmatic concept, it works very well, but it doesn't really feel very functional.

The most extreme example of this design philosophy is a Elixir standard library module called "Agent", which is just a cute name for "global mutable variable". When used with care it's a very handy tool but, well, functional? Nah :-)

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

#55

Earlier quoted context omitted.

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.

JSON.NET is the standard library for handling JSON on the .NET platform, and to my knowledge it's available for both .NET Core and for use with F# collections.

I've never used F# on .NET Core, but I'd be surprised if it didn't work.

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

#56
post #30

Earlier quoted context omitted.

Third party resources can be sort of out of date; your first link is from 2014, and therefore has a bunch of inaccuracies. Your second was last updated last Octoboer, so not so much, but is still missing out on stuff.

Do you have a source that isn't missing stuff, or you could you mention some of the important bits?

Some examples:

* the h2 crate was released last week, which adds http2 support to the ecosystem

* the frameworks page is missing, off the top of my head, shio and actix. It also includes pencil, which has been abandoned for a long time.

* It includes nothing about Rust's fairly recent wasm support and all of the crates that let you work with that

In general, this is an extremely active area, with few "winners" so far, and crates.io is adding roughly 23 crates a day, though obviously not all web-related. There's just so much stuff all the time that keeping a curated resource like this up-to-date is a lot of work.

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

#57
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.

I also find F# a joy to work with. Not only because it's .NET which I find nicer to work with than the JVM, but also because it feels more well thought out and less every feature except the kitchen sink, like Scala. They're both great languages though. Scala >> Java, and F# > C# (more due to C# already being better than Java).

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

#59

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…

Interpreted language? Common Lisp is typically compiled. Besides which, why is interpreted a particular advantage? e.g. Python was interpreted 10 years ago when I was using it, but Common Lisp felt far more flexible and powerful, because you can compile single functions with a key press in SLIME and seamlessly load them into your running (compiled) image... shortest feedback loop I've ever experienced. Maybe Python has caught up in the mean time, I haven't used it seriously for a long time though, so I don't know.

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

#60

Some would say that Rust is a functional language. http://science.raphael.poss.name/rust-for-functional-program... Rust has an ecosystem for building web backends. http://www.arewewebyet.org/ Does Rust have the best ecosystem for a web backend, though? I think that will depend on who you ask and what you are looking for specifically.

Yea, we already use Rust. Lately, it's a joy to develop in.
Post reply on HN