Microsoft’s F# language is best suited for financial and scientific applications, but a startup wants to broaden its usage to building mainstream Web applications.
IntelliFactory, which is based in Hungary, is set to release WebSharper Platform 2010 in early February. WebSharper enables developers to write Web applications in F#, which are then compiled into JavaScript for execution on the client-side.
Writing JavaScript is time-consuming, and the developer is prone to errors because it is an untyped language, said IntelliFactory founder Adam Granicz. “Many bugs only surface at runtime.”
Pricing has yet to be determined, but customers will be required to pay for support, Granicz said.
F# is a productive programming language for creating Web applications that eliminates the “painful details of using ASP.NET,” said Granicz.
F# offers numerous productivity advantages over C# or Visual Basic when it comes to ASP.NET development, due to its expressiveness and that it is a statically checked, type-safe functional programming language, Granicz said. “It addresses many of the weaknesses of ASP.NET, such as using strings for IDs and method names to connect markup with code-behind [class files], untyped form values, and overly complex form construction.”
The .NET Framework provides a myriad of choices for building with Web applications that use ASP.NET Model-View-Controller, ASP.NET Web Forms and Silverlight. WebSharper is designed to integrate with ASP.NET and existing ASP.NET applications.
WebSharper differs from those standard approaches because applications are built from pagelets (miniature Web pages) written in F#. Developers can leverage a large subset of the .NET Framework’s F# core libraries and .NET system namespaces, according to the company.
“You can basically write F# code that uses F# core libraries (say, the Sequence module for filtering out certain values from a lazy sequence), and various .NET core libraries (say, for working with regular expressions or math functions) without having to worry about how these map to JavaScript,” Granicz explained.
The F# pagelets correspond to client-side functionality and are automatically converted into optimized JavaScript, Granicz explained. He noted that developers could also optimize their compiled JavaScript code using external optimizers. WebSharper also supports multiple JavaScript libraries, including Flapjax, jQuery, qooxdoo and Yahoo UI.
There is a close correspondence between F# and JavaScript features, because JavaScript is itself a functional language that supports lambda expressions and closures, Granicz noted. “It is a good medium to template already functional languages.”
WebSharper applications will execute consistently across browsers that implement standardized JavaScript, Granicz said. The platform does not support proprietary browser customizations. “Traditional Web applications are inherently server-based, requiring the server for performing and rendering most of the interaction on the pages,” he said.
“This has been somewhat alleviated by asynchronous communication technologies such as AJAX that work in the background to update certain parts of the page. However, under the cover, this often translates to the server rendering the entire page and only sending parts that are marked as updatable.”