Fable: F# to JavaScript Transpiler
fsprojects.github.io
fsprojects.github.io
I really like the idea of Elm; but I also really like the idea of using the same language for both the frontend and the backend, so I can share code, and I currently can't do that in Elm.
But I could do in with Fable, using F# on Mono on the server. The idea of using something as big as Mono doesn't really fill me with joy, but F# is supposed to be a thoroughly decent functional language (I've never used it myself). Except... Elm comes with all this value-added functionality that's ideal for web development. Unless Fable has something equivalent, I lose out on half the benefit.
Anyone?
See this reddit discussion: https://www.reddit.com/r/elm/comments/1z0ukt/can_i_use_elm_o...
For general backend stuff it is awesome. I can't vouch for mono, however.
Fable has made few choices on the semantics which make it not totally identical to F# on the server, although this shouldn't impact most of the code severely; but the mindset of Fable is different than websharper.
For F# on the server, Mono might not be lightest (if you compare to python or ruby which are already there by default) but is still the most suitable option right now until the OSS dotnet core eco system stabilizes and supports major libraries.
F# is definitely a fine functional programming language, able to blend with a tinge of OO where it makes sense while still being functional first. Relatively easy to pick-up if you have exposure to haskell or ocaml or sibblings.
It also has "modern" node-style command line tooling and is hosted on Github for easy community contribution.
.NET Core is coming to Linux soon and will give you another option for compiler/runtime which will be good. Performance will be better, but mono has been working fine for me so far.
I think it's already here?
https://www.infoq.com/news/2016/04/fsharp-dotnetcore-linux-m...
Have you any suggestions for an F# webserver?
for example ubuntu 14.04 is https://www.microsoft.com/net/core#ubuntu
if you dont want to use installers, just unzip the binaries packages from https://www.microsoft.com/net/download#core and add that directory to PATH
after that
- mkdir hello && cd hello
- dotnet new --lang fsharp
- dotnet restore
- dotnet run
Plus, you get a lot of functionality from the library too https://github.com/ocsigen/js_of_ocaml
The documentation is a bit confusing, but it has tons of features.
js_of_ocaml comes with library that lets you interact with the DOM and most of the browser APIs
If you want a more complete and opinionated solution to develop web apps using F# both on the server and the client, Websharper is your best choice. However, Fable's community is already working on some libraries to make use of JS tools, like React for the web or Fuse for mobile development, in a more idiomatic way from F#. We're also planning to elaborate some guides for full stack development with Suave on the server (which already runs on .NET Core) and Fable on the browser.
Please take a look at Fable's website to know more about what's currently possible with the tool: http://fsprojects.github.io/Fable/
Incidentally, Indy Garcia has a simple but very nice Web Canvas app written both in Elm and F#/Fable so you easily compare both solutions side by side: https://github.com/Indy9000/noodle-soup
Any choice you make, have fun with functional web development!