Microsoft has started making a lot more of the ASP.NET stack open source (EntityFramework, Razor, etc), which I think will help a lot going forward. The real problem is that the ASP.NET happy path is somewhat coupled with IIS and (to a lesser extent) with MS SQL Server. It can be hard to get portability out of the box in some cases, but it depends a lot on what you are trying to do.
Ask HN: How viable is F# on Mono for real-life web apps?
11–20 of 38 posts
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#12Re: Ask HN: How viable is F# on Mono for real-life web apps?
#13It'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…
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#14A real shame. I'd love to dedicate myself to an open source functional language with a GUI toolkit that runs all platforms, desktop and mobile.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#15are there features that F# has that scala is missing (aside from reified generics)? Because there are at least a few critical features scala has that F# is missing that influenced my decision on preferred language.
Also .NET/Mono benefit from a VM with much better performance characteristics (tail calls, value types).
Scala has its own set of benefits too (incredibly powerful type system, Scalaz, bigger community).
F# is primarily a functional language with some OOP bits tacked on. Scala is the opposite.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#16I played with Xamarin Studio + F# + OS X about a year or two ago. Right away I noticed that F# is a second class citizen in Xamarin. Weird bugs, weird warnings, unfinished parts, hard to find help online and in IRC channel. And since it's a smaller language, there are 1/100th the number of tutorials/resources at much lower quality. Anyone who wanted to run my app on Linux or Mac had to deal with Mono 2 vs Mono 3. Des…
JVM developers seem to be much more open-minded than .NET developers for whatever reason. As someone who thinks F# is a much nicer language than Scala (the best JVM statically-typed, functional language) it's quite frustrating.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#17are there features that F# has that scala is missing (aside from reified generics)? Because there are at least a few critical features scala has that F# is missing that influenced my decision on preferred language.
The type inference is much better in F#, the syntax is much terser, discriminated unions are much cleaner than case classes. Also .NET/Mono benefit from a VM with much better performance characteristics (tail calls, value types). Scala has its own set of benefits too (incredibly powerful type system, Scalaz, bigger community). F# is primarily a functional language with some OOP bits tacked on. Scala is the opposite.
What's the general consensus on scalaz nowadays? Some people seem to think that it is evil itself (or rather the style that it promotes). I'm an outsider so I wouldn't know.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#18Earlier quoted context omitted.
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…
Awesome, I wasn't aware of evhttp-sharp. On first glance it seems not to provide any Owin middleware compatibility, but it should be easy to do a small server factory that plays with Microsoft.Owin.Hosting and get that out of the box. I've also found https://github.com/Bobris/Nowin a while ago - very fast on Windows, but I can't get it to work on Mono 3.4 on linux, locks on the first request.
Edit: Actually from what I've seen, Mono uses epoll/kqueue for async IO which is what libevent uses as well. I think the problem might not be so much that libevent is faster than what Mono can do in plain C# but rather that the FastCGI implementation has some bottlenecks or is not using the most performant APIs available. I haven't had time to profile it though.
Re: Ask HN: How viable is F# on Mono for real-life web apps?
#19Full disclosure, this has been said of me recently: > AFAICT you mention Felix whenever OCaml comes up, generally saying more or less the exact same thing each time
So you might know about Felix already, if not read on. I dont want to sound repetitive if it is not welcome please let me know if I am overdoing this, so far the reception has been warm in other threads. [Said too soon I guess, downvotes are ok, would appreciate if they come with some feedback as well]
Let me point you towards my comment https://news.ycombinator.com/item?id=7416692 that has more details
Felix's website is running on the web server that comes with its standard library. It is well suited for webapps because of its strong support for efficient asynchronous I/O, futures and coroutines (which I believe has been maintained for 10+ years and used in ATM networking applications). These help in avoiding callback heavy code. Hooks into JS is currently missing, but if you are adventurous, interfacing it with V8 should not be difficult because interfacing with C++ has been Felix's design goal from the very beginning (analogous to how F# and C# are related). In fact if you express enough interest, the language designer, John Skaller, might be up for it himself (You can catch him on LTU or the Felix mailing list). As of now it has two backends, GCC and Clang. John has some interest in a Javascript backend as well in case there is sufficient demand for it. If F# is something that interests you, and the performance of F# on the mono runtime worries you a bit, Felix might be worth poking around, especially if you are an early adopter.