As a separate but related question I would like to ask what tools you'd recommend for developing in F# on Linux or OS X.
Ask HN: How viable is F# on Mono for real-life web apps?
1–10 of 38 posts
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#2Your options are (realistically): Websharper - full web stack, transparent RPC. Hard to interop with native JS libraries like angular though.
Funscript - F# to JS compiler, more minimalist approach.
F# server side (REST api in Nancy/Fanciful/WebAPI) teamed with javascript front-end. Also well worth checking out Livescript, syntax is very similar to F# but dynamically typed.
See also: A relevant blog article I posted: http://thecodedecanter.wordpress.com/2013/06/22/hosting-webs...
My consultancy (just in case): http://www.perfectshuffle.co.uk
Always up for a chat if you have some ideas :) Shoot me an email through website above or PM me.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#3I've been using F#/Mono for my small apps for some time now. For an example, my personal news aggregation site, http://newspaper23.com, is running all the time, going out and finding headlines and presenting them to me in plain text. Been meaning to add a text stripper to the mix so I don't have to see any ads or participate in any sticky website nonsense at all; just haven't had time to code it yet.
The nice thing for me, especially for this app, is that I can use F# in a purely functional manner to create little unix-like programs that do a little bit of work at a time. Then I string them together with chron and, instead of the old client-server web model, I have something more resembling a data pipeline. I can monitor flow across the pipeline, distribute parts of it to other machines (scale out) if necessary, and so on. All without having to re-code anything. The entire thing serves up a static web page, which can also be tweaked: served in-place, over a CDN, emailed to a user, etc. Did I mention the "no recoding" part?
As a former .NET guy, I'm happy enough with F#/mono that I can't imagine going back to full-bore .NET no matter what the problem domain. The toolset is way too heavy, the culture is awash in folks marketing to developers instead of helping them build stuff people want, and so on. It was a great ride, but F#/mono is where I get off.
Having said that, I still use the VS IDE to develop, since you can develop in windows and then FTP the code over. That's pretty cool. I've tried and used MonoDevelop. I guess it's okay. I've also done a bit with just straight-out command-line compiling. After all, it's not like you need a huge codebase full of hundreds of files. Or if you do, you're doing something wrong :) An 8 or 10-file F# program is a monster -- and probably means you're trying to do too much at once.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#4As for tools, beyond frameworks Xamarin Studio has a good-enough F# environment. There's also an emacs major mode.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#5The demo isn't using Mono, but I thought it's still relevant if you want to get a feel for what an F# web app might look like.
http://pluralsight.com/training/courses/TableOfContents?cour...
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#6In my case when rolling out the JSIL compiler (mostly C#, but using some F# applications as test cases etc) certain BCL containers had dramatically different GC pressure profiles, and GCs would trigger at different rates and with different costs. F# tends to generate a lot of GC pressure so you want to be proactive about this.
Side-by-side, though, sgen works pretty well. I've used it extensively and it does the job.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#7It's viable. Mono is very good these days. It's pretty rare that you find .NET libraries that are incompatible. I still use Visual Studio as an IDE but deploying to Linux is straightforward. Your options are (realistically): Websharper - full web stack, transparent RPC. Hard to interop with native JS libraries like angular though. Funscript - F# to JS compiler, more minimalist approach. F# server side (REST api in Na…
I've tried to contact the folks who are maintaining FastCgi on Mono but the email I sent last week bounced. When you use evhttp though, (at least with C#) there's not a huge performance difference than when using it in Windows.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#8Unfortunately, I can't answer your question about Mono just yet. We are exploring the practicality of Mono (for mobile development in F#), and while I am optimistic, I can't speak to the reliability of the platform. So my answer (a complete cop-out) is to try out Visual Studio unless you are completely tethered to Linux/Mac.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#9It's viable. Mono is very good these days. It's pretty rare that you find .NET libraries that are incompatible. I still use Visual Studio as an IDE but deploying to Linux is straightforward. Your options are (realistically): Websharper - full web stack, transparent RPC. Hard to interop with native JS libraries like angular though. Funscript - F# to JS compiler, more minimalist approach. F# server side (REST api in Na…
If you're using Mono for web hosting then don't use Mono's FastCGI implementation. It's incredibly slow from what I've seen. Instead, use something like evhttp-sharp which has a wrapper for Nancy. Just to give you an idea look at nancy using evhttp ("nancy-libevent2" in the benchmark) vs FastCgi ("nancy" in the benchmark) at http://www.techempower.com/benchmarks/#section=data-r8&hw=i7... I've tried to contact the fol…