Live data from Hacker News

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

news.ycombinator.com

71–80 of 80 posts

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

#71

Earlier quoted context omitted.

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'm an experienced Scala dev but after reading the "fun and profit" ebook F# looked really interesting. Naturally I tried to take the next step of creating a small webapp with it on a Linux dev machine. Unfortunately I ran into a lot of problems identifying and setting up the needed tools and frameworks on Linux and eventually gave up. My assumption was that the tooling+frameworks were likely "not quite there yet" (l…

For a from zero to "Hello world!" no frills installation try https://medium.com/@edgarsanchezg/four-easy-steps-for-instal.... Then, you can go on to https://www.demystifyfp.com/FsApplied2/ great e-book (not free, but really inexpensive) on building F# webapps with suave.io

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

#72
post #55

Earlier quoted context omitted.

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.

Yep F#, the language, works all right in .NET Core 2.0. Some libraries, particularly, type providers, not yet, but they are working, on it. And JSON.Net also works fine on .NET Core.

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

#73

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.

Chiron is what I've been using. I like it because it's simple which means I can understand it. Currently using it with fable elmish architecture, again because it's simple and i understand it.

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

#74

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?

How many people or projects are using freya?

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

#75

Earlier quoted context omitted.

I'm an experienced Scala dev but after reading the "fun and profit" ebook F# looked really interesting. Naturally I tried to take the next step of creating a small webapp with it on a Linux dev machine. Unfortunately I ran into a lot of problems identifying and setting up the needed tools and frameworks on Linux and eventually gave up. My assumption was that the tooling+frameworks were likely "not quite there yet" (l…

For a from zero to "Hello world!" no frills installation try https://medium.com/@edgarsanchezg/four-easy-steps-for-instal... . Then, you can go on to https://www.demystifyfp.com/FsApplied2/ great e-book (not free, but really inexpensive) on building F# webapps with suave.io

Thanks for the pointers, I will definitely check both of these out. In my last attempt I got to the "can compile 'Hello World' from the command line and even debug it in VSCode" stage but after that things quickly went off the rails IDE-wise. I even tried MonoDevelop (did some C# work with it long ago) but IIRC the Xamarin stuff was barfing on one or more asp.net dependencies. Hopefully one of your links will be to an "Idiot's guide to F# on Linux" and then I'll be in good shape. :-)

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

#76

Earlier quoted context omitted.

I'm an experienced Scala dev but after reading the "fun and profit" ebook F# looked really interesting. Naturally I tried to take the next step of creating a small webapp with it on a Linux dev machine. Unfortunately I ran into a lot of problems identifying and setting up the needed tools and frameworks on Linux and eventually gave up. My assumption was that the tooling+frameworks were likely "not quite there yet" (l…

I had same experience before. But I request you to give it a try now. The experience is much better now!

I'm glad to hear that, I will definitely try again. F# looks pretty sweet and I have a couple of half-baked Scala side-projects that might port nicely to F# and Suave.

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

#77
post #59

Earlier quoted context omitted.

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 h…

I instinctively used the "interpreted" term, because mainly you can execute instructions on the fly in an interpreter the language ships with. Whether it's compiled to bytecode and then executed from there is IMHO an implementation detail. With compiled languages (following this logic) such as Java or Go or C, you need to write your program pass it through a compiler to get an output. With languages like Javascript,…

Well, SBCL does not ship with an interpreter, for example. Expressions entered at the REPL get compiled directly to machine code, so there's no difference in performance for a function entered at the REPL (or via SLIME C-c C-c) and one built as part of a batch compile.

Contrast that to Haskell's ghci interpreter, which is slower (last time I checked) than the same code built on the command line with ghc, the compiler. But I would still consider Haskell a compiled language, not an interpreted one, since you never run code in production under ghci, you always ship your binaries.

I suppose it's about perception. To me "interpreter" refers to a language implementation strategy. It's fuzzy, I know, since there is some continuum between interpreting an AST directly, compiling the AST to bytecode and running the bytecode on a VM, JIT compiling the bytecode to machine code on the fly, and compiling offline direct to machine code (like C/Go/Rust). To some ears, "interpreted" can sound synonymous with "slow", which is I guess what prompted my comment.

Finally, to me the place where you can enter expressions to try out your program interactively is the REPL, not the interpreter.

Anyway, thanks for explaining your position to me. (Also, good to know Python dev environments have improved, but I guess it's to be expected, 10 years is a long time :-) .)

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

#79
post #55

Earlier quoted context omitted.

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.

Yep F#, the language, works all right in .NET Core 2.0. Some libraries, particularly, type providers, not yet, but they are working, on it. And JSON.Net also works fine on .NET Core.

As I understand it type providers work with dotnet core code, provided you build the providers in mono. But yeah that's not exactly ideal.

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

#80
Do note, that some functional languages have good out-of-the-box support for both backend and frontend. An this is not negligible. I'm using F# which in combination with Fable (F#->.js transpiler) lets me really quickly share code, datastructures and serialization with frontend code.

Now, I'm a primarily a backend developer. But sometimes it is just really convenient to be able to hack together an in-house real-time data-analysis or reporting service and render statistics as webpages rather than .csv documents.

If your frontend team is functional as well, then the benefits of sharing the language could be even bigger.

Sure, not everything is perfect in the F# world. However having the possibility to share code with frontend saves me more time than I spend in fighting with the F# ecosystem. And also: programming in F# is just fun joyful. And productive.

Post reply on HN