Hacker News new | comments | show | ask | jobs | submit login

I've been using WebSharper in production for 20 months now and I wouldn't consider doing web development any other way.

People have mentionned that such abstraction generally become more trouble then they are worth but I completely disagree.

In particular the question would be what are the corner cases that will make the abstraction more difficult to use and ruin your overall productivity and I haven't found anything so far.

What I find difficult though isn't creating wrappers around existing external javascript libraries but rather learning the quirks of each of them. For instance, I happen to maintain a WebSharper wrapper around the Kendo Web library (see here https://github.com/davidgrenier/Kendo) with the goal of abstracting away the complexity from my code base and where I spend most of my time is trying to figure out how to properly use any new control we've yet to use in production. This process is tedious and error prone because the examples on the Kendo website aren't exhaustive, the documentation isn't specific about the semantics of the library and just the brittle nature of javascript development. I spend lots of time in the chrome debugger and their online tool figuring out how things work. The productivity gain from isolating that from my code base is significant.

F# as a language is quite understated, more companies are using it than it seems (many of which in stealth mode) and so is the case for WebSharper. IntelliFactory has been selling licences to many of their closed-source clients, my employer being an example but also I'm aware that MSR uses it internally on a few projects and was told the developpers there love it. The fact that my employer continues to pay the licence, gives me work on the project and has recently hired another developer working full time with WebSharper indicates that they consider the value to be at least on par with everything else we do.

Over the 3+ years I've been using WebSharper, I've had to report only a single bug Monday of last week (see here https://bitbucket.org/IntelliFactory/websharper/issue/288/sy...) in the WebSharper core libraries related with compatibility issue in old version of IE and the bug was fixed within the week and had access to an updated WebSharper package from nuget.

WebSharper isn't just an F# to JavaScript compiler, they also offer powerful, paper-worthy abstractions to improve developer productivity:

-Transparent RPC calls from client to server (combined with static typing this is one of my preferred feature).

-Combinators for composing pages and managing routes in an elegant typesafe way.

-The ability to create standard server-side markup and yet SPA page building is even better as you get to pick what you carry over the wire and simply create all your markup on the client.

-Tools to create extensions around external javascript libraries (I've personally used WIG and works really well and I learned a few things about design while using it to boot).

-If you have access to Libraries that offer TypeScript bindings (like Kendo does) IntelliFactory can generate the wrappers for you.

-Tons of precreated wrapper for you to simply use

-Combinators to compose data/UI controls/event flow handling like Formlets/Piglets and now UI.Next which is excellent, I've come to appreciate all three and we're using Piglets in production though UI.Next should go a long way to allow you to do anything you need.

-Use existing abstractions in the standard F# development experience which would be hard to get otherwise (async workflows is an example).

I don't have strong opinions one way or another on licencing but as been mentionned before IntelliFactory generates revenues and as such I'd be skeptical of someone claiming that such and such model "doesn't work". Besides most of the concerns I've seen here seems philosophical rather than about direct impediments the licencing creates on what they had to do. Indeed the licencing cost my employer has to be is insignificant compared to the benefits and I personally do not pay for a licence on my own stuff.

Microsoft's position around the .NET ecosystem is sound, they provide the CLR, Base Library and a world class development environment. The rest is open to the community to drive the libraries/toolset they need, after all Microsoft can't do everything and it seems to me would tie in the community to Microsoft. You can see the latest open sourcing of the Roslyn compiler as a reflection of that. Likewise, the F# compiler service project and the direction taken by the F# Power Tools and the way Microsoft supports this initiative to enhance the VS development experience sends the same message. Speaking with Don Syme he indicated that technically there wouldn't be anything standing in the way of doing the equivalent of what IntelliFactory did with the new C# compiler, though you can be sure of two things: Microsoft won't be doing it and it's likely a tremendous amount of work.

I haven't played with any other similar toolset (ClojureScript/Purescript/GWT comes to mind) and as such I will not comment on those. But I will advise against listening to advice from anyone who hasn't used any of those specific libary. Even better, sit down and spend the time required to make it familiar and then you'll be a better judge.

If you are already using F#, I urge you to put 10-20 hours on it, you will thank yourself. If you aren't using F#, in my mind, WebSharper is just another wonderful reason to start doing so.

Thanks for taking the time to write up such a detailed comment. I was working on one of my own as I have had nothing but a great experience with Websharper and was disappointed to see the tool be somewhat dismissed by (to me) unfounded and unproven technical and license concerns.

I'm using the tool to develop the web front end for a MVP idea. Combined with Xamarin it means I can use F# across my entire application stack. This means reusing the same types, domain models, and so on. Plus you get all the goodies of Async, computation expressions and strong typing on the web client.

I went straight to the new UI.Next reactive framework and have been loving the experience to build a SPA. Imagine Om/React but strongly typed with monadic combinators to compose reactive views.

I guess this is a long way of saying 'second' :)

I use WebSharper at MSR and have been very happy with the results. We have substantial amounts of F# for simulation, modelling, and analysis of biological systems. It’s useful to be able to run this code in many places and WebSharper allows us to transpile into JavaScript for running directly in a browser with only minor changes to the core code.

Disclosure: I work at Microsoft Research but not on F# and have ongoing interactions with folks at Intellifactory

How leaky is the abstraction? Can you effectively use this with very little prior knowledge of front-end web development?

And what is the state of F# on Linux these days?

As all abstractions are leaky I have to concede that it has to be, but considering the size of the abstraction it's actually surprising how little gets in the way of getting things done (short of getting the hand of it for which the learning curve is far within that of WPF must have been for some people).

As far as as doing away with Web Development skill I would say no. As opposed to what ASP.NET used to do WebSharper doesn't try reinvent Web Development so one can "leverage" their existing Web Development skillset as opposed to have it superseded with something else.

On the other hand, being that I myself am a pretty bad web developer (despite of it being my official title), having static typing on a set of library that maps to HTML can really help (IntelliSense and simply preventing you from compiling something that wouldn't work). The other abstractions are just on top of everything else yet uses functions with the names you may be familiar with to produce markup.

Plus, I find that having functions as opposed to open and closing tags with the XML syntax is better on the eyes:

  Div [
    Span [Text "Hello"]
    Input [Type "Submit"]
as opposed to:

    <input type="submit"></submit>
Another aspect is how easy it is to refactor blocks of markup away into function calls and use all existing F# functions over collections to programmatically produce content:

    "David", "Grenier"
    "Anton", "T."
    "Loic, "D."
  |> List.map (fun (firstName, lastName) ->
     let lbl text = Label [Text text]
     LI [lbl firstName; lbl lastName]
  |> UL
If you have a little imagination, you can see this can go a long way.

But...the licensing...

If your project is open source, the license is free. If you are in a serious commercial endeavor, it is insignificant.

>If you are in a serious commercial endeavor, it is insignificant Indeed,... this reminds me of trying to convince management to buy large monitors. We look for tools that substantially improve our development productivity. It it can do that, the cost is quite literally insignificant.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact