It's well intentioned, but this project is destined to go nowhere fast.
Abstracting away web development and http has been tried again and again, and always ends up being more hassle than plain ol' HTML+JS+HTTP.
Then you've limited yourself to interop with the js libraries they've provided leaky wrappers over, or you can write your own leaky wrapper if you want to use coolnewthing.js you saw on github.
And to cap it all, this framework requires commercial licensing for closed source projects!
It's been around for a few years. I was able to use it to quickly whip up some sorta-complicated UIs for some internal tools. I despise JS, and have spent hours of time fixing simple casing errors or other things that static typing would fix. Plus F# the language is quite superior to JS, so I don't feel icky while working on it.
The other benefit is that I can use all the same type definitions, so I don't need to write some generator or wrapper around my XHR functions - it just works.
It's quite easy to just drop out into pure JS if you feel the need. And defining wrappers is actually very very simple. For example:
GWT has long-ish compile times and it involves quite a house of cards, with getting the Eclipse plugin to talk to the browser plugin, for the 1? browser that actually has a plugin. Yeesh :(
Interop with JS libraries can be solved without wrappers. GWT 3.0 introduces a new interop system that can take WebIDL, @JsDoc, or TypeScript annotations as descriptive of the interface of the underlying Javascript and synthesize Java interfaces that match the API. The compiler can generate code to call into Javascript with zero wrappers, maximizing performance and code size. It can even sub-class native Javascript objects (class Foo extends Bar.Prototype) using only standard Java syntax.
For example, using similar techniques that html5index.org uses, all browser native APIs are automatically covered by fetching the latest WebIDL definitions from Chromium or Firefox's repository or via standards docs, and used to generate the interfaces.
Or, using IDE FileWatchers, we use the Closure Compiler to read in Javascript libraries and/or externs, infer types, and write out interfaces. Likewise, we'll be able to read in typescript library interfaces and generate Java interfaces.
Combining the new JsInterop system, Java8, and SuperDevMode's <1 second compiles, the new system eliminates wrappers, reduces Java boilerplate overhead (lambdas, method references), and provides fast refresh times.
Sounds exactly like Opa Lang. Though they've finally moved away from AGPL, but it is too late and their confusing incorrect marketing (it isn't a js framework.. It compiles to js..) is not saving them.
This is why the so called "open web" that locks you to a few legacy languages must be fought with. Transpilation is not an answer. Luckily mobile is thriving, no problems using F# with Xamarin as a first-class citizen
I don't really think requiring commercial licensing for closed source projects is really a con. Seems like a logical way to make money, yet still allow open source projects to benefit.
Its true that its difficult to build an working magical all-around wrapper, but the core parts can be replaced well. HTML+JS+HTTP is open to be LightwightMarkupLanguage + SupportedLanguage + NetworkWrapper, e.g. Markdown+Haskell+WAI .
This looks super interesting. I don't think I've ever seen anything like it.
At first I thought it was similar to Classic ASP or JSPs, but after looking at some the examples, it's more like a JS framework in that it generates HTML dynamically with client side code. But, the thing that really looks cool to me is the interop between client and server that you can do.
You can use the exact same "type Person = {Name:string; DOB:DateTime;}" on the server and client. That's about as DRY as you can get, I think.
It's a F#-to-JS compiler, a UI framework, and an RPC system all built into one. Script# is similar, for C#, but I don't think it got that far? MS did start "Project Volta" IIRC but then gave up on it. There's also FunScript: http://funscript.info/ but that seems more focused only on the JS generation part.
I don't know why Micrsoft doesn't buy these guys and deliver this as a core solution. I'd guess it's because it's not on C#, and MS marketing doesn't know what to do with F#. They want to pigeonhole it as "F# is a special language for like, scientists and stuff. Don't worry, it ain't got nothing on C#." And hey, with enough time and resources, C# may catch up on some of the things. With Rosyln, I think it'd be easier to make a C# WebSharper thing.
There are already a few approaches out there for compiling C# to JS, like my JSIL (http://jsil.org/) and Script#'s unofficial successor, Saltarelle (http://www.saltarelle-compiler.com/). I believe there is a new Roslyn-based C#->JS compiler in the works as well.
I'm not aware of anything that approaches WebSharper's level of integration, though. It's a really impressive piece of work.
That reminds me strongly of what the Ocsigen[1] project has been doing for years: Eliom as a web framework that generates both server and client side code via js_of_ocaml.
Unfortunately, it kinda suffers from a not so shiny website, cluttered documentation and high complexity. I kinda dream of those things being solved, then it would be a really appealing option.
What's really different about these is that you don't need all the ceremony of designing routes and controllers for anything other than navigation. Need to add a phone number to a contact? Don't make a whole controller and route. Just write a function that updates the database and call that function from the client code.
And, if you care about separation of concerns, I think you can just put the RPC calls in a separate module. But, really, it's so little code, I might not even do that.
Is this an arms length Jetbrains thing? If not, it seems awfully odd that its name is so close to Resharper and the parent company is called IntelliFactory, which is so close to IntelliJ. I guess there's nothing wrong with that. Just odd.
Ignoring, of course, that (a) they've probably used or heard of ReSharper and (b), both F# and C# pronounce the hash as "sharp"? ;-) I suppose it could be confusing but it wasn't the first thing I thought of...
They're either related to Jetbrains in some way or really lack creativity or maybe they're trying to unduly profit off the good reputation Jetbrains generally has in the community.
Exactly what I thought when I saw xSharper then Intellix. First thing I did was look to see if JetBrains had anything to do with it since that would have +1'd my interest. Quickly realizing they didn't -1'd it :/
WebSharper is really fantastic. F#'s a great language, and not having to leave it and deal with JavaScript is a great boon. So many problems simply disappear due to type checking.
This looks very interesting in the same way as Clojurescript but with F# and potentially a smoother experience.
Has anyone used this that can provide some insight into it? Does it work with entity framework? OWIN? What's the story with the F# to javascript compilation; did they invent that or is it another project? Who are these people?
I think it's a shame that the C#/.NET ecosystem can't seem to have FOSS nice things because it really hampers stuff gaining traction. However I find the open source license for this is very clear and generous; I still can't seem to figure out if ServiceStack is safe to use :| This should allow for learning the framework and providing nice things to the community, and then the licensing seems reasonable compared to the value proposition for working on commercial software.
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 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
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:
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.
>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.
By what measure has GWT failed? It compares favorably with usage numbers to most popular JS frameworks. 130,000 monthly active developers, used on 20,000+ domains, outside of Google, it's used by many large companies, for example, Apple's iAds uses GWT, AWS console uses GWT, major financial institutions and banks are using it.
It has it's niche just like every other framework. Google is now using it to share code between Web, Android, iOS, and Server (shared client side business logic). Google Sheets is the newest example of such Hybrid apps, and the gains are substantial, 60-70% code sharing between platforms, only the UI needs to be reimplemented natively.
Just because something is not monopolizing a particular area of development doesn't mean it's "failed". The ecosystem is large number for many different frameworks to remain vibrant.
Another monolithic framework that will likely catch some unsuspecting CTO or director and ultimately be his demise, or someone who doesn't want to learn javascript (such people still exist, sadly).
Nobody really "wants" to learn JS. It's a hateful little language and the sooner it gets nuked from orbit or at least abstracted away to become merely the "assembly language of the web", the better.
While I don't agree WebSharper is monolithic - it's anything but that. I do agree that it is a bear trap. They could go bust at any moment and leave you with a big headache.
Even as a F# dev I have deliberately avoided using it because yes I agree with some of the sentiment here that the licensing model is a bit odd, but also the thought of needing to write a Binding for basically any JS library it doesn't support out of the box is quite a burden that will never go away. And can really slow down a new project that wants to iterate fast.
I firmly believe in using the best tools for the job at hand. So that means a F# back-end and a AngularJS front-end. It's a PITA maintaining two domain models in each, and similar validation logic etc, but such is life sometimes. What I lose in the domain model side, I gain back in a rich and vibrant set of available AngularJS modules and JS libraries.
It's a substantially nicer language than Javascript, and there's a lot of problem domains that are far easier solved in it.
People wouldn't use it because they don't want to learn Javascript. They'd use it because they don't want to use Javascript, on account of knowing better.
Yes, but can you believe there exist people who think using just a few legacy ill-designed languages negating the years of progress is not just OK but dare to call this approach "open" as in "open web"?
That's interesting. I appear to have actually accidentally written a chunk of this in C# for a product a couple of years back. The approach is pretty much identical.
WebSharper is completely agnostic in this regard, so the question boils down to what is available for F#.
The idiomatic way to deal with databases is using one of the available type providers. Basically, a TP generates types at compile time, in a way that actually plays quite nicely with IntelliSense [1]. In the case of db TPs, they're parameterized by a connection string and connect to the db to extract the schema and generate the appropriate types. Several exist [2]; SqlDataConnection and SqlEntityConnection are built-in, FSharp.Data.SqlClient and FSharp.Data.SqlProvider are community contributed. They all use query expressions (basically, F#'s extensible version of LINQ syntax) except SqlClient which directly uses SQL in a string (but still checks the query at compile time and passes arguments cleanly, thanks to the TP) and is therefore more like a (safer) micro-ORM.
The project is really great, however license is really bad. A modern framework, should be open source under liberal license. Licenses like this worked in 90s, but currently they don't work.
This license makes it impossible to create non open source software without paying the company, which makes it practically useless for commercial development. Liberal license are licenses like BSD, Apache, etc, which allows people to create commercial derivative works without disclosing source code.
How does it make it useless? Why wouldn't you pay a license fee for developing commercial (closed source) software? If you want to sell the code to the client, use the AGPL, if you want to sell the (closed) service, get a commercial license?
The AGPL allows you to develop closed internal tools (no distribution to third party), optionally distribute without a cost under the AGPL -- and they also offer an option for commercial development. Asking for the code under a BSD license just sounds like you want to avoid paying for the cost of developing, supporting and maintaining a (presumably) quality product.
It's less than 400 USD/year for a freelancer... if it's any good it should pay for itself, practically?
Any open-source code would have to be released under the terms of the AGPL as well (although could potentially be dual-licensed). It could also not use GPLv2 libraries (although could use GPLv3 libraries), or libraries with other copyleft licenses for the most part.
It's... an extremely restrictive license, generally, and not one I'm comfortable using as an open-source developer. I know many others feel the same, which would lead to a lack of community, leading to a lack of community support, and potentially leading to the death of the product.
While I like the AGPL, for projects where it's appropriate (I think it fills a need to ensure that users of the software have the four freedoms, even if they only (mainly) use a service, not a local program) -- I also generally think libraries are better served by LGPL.
It's a rather complex issue -- not just how do delineate "libraries" as opposed to "derived works" -- but also how much is needed in the "main product" for it to be useful. Architecturally it might make sense to have the "program" or "service" be a thin wrapper around several libraries -- but if only the program is AGPL, and the libraries are LGPL -- how do we make sure the end user is free to maintain the software if needed?
The main thing with the GNU line of reasoning, is user rights. If viewed from the perspective as "just" a developer, many of the licenses look restrictive -- because it limits the developers power over end users.
I think we all end up with more freedom as a result of that -- not everyone agrees.
As for mixing -- I'm not sure how the "open source" exceptions in the license are supposed to affect that -- my cursory reading seemed to imply that the idea was to allow mixing with code under other licenses. But I must admit that's not a subject I've considered much.
Sure, sure. I get the goals of GNU. However, that's kind of irrelevant as to whether or not this will grow a community, and with a license that is restrictive to developers, it likely won't.
In fact, I don't think I've ever seen any AGPL software that's grown a significant developer community.
>It's less than 400 USD/year for a freelancer... if it's any good it should pay for itself, practically?
The problem isn't paying 400 USD/year. This is negligible cost compared to how much it costs to hire a developer. The problem is that software created in such a way wouldn't be widely used for reasons mentioned in one of my other comments.
I can't seem to find that. You mention something about risk -- but I'm not sure which risk that is. As I understand their license page, you need a license per developer. The resulting code you're free to sell under a closed license. If you want to sell work under a closed license, you're covered. If you want to sell it under an open license, you can sell it under the AGPL. Exactly what are you missing from this kind of dual-license?
For example, company decides to change a license, and I need a new developer. What should I do in this case especially if I work for a startup and its only product is created with this technology?
If you already have a project - you have a copy of the code under the old license. Is it really that different from a company changing from a bsd license to closed source? You'll have to negotiate or fork in either case.
I do get that there might be a question as to how you could get additional developers under the old license...
In your example, the company changes the license. So you already have code under one license -- either proprietary if you've bought a license -- or under BSD. When the company owning the project decides to re-license -- you still have code under the old license. Either commercial or BSD. Right?
If it's a BSD license everything is great. If it's AGPL, which is the case for the company which we are discussing, I can't do anything without disclosing source code.
We're discussing how to do a commercial project. If you want to do a commercial project in this case, that means buying a commercial license. If it's BSD, you can also do a commercial project. If the company changes it license from commercial (to some more expensive commercial license?) -- you still have a copy of the code under the previous commercial license. If the company changes the license from BSD to a commercial license (or the AGPL or whatever) -- you still have a copy of the code under the BSD license.
If you choose to not buy a commercial license, your commercial project in this case will have to be under the AGPL, and you can sell your products, but you also have to promise your users that you will provide a copy of the source on request. I think we both understand the demands of the AGPL, and it's not readily compatible with a closed source model. But you took the example of "what if the company changes the license" -- and if you were already doing a closed source project, that would mean you were not dealing with the AGPL, but the commercial license. So again, I ask, how would the BSD protect you from that risk? Upstream is still free to change the license of future releases...?
Paid support, tools, there're plenty of companies which follow this business model. Extjs, Vaadin, Typesafe, etc.
I understand that they want to make a money, however, using their license is unacceptable risk, especially taking into account there're comparable alternatives. I'd rather use GWT/TypeScript/Scala.js, than proprietary framework which I won't be able to work with if they changed license to something unacceptable (for example, charge per server or whatever).
ExtJS is GPL with paid commercial license, so essentially the same model as WebSharper. They even explicitly forbid to start developing a prototype in the open and then buy a license for it, which WS doesn't.
Usually, such companies have quite high price for such contracts and I think it's not worth is. While technically it might be superior, it has small user base, smaller talent pool to hire from, less books/documentation. All this happens because people want to make money in an old fashioned way.
The better option is to use, the most popular open source tool which in this area is GWT or TypeScript.
If you don't like the license, don't use the framework. It's that simple. Charging for commercial licenses for libraries is a perfectly valid business strategy, and I can see lots of F# developers paying for this.
AFAIK, even for the open-source license - you only have to provide source code to your client - i.e. when distributing...
If you're using this framework for your personal project - you're free to not to release source code - since you're not distributing the binaries of your project either.
>If you're using this framework for your personal project - you're free to not to release source code - since you're not distributing the binaries of your project either.
In this case you can't even publish the code, since compiled js is kind of binary.
Can't you treat the part you're "distributing" - i.e. the client side html/css/js - as a separate part and open source only this?
But not sure if this kind of thing is really distribution. GPL* licenses were more oriented towards traditional compiled software and it is somewhat unclear with regard to nowadays prevalent web apps.
Many years ago, a Steves job asked Stallman this very question regarding a similar situation. Stallman initial thought it sounded legally sound, but since he is not a lawyer, he asked one.
The laywer replied judges would consider such schemes to be "subterfuges", and ask whether it was "really" one program with different labeled parts. Stallman sent a reply back to jobs, based on that recommendation from the lawyer.
Websites might feel very different from a technical point of view, but trying to do smart and tricky things with law always end up with the same question: How will a judge or jury view it. If I go to hackernews, do I get several "works" of JS, CSS, HTML, or is it a singular work with different labeled parts?
You have the freedom to do anything you want from the result of using this framework.
I also have the freedom to do so with what you make, if I am a user of it.
Why are you so dead set on taking away my freedom. Adding restrictions on what I can do with the work you created from that framework is kind of rude when the developers is asking you to share, and share alike.
>You have the freedom to do anything you want from the result of using this framework.
No I do not.
>I also have the freedom to do so with what you make
Then clearly I do not have the freedom to do anything I want.
>Why are you so dead set on taking away my freedom
I am taking nothing from you. I release all my code under the ISC license. That is free. Restrictions are not freedom.
>the developers is asking you to share, and share alike.
The developers can ask whatever they like. And I can decline their offer. I will continue to use free software instead. Why is it so upsetting that someone would choose not to use non-free software? If the developers find my absence to be a problem, they are welcome to change make their software free. I have no interest in shareware.
While I sincerely doubt that you release all your code under the ISC license, I will take your word on it.
That mean you can use any open source license and release your contributions under that license. Be that BSD, GPL, MIT, Apache... what ever it is, your contributions can always be under the license of your choice.
So yes, you do have the freedom to do what you claim you only do, ie, release code you write under ISC license. 100% freedom to do exactly that. Write a addon to AGPL and release that add-on as ISC? No legal problem at all.
If you want freedom to release code someone else has written under the license of your choice, then I sit in the same boat. I would like too to have the freedom to chose that, but alas, copyright wont' allow that. It would be a neat freedom to chose the license of OS X and windows.
Abstracting away web development and http has been tried again and again, and always ends up being more hassle than plain ol' HTML+JS+HTTP.
Then you've limited yourself to interop with the js libraries they've provided leaky wrappers over, or you can write your own leaky wrapper if you want to use coolnewthing.js you saw on github.
And to cap it all, this framework requires commercial licensing for closed source projects!