Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

511 views
Skip to first unread message

Quintus Marais

unread,
Sep 11, 2014, 5:29:55 AM9/11/14
to web-st...@googlegroups.com
I was inspired to write this as a result of the "Sample Application" topic.  It is a practical example of why we need to address the issue, and I think the questions and observations made below need to be taken into consideration in designing/framing the Sample Application

I am in the process of starting up development of a new SAAS application.  I am leaning towards using F# as the main development language, as I have some legacy non-web related logic code that I would like to bring along for the ride.  Also, F# is currently the language I am most  fluent in.  I am however not locked into F# as a choice and am evaluating several other options such as C#, Scala, Clojure, Ruby etc.  

I would like to follow an approach where all server side code is exposed to clients via a number of API's and various clients are provided i.e. SPA web client as primary client, with potential IOS,Android,WinPhone native clients as add-on's.


So, what are my options?
  • WebSharper 
    • Pro: 
      • seems to be the most mature and closest to a full native web stack making use of F#'s strengths.  
    • Cons:
      • It is not free for commercial work, which I will be doing and I do not have the budget to be able to afford the commercial licenses.  
      • Also, the other languages such as Clojure have frameworks that seem to me to be comparable and that do not require commercial licenses.  
    • This does not seem like a viable option to me.
  • ASP.Net MVC as described here: http://bloggemdano.blogspot.com/2013/12/a-new-f-aspnet-mvc-5-and-web-api-2.html.   
    • This approach feels clunky to me as it is primarily designed for the C# world.  
    • The templating language is using Razor with C#.
    • Most of the documentation and tooling is focused on C#.
    • ASP.Vnext is looming on the horizon.  How easy is it going to be to get my work over to vnext if I start with this approach now.
    • Documentation lacking for things such as getting OpenID Connect working.  In C# it is easy, just pick the right template and you are presented with a working template solution.  I have not been able to find anything similar in FSharp and the C# template does a lot of magic that is not explained to work, so porting to F# is substantial.

  •  FunScript
    • This seems to be the way to go for the Client Side SPA stuff.
    • Also, documentation lacking for how this relates to things  such as Angular or Durandal. 
    • What happens on the  server side though
  • Dyfrig/Frank/Suave
    • Good grief, all these things.  How are they similar/different? Which ones are still being actively developed? Will they still keep on working/be relevant in the vnext world?
  • Simple.Web - I understand this is not being developed further in the light of vnext.
  • NancyFX.  
    • Not specific to F#.
    • Can be made to work with F#, but not really getting any benefit here from using F#, are we.
I would love to have some feedback from the group as to which approach is considered most sustainable for large scale commercial API and SPA based system that will have to be expanded and maintained for several years into the future?

Ruben Bartelink

unread,
Sep 11, 2014, 9:18:02 AM9/11/14
to web-st...@googlegroups.com
As you'll guess, I'm amking similar assessments - I've been using F# for testing and C#+MVC for impl to date but will be doing impl in F#. Here's my take on your questions.

For me, SPA means client side templating being a core aspect of the design (Of course mobile and perf can bring it right back in)

The server side of something where you're doing client side templating over json can easily be done with just WebApi. Have a look at the Mark Seemann's A Functional Architecture in F# on PluralSight

The template you cite has a webapi only mode, which includes index.html, bootstrap, jquery etc.

AspNetVNext merges MVC and WebApi, but the side that'll do most of the giving will be MVC as it's the non-OWIN System.Web bit. 

If you want to do server side rendering, so what if your razor is a C# project as long as you have the shared stuff (shared with the APIs) in a [F#] library?

I personally am not 100% sure FunScript is necessarily the *only* way to go - TypeScript / CoffeeScript / vanilla should also be considered. (But I'd like to be convinced otherwise - can anyone talk about how you TDD Angular stuff written in FunScript please?)

Re dyfrig/frank/frost... I confused myself a bit. I partly blame v1 of this groups intro and partly that I read it too fast. Frank is a wrapper on WebApi. Use it or don't but it's there if your server API layer is F# WebApi. I plan to use it but would like to hear stuff. Frost looks too early as it is but then the point is to merge/converge with others and it explicitly says "dont use me!:

dyfrig is a very clean impl of owin bindings for F# by someone who is intimately familiar with *both* OWIN and F#. Its a substrate - a very nice one. You don't worry about it, but its excellent that its's there for stuff to be built on.

Simple.Web - the point is he's saying he's using WebApi now as it's not 100% perfect but it covers his reqs and he can extend it as he sees necessary, and he's *not* on vnext but will be

NancyFX I'd like to hear more about from others.For example it has a testing story. But I think I agree with your general stance that using it from F# is no magic combo - a lot of its power is wrt using dynamic and stuff and/or covering for inadequacies in C# relative to F#. Other point is that Nancy is on OWIN and hence is coming to aspnetvnext without any trouble or massive rearchitecture.

Bottom line is OWIN is the backbone of a lot of this.

And WebApi obv has a marketplace position due to MS. And it works just fine with F# and doesnt need no stinking templates!

Suave - had a scan, said no. Questions of it: what does it build on? Owin ? WebApi ? dyfrig? Who the hell are these people?

Have a look for Ryan Riley's recent presentations for a good rundown (most of this is based on reading and reading betweent the lines and some on me mishearing a 1.5x audio version of one of his talks)

@Ryan Riley can you please pick apart every one of my assumptions - I can take it and I know I'm making a lot of assertions that you can and should rebut!

Adam Granicz

unread,
Sep 11, 2014, 10:42:59 AM9/11/14
to web-st...@googlegroups.com
I love the way you exclude commercial options simply to avoid paying someone who worked hard to create those solutions.  This sort of mentality is why we have a proliferation of half-ready libraries and overall just about everyone who ventures into them ends up wasting far more time and effort and ends up unhappy.

I will happily assist anyone who wants to use WebSharper for commercial work, we are working with dozens of companies and are training hundreds of students and web developers as we speak.  If you think you are OK with a less enabled option, that's your choice.

WebSharper apps come in different flavors: client-server, client-only, SPAs, and can seamlessly work with dozens of tested JS libraries such as Sencha Touch, PhoneJS, etc.  You never have to write a single line of JavaScript, you enjoy functional abstractions that NO OTHER framework gives you (piglets, UI.Next), and you can even get licensed on a low monthly fee now.

And in just a few short days, you can get started and get inspiration from several impressive full-stack WebSharper applications available in CloudSharper, literally with just a few clicks in a full featured online F# IDE.


--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adam Granicz, IntelliFactory
www.intellifactory.com

Ryan Riley

unread,
Sep 11, 2014, 10:47:40 AM9/11/14
to web-st...@googlegroups.com
Thanks, Ruben! That was a nice response! I've added annotations below. I need to spend some time updating docs for my various projects, so a lot of this will appear in the project docs soon.


On Thursday, September 11, 2014 8:18:02 AM UTC-5, Ruben Bartelink wrote:
As you'll guess, I'm amking similar assessments - I've been using F# for testing and C#+MVC for impl to date but will be doing impl in F#. Here's my take on your questions.

Fantastic! Please provide feedback on your experience as you go.
 
For me, SPA means client side templating being a core aspect of the design (Of course mobile and perf can bring it right back in)

This is partly accurate. SPA is really a way of stating "client development in JavaScript." I personally think SPA is a terrible name, but I digress. In short, think of a SPA as you would a .NET client application running on the desktop, phone, or tablet. The client provides most of its own UI and merely consumes web APIs. The RESTafarians will add that you can, in fact, provide templates as part of the response, e.g. return HTML fragments rather than JSON, but once again I digress. 
 
The server side of something where you're doing client side templating over json can easily be done with just WebApi. Have a look at the Mark Seemann's A Functional Architecture in F# on PluralSight

Mark's is an excellent course. I recommend it.
 
The template you cite has a webapi only mode, which includes index.html, bootstrap, jquery etc.

True, and we really need to expand the template selection to include more of what is offered by the C# templates, e.g. an OWIN-based template.
 
AspNetVNext merges MVC and WebApi, but the side that'll do most of the giving will be MVC as it's the non-OWIN System.Web bit. 

Correct, again.
 
If you want to do server side rendering, so what if your razor is a C# project as long as you have the shared stuff (shared with the APIs) in a [F#] library?

Most of the C# you write in Razor is very minimal (usually). If you don't like C#, you could try the Markdown Razor engine from ServiceStack. There's also the option of using a Razor MediaTypeFormatter from Web API, though you are stuck with C# there, too.
 
I personally am not 100% sure FunScript is necessarily the *only* way to go - TypeScript / CoffeeScript / vanilla should also be considered. (But I'd like to be convinced otherwise - can anyone talk about how you TDD Angular stuff written in FunScript please?)

Isaac is currently working on a series of blogs discussing the use of Katana (Microsoft's OWIN implementation) with FunScript to build an Angular app. Perhaps he can provide some thoughts.
 
Re dyfrig/frank/frost... I confused myself a bit. I partly blame v1 of this groups intro and partly that I read it too fast. Frank is a wrapper on WebApi. Use it or don't but it's there if your server API layer is F# WebApi. I plan to use it but would like to hear stuff. Frost looks too early as it is but then the point is to merge/converge with others and it explicitly says "dont use me!:

Best source of understanding the options at present is http://fsharp.org/guides/web/. I'm not saying it is perfect or even clear, but it's the current list of options with descriptions and links. Please let me know if you have questions or suggestions for making it better. Isaac and I have both recently submitted changes to update and clean it up.

The projects listed in the welcome message are targeted at clearing up the confusion in the options. We are trying to consolidate and pool our resources so that we don't have a bunch of duplicate libraries floating around. You can see in the Welcome Message the libraries that we are consolidating.

Frank and HyperF roughly build on System.Net.Http, not necessarily Web API. They are very similar, though HyperF goes further towards the underlying streaming model, and Frank focuses primarily on providing combinators for constructing HTTP resources. The goal is for the HyperF web pieces to move to Frank and then build Frank on top of HyperF. HyperF becomes a general-purpose I/O library (and a very good one). The biggest advantage of these is that they skip the Reflection-based model of MVC and Web API and give you total control. The downside is they strip away all the Ruby-on-Rails-like stuff MVC and Web API add.

Suave is a soup-to-nuts web stack inspired by Happstack. I think they may be considering building on top of OWIN, but I'm not sure. If Haskell is your thing, then you may like this approach.

(Aside: Once upon a time, I tried to build Frank as a version of Haskell's Yesod framework. I could never get performant conduits, and eventually decided to just keep it as simple as possible.)
 
dyfrig is a very clean impl of owin bindings for F# by someone who is intimately familiar with *both* OWIN and F#. Its a substrate - a very nice one. You don't worry about it, but its excellent that its's there for stuff to be built on.

I saved discussion of Dyfrig for this annotation. Ruben is spot on with his notes above. I added a bunch of helpers, such as OwinRailway and the SystemNetHttpAdapter to provide alternatives to working directly with a mutable Dictionary. Also, Andrew Cherry (@kolektiv) provided an OwinMonad with lenses to provide another means of working with the Dictionary. His frost library builds on Dyfrig. Rather than mapping to other abstractions, frost leverages functional lenses and computation expressions to construct HTTP resources. I'm personally very excited about this idea. I had tried this before the computation expression query extension methods were available, and I think Andrew has done an excellent job. Unfortunately, it's not yet ready to build production applications.

While on the topic of OWIN, don't forget Microsoft.Owin, a.k.a Katana. This works just as well in F#.
 
Simple.Web - the point is he's saying he's using WebApi now as it's not 100% perfect but it covers his reqs and he can extend it as he sees necessary, and he's *not* on vnext but will be

NancyFX I'd like to hear more about from others.For example it has a testing story. But I think I agree with your general stance that using it from F# is no magic combo - a lot of its power is wrt using dynamic and stuff and/or covering for inadequacies in C# relative to F#. Other point is that Nancy is on OWIN and hence is coming to aspnetvnext without any trouble or massive rearchitecture.

I would agree NancyFX offers less to F# devs, specifically since the syntax is a little more noisy than the C# counterpart. Hard to believe, right? I think we have more Nancy templates for F# than we do for Web API and MVC. We certainly need to add templates for the rest
 
Bottom line is OWIN is the backbone of a lot of this.

That's my master plan, yes. ;) Amazing that OWIN is still based on delegate signatures, and I hope to keep it that way!
 
And WebApi obv has a marketplace position due to MS. And it works just fine with F# and doesnt need no stinking templates!

Possibly. :) The biggest confusion tends to be in the area of security. If you generate a C# web project with the security option you want, you can port that over to F# quite easily. All the new security packages are based on OWIN, and they are all available via NuGet. The best source for these is the Thinktecture org. See their GitHub page for more options than the Katana-supplied ones, as well as samples: https://github.com/thinktecture/Thinktecture.IdentityModel
 
Suave - had a scan, said no. Questions of it: what does it build on? Owin ? WebApi ? dyfrig? Who the hell are these people?

I made a few notes above. I only know the maintainers by reputation, and they are very sharp. The basis is Happstack, which is a popular Haskell web framework.
 
Have a look for Ryan Riley's recent presentations for a good rundown (most of this is based on reading and reading betweent the lines and some on me mishearing a 1.5x audio version of one of his talks)

I'm glad you learned something from me! I'm hoping to get a better recording soon. I'll also be using a faster machine next time, so hopefully you won't see my 5-year-old laptop churning on FSharp.Data.SqlClient resolutions. :)
 
@Ryan Riley can you please pick apart every one of my assumptions - I can take it and I know I'm making a lot of assertions that you can and should rebut!

You got most of it spot on, which tells me I'm doing at least a decent job of making up for my bad documentation over the years. Docs (and samples) are almost a higher priority for me now than building the libraries.

On that note, if you haven't see the todo-backend project, take a look at the F# implementation using OWIN (with bare-minimum use of Dyfrig): https://github.com/panesofglass/TodoBackendFSharp/blob/master/README.md

Isaac Abraham

unread,
Sep 11, 2014, 10:51:21 AM9/11/14
to web-st...@googlegroups.com

Firstly glad to see some (passionate!) discussions regarding the web story. My feeling is that we might want to start with a more “prescriptive” model to start with in terms of a starting place – whether that’s C# Razor Views + F# library, or F# Web API + SPA I don’t know – but I do think that simply trying to replicate the C#/VB.NET story in F# isn’t going to show the real power of F#.

 

As for the funscript side of things – I tried it very briefly the other night and got not too far with it to be honest – bur planning on having another crack at it this weekend perhaps.

--

Ryan Riley

unread,
Sep 11, 2014, 10:57:20 AM9/11/14
to web-st...@googlegroups.com
On Thursday, September 11, 2014 9:42:59 AM UTC-5, Adam Granicz wrote:
I love the way you exclude commercial options simply to avoid paying someone who worked hard to create those solutions.  This sort of mentality is why we have a proliferation of half-ready libraries and overall just about everyone who ventures into them ends up wasting far more time and effort and ends up unhappy.

I was going to address this point myself. I don't think you should just outright rule out WebSharper. If you are going to sell a product, you should weigh the costs of maintenance in the long run. WebSharper is a powerful tool, and we are investigating adoption it at my company, at least for front-end development. I encourage you to at least give it a shot. If you find it doesn't give you value over its cost or another option suits you better, at least you didn't miss out on a tool that could very well accelerate your development.

That said, I continue to find that F# is, in general, a fantastic language for building things. My experience building https://github.com/panesofglass/TodoBackendFSharp/blob/master/README.md, with the intent on being as raw as possible, surprised me in its simplicity.

Disclaimer: I'm in no way affiliated with IntelliFactory but am quite a fan of WebSharper despite never using it in a project ... yet.

Ryan Riley

unread,
Sep 11, 2014, 11:00:11 AM9/11/14
to web-st...@googlegroups.com
On Thursday, September 11, 2014 9:51:21 AM UTC-5, Isaac Abraham wrote:

Firstly glad to see some (passionate!) discussions regarding the web story. My feeling is that we might want to start with a more “prescriptive” model to start with in terms of a starting place – whether that’s C# Razor Views + F# library, or F# Web API + SPA I don’t know – but I do think that simply trying to replicate the C#/VB.NET story in F# isn’t going to show the real power of F#.

+1000000!

As for the funscript side of things – I tried it very briefly the other night and got not too far with it to be honest – bur planning on having another crack at it this weekend perhaps.

I haven't tried it in a long time. My first attempt was to make an Ajax call. I couldn't figure it out and couldn't find any examples. Recent YouTube videos gave me hope that it's improved significantly, but I've not tried it. 

Ryan Riley

unread,
Sep 11, 2014, 11:06:18 AM9/11/14
to web-st...@googlegroups.com
On Thursday, September 11, 2014 4:29:55 AM UTC-5, Quintus Marais wrote:
I would love to have some feedback from the group as to which approach is considered most sustainable for large scale commercial API and SPA based system that will have to be expanded and maintained for several years into the future?

We use a Web API project with AngularJS at Tachyus. We split our web project in two not long ago as the mix of F# files and HTML, JS, etc. became fairly large, and we had some trouble getting Web Essentials, which we use for bundling and minifying JS, to work. That's still an over-simplification. We have a bit of Dyfrig, Katana, and Frank-style handlers. Our Web API use is limited to tiny classes calling F# Async handler functions, with the idea that we will eventually get to Frank. We use the Microsoft.Owin.SystemWeb host to run in Azure Web Sites and use a number of OWIN middleware handlers written in F# that look similar to those I used in https://github.com/panesofglass/TodoBackendFSharp.

We considered a number of options for improving our front-end dev experience. We are currently leaning toward WebSharper but haven't made a firm decision on anything yet. We also considered TypeScript, Google's Traceur and Closure compilers, FunScript, Dart, ClojureScript, and a few other options.

I hope that is of some help.

Ryan

Adam Granicz

unread,
Sep 11, 2014, 11:23:00 AM9/11/14
to web-st...@googlegroups.com
Have you tried WebSharper + UI.Next?  I'd say that's a pretty solid "prescriptive", pure F# model to start with, and I wouldn't waste my time with anything less capable.  We never believed the BS about "F# is not good for building UIs" and spent years into researching what is a better way to build them.  Some of that is in WebSharper, flowlets, piglets, and now UI.Next - and anyone doing web development with F# should learn about these before making claims about other libraries/approaches.

If you ask me, AngularJS simply can't be compared to what you can do in pure F# with WebSharper+UI.Next, and I would love to come to an agreement about a community-built showcase application that can demonstrate that.

Isaac Abraham

unread,
Sep 11, 2014, 11:23:31 AM9/11/14
to web-st...@googlegroups.com

The SPA frameworks are all (relatively) nascent compared to the mature server-side frameworks. Not to say that they aren’t good – I really like AngularJS – but – particularly given the state of ASP .NET and the metamorphosis that it’s going through - it might be difficult to pick any architecture that you look back on in a few years’ time and think “yes, I made the right choice, there’s still nothing better”.

 

I’ve also made the decision with Owin to split from using F# web projects to a C# web host project (literally just a web.config) and an F# class library because the VS tooling struggles with allowing you to add files to it.

 

From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ryan Riley
Sent: 11 September 2014 16:06
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

 

On Thursday, September 11, 2014 4:29:55 AM UTC-5, Quintus Marais wrote:

--

Quintus Marais

unread,
Sep 11, 2014, 1:06:56 PM9/11/14
to web-st...@googlegroups.com
HI Adam 

My intention was certainly not to offend, and I do understand that a lot of hard work has gone into Websharper. From what I can see what has been achieved is certainly very impressive.  I admire any one who has the guts and gumption to have an idea and to try and make it to work.  It is not easy.  You certainly have achieved much more than I have so far. Intelligent, hard work on a problem that solves a need deserves to be rewarded.

I also understand that there is a trade-off between money and productivity. Unfortunately, sometimes one has time but not cash.  In that case you are forced to use the less productive option that does not require cash, even if you don't want  to. I will look at the product again as I was not aware of the monthly payment options. It is still not clear to me if the freelancer license is an option for us given that we are a company, even though we are just a startup with negligible revenue at this point.  Maybe your documentation on pricing can be clarified, and maybe you can have an exemption for companies below certain size or age, similar to what Xamarin is offering (less than 3 years or 20 employees are free).

It  is hard for end users to evaluate if a product will really increase their productivity, especially if documentation is a bit sparse.  A really good tutorial/sample project showing how your product works and achieves it productivity gains makes that easier.  You have some of that, but certainly need to do more work in this regard.

As we are a startup with no external funding and very small reserves from a country with a weak exchange rate to the $, we have to be very careful in our technology choices.  We only have one shot at the moon and if we do not succeed it is back to the slave galley for us.  As such we are evaluating different options and languages.  

Although in the F# space there does not seem to be a good viable full stack alternative to WebSharper at the moment, there certainly are in other language environments, such as clojure, or even ruby on rails, so you are competing against very competent free alternatives.  That is not an easy space to be in. As a thought experiment, imagine a programming language that charges a fee for a compiler. 20 or even 10 years ago that was common and a viable business model.  However, if I had to pay $800 dollars for a language compiler today to allow me to use it in commercial projects, I think I would look at a different language. Maybe web development stacks are also approaching this point.

At the moment F# seems to be a little immature as an enterprise web technology platform.  This forum is obviously trying to address that and I hope that I can make some contributions in this regard.

Ryan Riley

unread,
Sep 11, 2014, 3:54:23 PM9/11/14
to web-st...@googlegroups.com
On Sep 11, 2014, at 12:06 PM, Quintus Marais <quintus...@gmail.com> wrote:

At the moment F# seems to be a little immature as an enterprise web technology platform.  This forum is obviously trying to address that and I hope that I can make some contributions in this regard.

Immature but certainly not unready. We have had great success with F# as our web platform to date, and I would argue it’s been a far better experience than the C# projects I’ve worked on, though that is likely a result of my team.

Isaac Abraham

unread,
Sep 11, 2014, 3:57:36 PM9/11/14
to web-st...@googlegroups.com

I would second that. There are no clearly defined path(s) currently for people wanting to use F# within a web context, but I’ve had some fantastic results recently when rewriting a web api from C# to F# - agents fit very nicely in this context and within the azure space it’s a good match.

 

From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ryan Riley
Sent: 11 September 2014 20:54
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

 

On Sep 11, 2014, at 12:06 PM, Quintus Marais <quintus...@gmail.com> wrote:



At the moment F# seems to be a little immature as an enterprise web technology platform.  This forum is obviously trying to address that and I hope that I can make some contributions in this regard.

 

Immature but certainly not unready. We have had great success with F# as our web platform to date, and I would argue it’s been a far better experience than the C# projects I’ve worked on, though that is likely a result of my team.

 

--

Ruben Bartelink

unread,
Sep 11, 2014, 7:53:59 PM9/11/14
to web-st...@googlegroups.com
I could and should write this directly to you but the F# community has shown fantastic support and openness in my every experience with it so hey!

I know/hope this isn't directed mainly/only at me.

I really don't have any such beef or bias. (OTOH if we were comparing 50 ways of doing an API only that isnt a web app and I said "ServiceStack is too dear", why don't you use .)

I didnt get to see your session at DDD Belfast in '11 and constantly wonder why (not sure whether it was Robert Lally, Ashic or Andrea Magnorsky that was opposite you) and have only really read bits and pieces re IntelliFactory stuff and few [mp3'd 1.5 speed as I do for everything] presentations. Everything I see and hear about you and your company tells me if it was useful to me it would be worth the money. I don't have any idea what the money even is.

If I'm doing mobile apps, I'm not disregarding Xamarin. But I'm not saying it's the only game in town either.

I am deliberately not reading the other responses prior to posting this.

Now, here's a chance to sell to me.

We have less than 5 devs. JS skills are not too bad when you union us together but no JS wizards here - we're not going to ace any this or bind test. We're doing a web app. Our stuff is all hosted in Azure. Everything needs to be APIable. There's only a small part of our app that's likely to lend itself to serverside generation quick dev solving the problem without third parties also being able to program it witout feeling like 2nd class citizens. We have 2yo stuff in Backbone. We test stuff - we do quite a bit of TDD. We'll be on 2.x jquery.

We're doing a new system. We know F# from writing tests in it for 2yrs ish. We have not been pushing Haskell for evenings for 3 years.

We're confident we can do a backend DDD ES thing again.

Our web layer was ASP.NET MVC with a conneg hack that can render JSON or XML. We used AutoMapper.

Our front end is v likely to be Angular. Our API layer will not be ASP.NET MVC. WebApi appeals as a relatively small jump though I know it has stacks of shortcomings. I wanted to use Simple.Web but pretty much agree with Mark's stance. I think I want to use TypeScript but if anyone wants to argue and push CoffeeScript for any reason, fine too.

We used Ninject. We have about 1000 lines of Ninject stuff. I've read the Ninejct code, we've submitted PRs and chased memory leaks in it. It does great things and Remo is fantastic (and Ian before him). We could write the same stuff manually in 1500 lines. I'm not sure we should have but I can't recommend anyone to use it.

There will be no AutoMapper or DI container lib. There will be very little mucking about in presentation layer - it'll be ES Command Handlers and most validation out in the JS. On the read side, the Projections will render trees which won't need much transformation to go out as JSON. There will be no AutoMapper, very little EF, and nobody is going to worry about what the XML renders like. It needs to be portable to Mono in theory.

We're a product company. We won't be doing 20 small diverse projects for multiple clients over the next 2 years.

I'm feel Nancy might be a bit nicer than WebApi and am not scared of it. But I feel it's not a big win so it's going into the bucket of stuff that I don't want to experiment with even though I can be persuaded by any team member to use it instead at any time if the research has been done. (Which BTW goes for *anything* in this mail except for the F#, testing the JS, the no AutoMapper, the no DI and the no crazy 3000-5000 line C# OO based EventSourcing library that people seem to want to pour their heart and soul into polishing)

It's extremely likely I'm missing what your stuff can do for me. I have zero downloads from your site. I think TypeScript will be fine. I think I'll get to know the Chrome debugger better.

So, I guess that distills my assumptions about your products to:
* if it compiles down to JS, I better understand JS
* I have no interesting quantity of server side gen that I/we can't just do with razor with C# bodies 
* if I don't have reams of JS to do, I'm not necessarily going to benefit from an abstraction layer, no matter how good it is. So I'm not considering FunScript as a candidate (and to be honest I dont know exactly what you have in the area)
* I like dyfrig. If I need to understand it, it's not a lot of code. and it's neat. And its got a nice issues list. And Ryan's busy
* I like Frost. But I tossed looking at it after 10 mins as my head hurt and examples felt sparse and I was scanning some time between 1 and 2 am. But when I'm actually doing something, I'll eval it alongside whatever else
* I didnt get that Frank was based on WebApi and was ready to disregard it. I'm puzzled as to when stuff is going to happen or whether or what I'm missing. But is very little code and I'm not looking for a strategy to have a team of 20 randommers write 1000 APIs based on some master architecture. I might indeed use it.
* I think you have manuals, type providers, excellent support and well polished libraries
* I think you're open source and am confident I'd def have all your source if I was a customer
* I think there's stacks of code
* I can't understand how ServiceStack is going to work as a company. I have a lot less of those concerns about you. But if someone asked, I wouldnt immediately say "what a silly question, they're massive, have traction and at the end of the day, the community can fork and/or any shutdown of the company would release the code into OS even if something happened"

Bottom line. Despite being aware of your company and not thinking you're snake oil merchants, I've had you in my head but not bothered to really read much. I feel slightly guilty. But I feel guilty about lots of stuff I've yet to research and that I'm 18 days behind in Feedly. And that I have read Expert F# and Petricek but the Real World Haskell book is looking down at me from a shelf while I read the Miller/Block WebApi book on my holidays. I don't see my mistake yet.

I didnt feel qualified to comment re the OP's attitude to your products as the text read. I didnt assume how little or much they know. I didn't +1 or -1 their views on it. I didn't throw guesses at it.

I'll accept a small criticism in retrospect (i.e. if the cap fits stuff re your response) that I didn't try to infer how much of the stuff I'm saying I reckon I don't need to do that the OP thus also woudlnt want to do.

Now, call me out on stuff. 

Change a person's mind on the internet :P

Recognize I'm being flowery in my use of language, sometimes for effect, but also that I'm putting myself out there by speaking candidly before actually having much concrete code or experience - regardless of what I say or how long I take to write it, I'll look back and cringe in 6m, 2y, 5y and 10y!.

I'm puzzled why this list is such a lurker list as I really can't imagine doing a C# web+domain layer again in this lifetime.

I have placed every possible strawman and misconception up there - please knock them down one by one.

--Ruben

Ruben Bartelink

unread,
Sep 11, 2014, 8:06:57 PM9/11/14
to web-st...@googlegroups.com
I was going to address this point myself. I don't think you should just outright rule out WebSharper. If you are going to sell a product, you should weigh the costs of maintenance in the long run. WebSharper is a powerful tool, and we are investigating adoption it at my company, at least for front-end development. I encourage you to at least give it a shot. If you find it doesn't give you value over its cost or another option suits you better, at least you didn't miss out on a tool that could very well accelerate your development.

Me or the OP? That's a lot of complimentary generalities. What do you mean "front-end development". I know I'm extremely likely to do proper research on it now, but do you have an elevator speech for where it's sweet spot lies (esp in terms of my stated needs in my monster post?)

That said, I continue to find that F# is, in general, a fantastic language for building things. My experience building https://github.com/panesofglass/TodoBackendFSharp/blob/master/README.md, with the intent on being as raw as possible, surprised me in its simplicity.

I've scanned the code on my travels. it informed my thinking but to be honest it's confirming a lot of conclusions that can't be avoided when you confront how many libs you just want to chuck in the bin as you enter F# land that you'd have happily used for another 5 years in C# land. I guess the sentence above summarises what I was trying to project about why do I need a framework and tooling in F#? In F# I'll knock out 100 lines of glue code in one file that I would never consider writing the equivalent 500 lines in 4 classes in 3 files in an assembly in C#

Disclaimer: I'm in no way affiliated with IntelliFactory but am quite a fan of WebSharper despite never using it in a project ... yet.

Why are you a fan? Can someone please tell me what to use it for without me just going to RTFM (/ watch a video that's going to have me nodding)?

Also, I think all respondents to this thread should be required to declare whether they've watched a Functional Architecture in F# on PluralSight. It's definitely an influence on me.

--Ruben 

Ruben Bartelink

unread,
Sep 11, 2014, 8:18:10 PM9/11/14
to web-st...@googlegroups.com
>Although in the F# space there does not seem to be a good viable full stack alternative to WebSharper at the moment, there certainly are in other language environments, such as clojure, or even ruby on rails, so you are competing against very competent free alternatives.  That is not an easy space to be in. As a thought experiment, imagine a programming language that charges a fee for a compiler. 20 or even 10 years ago that was common and a viable business model.  However, if I had to pay $800 dollars for a language compiler today to allow me to use it in commercial projects, I think I would look at a different language. Maybe web development stacks are also approaching this point.

I don't get this. I know Bizspark and stuff but VS is not free and the TCO of MS stuff is not negligible. Can you clarify what way you're thinking here? No matter what your numbers are, the "price of the compiler" surely cannot matter to that degree? I don't think VS is the ultimate pinnacle of human capability, but between the normal IDE exp and how the background  compilation just works and doesnt make me compile (despite the fact that with 10% fo a Roslyn or AspNetVNext budget it would fly and rock and all that), I can't imagine giving that up. Even if it takes a while to find out how to hide CodeLensTM.

I don't agree that charging for dev tools is mad. I'm completely happy with the amount of the company's money that's gone into CodeRush over the years even if they never seem to do the stuff I log and instead build headline features that I have zero interest in.

--R

×Proofread

Ruben Bartelink

unread,
Sep 11, 2014, 8:24:09 PM9/11/14
to web-st...@googlegroups.com
I won't miss the "MVC tooling" etc. whatever stuff I do towards the surface of any web stuff I'm doing. And I anticipate a guaranteed halving of files, assemblies, lines of code relative to the old way - which was not done by idiots who were asleep at the wheel.

But ultimately "enterprise web technology platform" is a pretty meaningless phrase to me. But even then I'm not sure I want one, no matter who spent how long working on it (esp without the involvement of a vibrant community). Can Quintus clarify what he actually means - examples of sore points ? Examples of sizes of companies, types of teams, types of projects to which those apply?

--Ruben

Ruben Bartelink

unread,
Sep 11, 2014, 8:32:12 PM9/11/14
to web-st...@googlegroups.com
On Thursday, 11 September 2014 20:57:36 UTC+1, Isaac Abraham wrote:

I would second that. There are no clearly defined path(s) currently for people wanting to use F# within a web context, but I’ve had some fantastic results recently when rewriting a web api from C# to F# - agents fit very nicely in this context and within the azure space it’s a good match.

+1 on that.

Meant to mention that the Scott Wlaschin presentation on BLOBAs and my experience of DUs and Records (see FunDomain) mean I'll be doing an in-memory read side routed through agents to start off with *so* little junk and wasted mucking about vs projecting into SQL and fooling around with EF and AutoMapper etc.

And I don't care whether what happens next is:
- 300 lines that sticks it in RIAK
- someone rewrites that bit in C# with EF coz some clown wants to 'project' it via some OData contraption.

I can't get that sort of experience (stuff happening fast but not creating lots of files and typing as much as this evening) *with real type inference, type checking and intellisense anywhere I'm aware of. (Which doesnt mean I can't be persuaded to try a clojure stack either!)

--Ruben

Ruben Bartelink

unread,
Sep 11, 2014, 9:59:42 PM9/11/14
to web-st...@googlegroups.com
Why oh why did life intervene and take me away from this discussion until now eh!


Fantastic! Please provide feedback on your experience as you go.

Will try. And when I do, I hope it prods some of the lurkers off the ditch (I lurked for a long time, and there's plenty hanging about in F# land well into the max 2 year gestation period is my sense!) 
 
For me, SPA means client side templating being a core aspect of the design (Of course mobile and perf can bring it right back in)

This is partly accurate. SPA is really a way of stating "client development in JavaScript." I personally think SPA is a terrible name, but I digress. In short, think of a SPA as you would a .NET client application running on the desktop, phone, or tablet. The client provides most of its own UI and merely consumes web APIs. The RESTafarians will add that you can, in fact, provide templates as part of the response, e.g. return HTML fragments rather than JSON, but once again I digress.

Fair point. I'm well aware of that viewpoint and on the lookout for where it applies - things have moved on a lot since the Richardson/Ruby 2007 book but there's not much of it laughable just yet. A lot of the WebApi marketechture has a lot to answer for too, to paraphrase the dilution of thee concept of a Web App being an app and not a HTML bit and an API bit. But we are in MSland.

The server side of something where you're doing client side templating over json can easily be done with just WebApi. Have a look at the Mark Seemann's A Functional Architecture in F# on PluralSight
Mark's is an excellent course. I recommend it.

While we're recommending courses, the Kit Eason one on Functional Data Structures is high quality and good for beginners and as a refresher course. It conveys the power of the language pretty well. It completely doesn't have anything to do with this debate though (other than to highlight that having nice wizards at the front end doesnt necessarily outweigh a win you get across an entire stack)

The template you cite has a webapi only mode, which includes index.html, bootstrap, jquery etc.

True, and we really need to expand the template selection to include more of what is offered by the C# templates, e.g. an OWIN-based template.

That'd be nice but if your time is going into it, consider:

1. us F# doodlers can translate C# code
2. The cars are fine, but hardly global but don't spend more time on them
3. But I didnt know how to put a .fsproj with Web Api, a web.config and bootstrap that I can press F5 on together (I last did research 2 years back and it wouldnt have taken a week. But 6 months ago the wizard wasnt there and now it is and it worked in 5 mins)
4. Not sure the TODObackend is linked up there
5. Up there gives a good rundown but I think there's room for an evaluators guide blog post which simply indexes samples people should see. (Sadly I dont have a blog or much time)

blah blah

What I want to magically be done by the elves is: 

==>Frank and an example that shows an interesting Web api layer needs to be done and be prominent. No designer needs to TDD any Angular. Call it from tests written in Unquote, whatever.<===

Maybe there needs to be a github/fsprojects/webexamples ? Maybe there already is? And it should def have WebSharper stuff. And Nancy in F# stuff. And I'll stick in FunDomain stuff.

Aside: The way the project system and NuGet requires stuff in folders to stay beside eachother is causing NuGet package updates to explode. Thankfully paket will shortly solve this completely (Packet is *amazing* and for me as a part of my confidence in F# as a web platform vs 'tooling' and wizards as exemplified by the dialoggery in the NuGet. And I dont buy that the Package Manager Console is a whole lot different)
  
If you want to do server side rendering, so what if your razor is a C# project as long as you have the shared stuff (shared with the APIs) in a [F#] library?

Most of the C# you write in Razor is very minimal (usually). If you don't like C#, you could try the Markdown Razor engine from ServiceStack. There's also the option of using a Razor MediaTypeFormatter from Web API, though you are stuck with C# there, too.

Wasnt aware of the former and imagined the latter would exist. But it would be nice if this was in the magic index of stuff to use that's on a blog post. (And it should link to the former too). Adam's probing has me wondering why I know so little about ServiceStack (I have 2yo assumptions about SS being commodity stuff with commercial terms and didnt realize the offering is far broader than then) 
 
I personally am not 100% sure FunScript is necessarily the *only* way to go - TypeScript / CoffeeScript / vanilla should also be considered. (But I'd like to be convinced otherwise - can anyone talk about how you TDD Angular stuff written in FunScript please?)

Isaac is currently working on a series of blogs discussing the use of Katana (Microsoft's OWIN implementation) with FunScript to build an Angular app. Perhaps he can provide some thoughts.

Cool! I'm 16 days behind in Feedly. Asume F# weekly has a link that could have caused me to sub to the blog before now! I'd like to see it in the same repo. Alongside the WebSharper port. 

Re dyfrig/frank/frost... I confused myself a bit. I partly blame v1 of this groups intro and partly that I read it too fast. Frank is a wrapper on WebApi. Use it or don't but it's there if your server API layer is F# WebApi. I plan to use it but would like to hear stuff. Frost looks too early as it is but then the point is to merge/converge with others and it explicitly says "dont use me!:

Best source of understanding the options at present is http://fsharp.org/guides/web/. I'm not saying it is perfect or even clear, but it's the current list of options with descriptions and links. Please let me know if you have questions or suggestions for making it better. Isaac and I have both recently submitted changes to update and clean it up.

Visited the side when it launched. Wasnt esp looking for this sort of thing at the time so it wasnt pencilled in. In my head the intro to this list supplanted it as the index. It's more or less the imaginary blog post I was describing but it's important that its not a "no opinons" site vs what someone like you can do.

The projects listed in the welcome message are targeted at clearing up the confusion in the options. We are trying to consolidate and pool our resources so that we don't have a bunch of duplicate libraries floating around. You can see in the Welcome Message the libraries that we are consolidating.

I think its pretty good, but I know too much now to assess it with beginner eyes. Hopefully someone else will provide the insight at some point as they arrive. My sense is that despite it being the biggest intro I've ever seen for any mailing lists, it still could do with a little more detail. But I'm sure others would disagree.  

Frank and HyperF roughly build on System.Net.Http, not necessarily Web API. They are very similar, though HyperF goes further towards the underlying streaming model, and Frank focuses primarily on providing combinators for constructing HTTP resources. The goal is for the HyperF web pieces to move to Frank and then build Frank on top of HyperF. HyperF becomes a general-purpose I/O library (and a very good one). The biggest advantage of these is that they skip the Reflection-based model of MVC and Web API and give you total control. The downside is they strip away all the Ruby-on-Rails-like stuff MVC and Web API add.

Yes, that's what I want yesterday. But I undestand that it will happen when it happens and there's no point rushing it. In the meantime, I'll build stuff on Web Api and look forward to porting it and/or switching to writing new stuff in it when that happens

Suave is a soup-to-nuts web stack inspired by Happstack.

Sadly this means nothing to me!
 
I think they may be considering building on top of OWIN, but I'm not sure.

That's kinda like, ya know, important for a thing that considers itself to be a web stack :D
 
If Haskell is your thing, then you may like this approach.

As I said, I will read the book - its next on the list in fact. But I don't want soup to nuts. I want to be able to layer in whatever wacky auth is necessary in 6 months or 2 years without me being the first person to ever try anything remotely like that :)

(Aside: Once upon a time, I tried to build Frank as a version of Haskell's Yesod framework. I could never get performant conduits, and eventually decided to just keep it as simple as possible.)

Interesting, and I bet it taught you a lot. But for Frank, the balance to be struck to get a sizeable number of users is IMO one involving having few files/lines and having a high level set of combinators for doing normal stuff and then the fancy combinators that are inspired by this and that off in separate files and/or nugets. If there is a something in 1-2000 lines that isnt wacky and has an example on fsprojects which looks better *but can be looked at side by side with the WebApi usage in F#* equivalent, you'll have plenty traffic *and people will be able to wait in the wings on a stepping stone like F# WebApi stuff knowing there will be something sane they can start using at some point* (and they may well the jump onto some exotic combinator lib inspired by this and that in Elixir, Clojure or Haskell).
 
His frost library builds on Dyfrig. Rather than mapping to other abstractions, frost leverages functional lenses and computation expressions to construct HTTP resources. I'm personally very excited about this idea. I had tried this before the computation expression query extension methods were available, and I think Andrew has done an excellent job. Unfortunately, it's not yet ready to build production applications.

I felt the example was too small but it felt great. If it had a sample thay could be placed beside a WebApi and a Frank one and a WebSharper one etc. it'd convince me to spend longer staring at it. If there is a progression/sharing story between it and Frank, that'd be nice.

It'd also be nice to have enumerated somewhere an example of the sorts of stuff you can and might consider putting under one roof (e.g. you might have some webapi and Frank and Frost. Or frost with some pages rendered by e.g. xyz (e.g. the SS markdown and the webapicontib formatting)

While on the topic of OWIN, don't forget Microsoft.Owin, a.k.a Katana. This works just as well in F#.

Yes, that's def in my map. And it should be in the index with examples of what that means. But I guess there's a straw eventually! 

I would agree NancyFX offers less to F# devs, specifically since the syntax is a little more noisy than the C# counterpart. Hard to believe, right? I think we have more Nancy templates for F# than we do for Web API and MVC. We certainly need to add templates for the rest

I should look at those again. Imagine the result if the dedication and effort investment of Nancy was to be brought to bear on Frank/frost!
 
That's my master plan, yes. ;) Amazing that OWIN is still based on delegate signatures, and I hope to keep it that way!

How about a few Tuples in there :) (I have spent a certain amount of time looking at dyfrig - its inspiring to see the amount of polish on can deliver in a binding (with Just a few hundred-a few thousand hours work :) It's kinda what makes me look at frost/frank and wonder just how far they can go.

>Possibly. :) The biggest confusion tends to be in the area of security. If you generate a C# web project with the security option you want, you can port that over to F# quite easily. All the new security packages are based on OWIN, and they are all available via NuGet. The best source for these is the Thinktecture org. See their GitHub page for more options than the Katana-supplied ones, as well as samples

That's a given and obvious for me. But you didnt give the OWIN elevator pitch in the headline here. 

>Suave - had a scan, said no. Questions of it: what does it build on? Owin ? WebApi ? dyfrig? Who the hell are these people?

>I made a few notes above. I only know the maintainers by reputation, and they are very sharp. The basis is Happstack, which is a popular Haskell web framework.

As mentioned, interesting and might not be everyone's first port of entry but knowing roughly where they fit would be so much easier if there was a samples repo in fsprojects so one can compare like with like (and an entry ^^ saying "not OWIN yet" for them to fix and/or correct).
 
>I'm glad you learned something from me! I'm hoping to get a better recording soon. I'll also be using a faster machine next time, so hopefully you won't see my 5-year-old laptop churning on FSharp.Data.SqlClient resolutions. :)
Is the SSD 5yo :) 
 
>You got most of it spot on, which tells me I'm doing at least a decent job of making up for my bad documentation over the years. Docs (and samples) are almost a higher priority for me now than building the libraries.

Let the samples be dev'd incrementally as frost and/or Frank get rebuilt up/across. Let the github issues and FSharp.Formatting / markdown PRs be the doc. How does one PR the top of this ^^ All you need is a good clear README that says, we're not here yet. 

(OK I'm biased, but if you can't be cloned, I want the libs NOW please but thankfully you're far more balanced than that!)

>On that note, if you haven't see the todo-backend project, take a look at the F# implementation using OWIN (with bare-minimum use of Dyfrig): https://github.com/panesofglass/TodoBackendFSharp/blob/master/README.md
Thanks for the reminder again. Going right to the top of the pile. Esp if I ever get to the bottom of this thread!
Thanks for taking the time to reply and even more than that, thanks for the time on all your diverse activities - they all matter even if you have to survice on the silent gratiude of masses of lurkers in the wings as they ready themselves to provide doc and sample PRs [rather than writing emails]!

--Ruben


Ryan Riley

unread,
Sep 11, 2014, 10:12:39 PM9/11/14
to web-st...@googlegroups.com
On Sep 11, 2014, at 6:53 PM, Ruben Bartelink <bart...@gmail.com> wrote:

> * I didnt get that Frank was based on WebApi and was ready to disregard it. I'm puzzled as to when stuff is going to happen or whether or what I'm missing. But is very little code and I'm not looking for a strategy to have a team of 20 randommers write 1000 APIs based on some master architecture. I might indeed use it.

Frank is mostly based on System.Net.Http. It skips all the Reflection-based stuff. (I actually built a version that implemented all those intermediary interfaces but felt it just added unnecessary weight.) You can find some limited docs at http://frankfs.net/. I have a few tasks to complete with Dyfrig, then I’ll be ready to start flushing out docs and samples for it and Frank. I don’t think there’s anything major outstanding for Frank. I should check. I want to do the HyperF -> Frank thing described in the Welcome Message, but I think it’s pretty solid. It’s really a intended to provide a core concept and combinators to make building Web APIs dead simple, following the notion of “pipe to the web."

Ruben Bartelink

unread,
Sep 11, 2014, 10:15:33 PM9/11/14
to web-st...@googlegroups.com
>"F# is not good for building UIs"

Nobody is saying that here though ? People have a wacky gut reaction to Razor not supporting F# and there's nothing you can say no matter how much better it may actually be.

>Some of that is in WebSharper, flowlets, piglets, and now UI.Next 

Do you have a set of links and/or relevant examples?

I'd love if you'd do a breakdown of that right now because I have scanned blog articles and "flowlets, piglets, and now UI.Next" doesn't really light up any pathways in my brain.

Perhaps a from the horse's mouth paragraph of 3 explaining the end to end landscape of your offerings vs all of us going over and trying to read between the lines of a brochure and/or involving comparisons with C# code?


>If you ask me, AngularJS simply can't be compared to what you can do in pure F# with WebSharper+UI.Next, and I would love to come to an agreement about a community-built showcase application that can demonstrate that.

Do you guys have something even half good samplewise to point at?

I simply do not know how/why/what the routing, page composition, client side composition type things that Angular does are done or rendered obsolete by hour solution.

Just e.g. agreeing that everyone will port the MVC music store is obv a big thing to actually bring to fruition. But do you at least have a TODO backend? Could it live in the repo in fsprojects I've been handwaving about?

If there's no substitute for trying it, then I guess that'll happen eventually.

--Ruben

Ryan Riley

unread,
Sep 11, 2014, 10:19:25 PM9/11/14
to web-st...@googlegroups.com
On Sep 11, 2014, at 7:06 PM, Ruben Bartelink <bart...@gmail.com> wrote:

> Me or the OP? That's a lot of complimentary generalities. What do you mean "front-end development". I know I'm extremely likely to do proper research on it now, but do you have an elevator speech for where it's sweet spot lies (esp in terms of my stated needs in my monster post?)

I was responding to the OP. By “front-end development,” I meant web client, i.e. JavaScript and HTML.

> I've scanned the code on my travels. it informed my thinking but to be honest it's confirming a lot of conclusions that can't be avoided when you confront how many libs you just want to chuck in the bin as you enter F# land that you'd have happily used for another 5 years in C# land. I guess the sentence above summarises what I was trying to project about why do I need a framework and tooling in F#? In F# I'll knock out 100 lines of glue code in one file that I would never consider writing the equivalent 500 lines in 4 classes in 3 files in an assembly in C#

Exactly. I just reviewed a friend’s JS presentation for an upcoming code camp, and he mentioned the same. F# and JS both provide such nice, simple tools that frameworks are often unnecessary. However, while you can find a few OSS projects similar to W#’s, you won’t find the level of completeness, polish, and performance they provide. That’s true of any set of tools. You just have to find the right balance.

> Why are you a fan? Can someone please tell me what to use it for without me just going to RTFM (/ watch a video that's going to have me nodding)?

I really, really like UI.Next. It follows a well documented formula for concurrent programming: Reppy’s Concurrent ML. I also really like the Piglets, Formlets, and Flowlets. Sitelets are also nice. These are of course useful when building web sites more than web APIs, but still quite nice. I love composing things to get bigger apps. WebSharper makes that first-class for UIs, and it works quite well. I’ve had issues with the generated JS over the years but nothing that would prevent me from using it if I’d been able to persuade my managers.

Ryan

Ruben Bartelink

unread,
Sep 11, 2014, 10:29:35 PM9/11/14
to web-st...@googlegroups.com
Thanks a lot for this post.
 
We use the Microsoft.Owin.SystemWeb host to run in Azure Web Sites

I'll work it out but I'd have to guess so I'll ask the silly question: Can you unpack please (what is that vs web F# MVC 5 template in Web api only mode? Is it the same? Is there a fundamental choice here? Does only one work in AWS? Or are you just saying, coz we use OWIN, we use the single obvious host that enables ... your minifier? a few razor pages))

We considered a number of options for improving our front-end dev experience. We are currently leaning toward WebSharper but haven't made a firm decision on anything yet. We also considered TypeScript, Google's Traceur and Closure compilers, FunScript, Dart, ClojureScript, and a few other options.

Is there a one-liner on what WebSharper could give as its biggest pro? And con (that's more interesting than a financial concern) 

Have you got a high level concept on whether you'd be using those with Angular or potentially switching to a libset that works well with your chosen development environment

-=Ruben

Ruben Bartelink

unread,
Sep 11, 2014, 10:32:27 PM9/11/14
to web-st...@googlegroups.com


On Thursday, 11 September 2014 16:23:31 UTC+1, Isaac Abraham wrote:

>The SPA frameworks are all (relatively) nascent compared to the mature server-side frameworks. Not to say that they aren’t good – I really like AngularJS – but – particularly given the state of ASP .NET and the metamorphosis that it’s going through - it might be difficult to pick any architecture that you look back on in a few years’ time and think “yes, I made the right choice, there’s still nothing better”.

+1 (but that's been true of web stuff for some time)
  

I’ve also made the decision with Owin to split from using F# web projects to a C# web host project (literally just a web.config) and an F# class library because the VS tooling struggles with allowing you to add files to it.

struggles: crashes , hangs, nullptr in nuget when installing/upgrading?
errors if you reoder and/or put files into folders?

--R

Ruben Bartelink

unread,
Sep 11, 2014, 10:49:35 PM9/11/14
to web-st...@googlegroups.com

> Why are you a fan? Can someone please tell me what to use it for without me just going to RTFM (/ watch a video that's going to have me nodding)?

I really, really like UI.Next. It follows a well documented formula for concurrent programming: Reppy’s Concurrent ML. I also really like the Piglets, Formlets, and Flowlets. Sitelets are also nice. These are of course useful when building web sites more than web APIs, but still quite nice. I love composing things to get bigger apps. WebSharper makes that first-class for UIs, and it works quite well. I’ve had issues with the generated JS over the years but nothing that would prevent me from using it if I’d been able to persuade my managers.

Thanks. I'm just going to have to look at it then. Ya had me at composability :)

--Ruben

Ruben Bartelink

unread,
Sep 11, 2014, 10:53:10 PM9/11/14
to web-st...@googlegroups.com
Sounds excellent and a key point. I'll leave you alone so you can continue to clear the path on the way to getting space to do it!

--Ruben

Isaac Abraham

unread,
Sep 12, 2014, 2:56:16 AM9/12/14
to web-st...@googlegroups.com
There are some good docs on MSDN / ASP. NET about owin and katana. But in a nutshell they are a lightweight distilled form of the MVC pipeline that allows you much more control of the http pipeline. Out also supports out there hosting side from web projects so you can easily host a website in a console app for example.

Owin can be used to host web API, websites or whatever. I recently did a blog post on hosting webapi through owin in f#. It's as little as the startup class (as little as two or three lines of code) and then just your controller classes. No massive folder structures. Just the owin NuGet dependencies.

There's no relationship between owin and aws or azure - not sure what you're asking with that?

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 03:29

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

--

Isaac Abraham

unread,
Sep 12, 2014, 2:58:30 AM9/12/14
to web-st...@googlegroups.com
You can't add files to an F# web project. There's a way around this because it was working for me for weeks but it stopped a while ago and I can't get it back again. Oddly enough this happened shortly after I watched Mark Seemans excellent F# Web API Pluralsight course in which he mentions this exact issue.

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 03:32

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

--

Ruben Bartelink

unread,
Sep 12, 2014, 4:45:35 AM9/12/14
to web-st...@googlegroups.com
I get all that stuff - if you had an hour or two you could probably find one or two holes in my understanding as I haven't actually done much mucking about with OWIN, but Ryan has read it and I didn't feel too battered in the end :D

Having said that, I guess it highlights that a paragraph or two on what OWIN means re composability and how much OWIN code you'll be writing in your app as part of the context of this group might not hurt.

This was a quote of a specific passage from Ryan where he listed off reams of stuff. I was wondering whether his mention of "Microsoft.Owin.SystemWeb" and AWS in the same sentence meant anything other than "I use this class and I deploy it here". i.e.
- Is the selection of that specific host a decision that e.g. the normal templates don't do (he alluded to doing an OWIN template)?
- Does AWS (I should stop using that abbreviation for Azure Websites!) force this in any way?

Looking forward to reading your blog; it hadnt come on my radar as yet!

--Ruben

Ruben Bartelink

unread,
Sep 12, 2014, 4:50:16 AM9/12/14
to web-st...@googlegroups.com
>You can't add files to an F# web project. There's a way around this because it was working for me for weeks but it stopped a while ago and I can't get it back again. Oddly enough this happened shortly after I watched Mark Seemans excellent F# Web API Pluralsight course in which he mentions this exact issue.

Existing files or new? The mention in the course didnt enter my consciousness :)

Is there a connect issue? Can you add them manually? Is it related to adding stuff nested in a folder? How exactly are you adding them? What do the diffs of the fsproj say? All latest VS2013 fully updated?

(I just know the `.fsproj` rejects stuff where it's not sorted in folder order. i.e. <Compile "A\f.cs"/> <Compile "B\f.cs"/><Compile "A\f.fs"/> fails to load with a clear error message and I've a pretty good idea that's why you cant nuget update jquery and/or bootstrap out of the templates (see my cited Paket issues))

--Ruben

Ruben Bartelink

unread,
Sep 12, 2014, 4:54:57 AM9/12/14
to web-st...@googlegroups.com
One follow on is that one selling/mindshare increase tool for targetting lazy people like me is PluralSight.

I'd have arrived at most of my conclusions without Mark Seemann's course.

But e.g. my understanding of Angular and/or is largely based on the excellent AngularJS Getting Started course.

If you had an equivalent of that, it'd be a great thing to be able to point at. It's an extremely well produced course. Its not impossible to do yourself and/or host for free but I'd strongly consider it.

--Ruben

On Thursday, 11 September 2014 15:42:59 UTC+1, Adam Granicz wrote:
I love the way you exclude commercial options simply to avoid paying someone who worked hard to create those solutions.  This sort of mentality is why we have a proliferation of half-ready libraries and overall just about everyone who ventures into them ends up wasting far more time and effort and ends up unhappy.

I will happily assist anyone who wants to use WebSharper for commercial work, we are working with dozens of companies and are training hundreds of students and web developers as we speak.  If you think you are OK with a less enabled option, that's your choice.

WebSharper apps come in different flavors: client-server, client-only, SPAs, and can seamlessly work with dozens of tested JS libraries such as Sencha Touch, PhoneJS, etc.  You never have to write a single line of JavaScript, you enjoy functional abstractions that NO OTHER framework gives you (piglets, UI.Next), and you can even get licensed on a low monthly fee now.

And in just a few short days, you can get started and get inspiration from several impressive full-stack WebSharper applications available in CloudSharper, literally with just a few clicks in a full featured online F# IDE.

On Thu, Sep 11, 2014 at 3:18 PM, Ruben Bartelink <bart...@gmail.com> wrote:
As you'll guess, I'm amking similar assessments - I've been using F# for testing and C#+MVC for impl to date but will be doing impl in F#. Here's my take on your questions.

For me, SPA means client side templating being a core aspect of the design (Of course mobile and perf can bring it right back in)

The server side of something where you're doing client side templating over json can easily be done with just WebApi. Have a look at the Mark Seemann's A Functional Architecture in F# on PluralSight

The template you cite has a webapi only mode, which includes index.html, bootstrap, jquery etc.
AspNetVNext merges MVC and WebApi, but the side that'll do most of the giving will be MVC as it's the non-OWIN System.Web bit. 

If you want to do server side rendering, so what if your razor is a C# project as long as you have the shared stuff (shared with the APIs) in a [F#] library?

I personally am not 100% sure FunScript is necessarily the *only* way to go - TypeScript / CoffeeScript / vanilla should also be considered. (But I'd like to be convinced otherwise - can anyone talk about how you TDD Angular stuff written in FunScript please?)

Re dyfrig/frank/frost... I confused myself a bit. I partly blame v1 of this groups intro and partly that I read it too fast. Frank is a wrapper on WebApi. Use it or don't but it's there if your server API layer is F# WebApi. I plan to use it but would like to hear stuff. Frost looks too early as it is but then the point is to merge/converge with others and it explicitly says "dont use me!:

dyfrig is a very clean impl of owin bindings for F# by someone who is intimately familiar with *both* OWIN and F#. Its a substrate - a very nice one. You don't worry about it, but its excellent that its's there for stuff to be built on.

Simple.Web - the point is he's saying he's using WebApi now as it's not 100% perfect but it covers his reqs and he can extend it as he sees necessary, and he's *not* on vnext but will be

NancyFX I'd like to hear more about from others.For example it has a testing story. But I think I agree with your general stance that using it from F# is no magic combo - a lot of its power is wrt using dynamic and stuff and/or covering for inadequacies in C# relative to F#. Other point is that Nancy is on OWIN and hence is coming to aspnetvnext without any trouble or massive rearchitecture.

Bottom line is OWIN is the backbone of a lot of this.

And WebApi obv has a marketplace position due to MS. And it works just fine with F# and doesnt need no stinking templates!

Suave - had a scan, said no. Questions of it: what does it build on? Owin ? WebApi ? dyfrig? Who the hell are these people?

Have a look for Ryan Riley's recent presentations for a good rundown (most of this is based on reading and reading betweent the lines and some on me mishearing a 1.5x audio version of one of his talks)

@Ryan Riley can you please pick apart every one of my assumptions - I can take it and I know I'm making a lot of assertions that you can and should rebut!

--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Isaac Abraham

unread,
Sep 12, 2014, 5:32:07 AM9/12/14
to web-st...@googlegroups.com
There are multiple ways of hosting OWIN apps. One is via IIS which is where the webhost comes in. Others are e.g. Console host or the self host which runs in any process e.g. Azure worker roles.

Yes caution re using AWS for Azure since it is better known as an abbreviation for Amazon Web Services - a competing technology to Azure Websites :)

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 09:45

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

I get all that stuff - if you had an hour or two you could probably find one or two holes in my understanding as I haven't actually done much mucking about with OWIN, but Ryan has read it and I didn't feel too battered in the end :D

Having said that, I guess it highlights that a paragraph or two on what OWIN means re composability and how much OWIN code you'll be writing in your app as part of the context of this group might not hurt.

This was a quote of a specific passage from Ryan where he listed off reams of stuff. I was wondering whether his mention of "Microsoft.Owin.SystemWeb" and AWS in the same sentence meant anything other than "I use this class and I deploy it here". i.e.
- Is the selection of that specific host a decision that e.g. the normal templates don't do (he alluded to doing an OWIN template)?
- Does AWS (I should stop using that abbreviation for Azure Websites!) force this in any way?

Looking forward to reading your blog; it hadnt come on my radar as yet!

--Ruben

On Friday, 12 September 2014 07:56:16 UTC+1, Isaac Abraham wrote:
There are some good docs on MSDN / ASP. NET about owin and katana. But in a nutshell they are a lightweight distilled form of the MVC pipeline that allows you much more control of the http pipeline. Out also supports out there hosting side from web projects so you can easily host a website in a console app for example.

Owin can be used to host web API, websites or whatever. I recently did a blog post on hosting webapi through owin in f#. It's as little as the startup class (as little as two or three lines of code) and then just your controller classes. No massive folder structures. Just the owin NuGet dependencies.

There's no relationship between owin and aws or azure - not sure what you're asking with that?

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 03:29

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

Thanks a lot for this post.
 
We use the Microsoft.Owin.SystemWeb host to run in Azure Web Sites

I'll work it out but I'd have to guess so I'll ask the silly question: Can you unpack please (what is that vs web F# MVC 5 template in Web api only mode? Is it the same? Is there a fundamental choice here? Does only one work in AWS? Or are you just saying, coz we use OWIN, we use the single obvious host that enables ... your minifier? a few razor pages))

We considered a number of options for improving our front-end dev experience. We are currently leaning toward WebSharper but haven't made a firm decision on anything yet. We also considered TypeScript, Google's Traceur and Closure compilers, FunScript, Dart, ClojureScript, and a few other options.

Is there a one-liner on what WebSharper could give as its biggest pro? And con (that's more interesting than a financial concern) 

Have you got a high level concept on whether you'd be using those with Angular or potentially switching to a libset that works well with your chosen development environment

-=Ruben

--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Isaac Abraham

unread,
Sep 12, 2014, 5:32:10 AM9/12/14
to web-st...@googlegroups.com
It's a visual studio issue. It doesn't know how to handle projects that are F# and Website in one so you can't add anything when you do "add new". However you can copy files from other projects or manually edit the fsproj.

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 09:50

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

>You can't add files to an F# web project. There's a way around this because it was working for me for weeks but it stopped a while ago and I can't get it back again. Oddly enough this happened shortly after I watched Mark Seemans excellent F# Web API Pluralsight course in which he mentions this exact issue.

Existing files or new? The mention in the course didnt enter my consciousness :)

Is there a connect issue? Can you add them manually? Is it related to adding stuff nested in a folder? How exactly are you adding them? What do the diffs of the fsproj say? All latest VS2013 fully updated?

(I just know the `.fsproj` rejects stuff where it's not sorted in folder order. i.e. <Compile "A\f.cs"/> <Compile "B\f.cs"/><Compile "A\f.fs"/> fails to load with a clear error message and I've a pretty good idea that's why you cant nuget update jquery and/or bootstrap out of the templates (see my cited Paket issues))

--Ruben

On Friday, 12 September 2014 07:58:30 UTC+1, Isaac Abraham wrote:
You can't add files to an F# web project. There's a way around this because it was working for me for weeks but it stopped a while ago and I can't get it back again. Oddly enough this happened shortly after I watched Mark Seemans excellent F# Web API Pluralsight course in which he mentions this exact issue.

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 03:32

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

On Thursday, 11 September 2014 16:23:31 UTC+1, Isaac Abraham wrote:

>The SPA frameworks are all (relatively) nascent compared to the mature server-side frameworks. Not to say that they aren’t good – I really like AngularJS – but – particularly given the state of ASP .NET and the metamorphosis that it’s going through - it might be difficult to pick any architecture that you look back on in a few years’ time and think “yes, I made the right choice, there’s still nothing better”.

+1 (but that's been true of web stuff for some time)
  

I’ve also made the decision with Owin to split from using F# web projects to a C# web host project (literally just a web.config) and an F# class library because the VS tooling struggles with allowing you to add files to it.

struggles: crashes , hangs, nullptr in nuget when installing/upgrading?
errors if you reoder and/or put files into folders?

--R

--
You received this message because you are subscribed to the Google Groups "F# Web Stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-stack-fs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruben Bartelink

unread,
Sep 12, 2014, 5:33:02 AM9/12/14
to web-st...@googlegroups.com
When I mentioned samples repo in fsprojects, I'm now torn in two directions (esp by the ASP.NET vNext) between:

- 1 solution so you can gain a high level overview that no amount of writing in any way anywhere can do (show me the code)
- Just links the way TodoBackEnd is (everyone is in charge of their own impl)

I guess on the C# side, the same issue exists, i.e. there's plenty examples but (AFAIK) there's no like with like comparable sample which e.g has an impl of a web app which covers:

Server page gen in C#:
- Nancy
- MVC
- struggling now e.g. Simple.Web MonoRail

More SPAish in C#:
- MVC controllers
- WebApi
- Nancy

As AspNetVNext takes shape I guess its looking like the Music Store is becoming that sample.

I guess it's more of an OWIN WebStack gallery really then - not something on fsprojects (but it seems a crime to not use Paket and the F# doc gen stuff to generate doc pages a la http://thinkbeforecoding.github.io/FsUno.Prod/)

Maybe there "just" needs to be C# and F# versions of the Music Store in Nancy.

And then, the Frank API layer can start from the WebApi or the Nancy one.

And the WebSharper one slots in too.

One problem: I guess to accumulate the aggregate bandwidth and someone to really drive it (the way Paket is moving right now) to coordinate this as an OS community thing is probably some distance off.

--Ruben (Who should stop emailing and lamenting and finish off his side projects so he could even consider starting something like this rather than talking about what this mystical "the community" could do!)

Ruben Bartelink

unread,
Sep 12, 2014, 5:36:11 AM9/12/14
to web-st...@googlegroups.com
>There are multiple ways of hosting OWIN apps. One is via IIS which is where the webhost comes in. Others are e.g. Console host or the self host which runs in any process 
=>e.g. Azure worker roles.

Ah, now I see what he and you were driving at (I was just thinking of Web Roles vs Azure Web Sites and couldnt see the difference/need to disambiguate given that they are both IIS)


>Yes caution re using AWS for Azure since it is better known as an abbreviation for Amazon Web Services - a competing technology to Azure Websites :)

A competing technology  for Azure Virtual Machines that is :) Won't happen again!

--R

Isaac Abraham

unread,
Sep 12, 2014, 5:42:39 AM9/12/14
to web-st...@googlegroups.com
Yes re: Azure VMs but people are also using it instead of azure websites too.

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 10:36

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

--

Ruben Bartelink

unread,
Sep 12, 2014, 5:42:56 AM9/12/14
to web-st...@googlegroups.com
>It's a visual studio issue. It doesn't know how to handle projects that are F# and Website in one so you can't add anything when you do "add new". However you can copy files from other projects or manually edit the fsproj.

What does it say? No menu item? Or do you pick from the tree and it explodes ?

Is that same problem also evident/reproable with an OOTB F# MVC wizard app?

Or am I missing something? I just added a TypeScript file to my WebApi project? What are you seeking to add to what?

Is it logged? Sounds like something to shout about to get it fixed?



--Ruben

Ruben Bartelink

unread,
Sep 12, 2014, 5:48:29 AM9/12/14
to web-st...@googlegroups.com
>Yes re: Azure VMs but people are also using it instead of azure websites too.

Just saying that for me contextless use of the term AWS would in general imply to the IAAS level of their stack versus the more PAAS stuff. But I haven't looked recently enough to know what their equivalent of Azure WebSites is and what it's called.

i.e. I'd accept a "AWS/Azure" or "AWS/Azure VMs" but for me the appellation "AWS/Azure Web Sites" is meaningless as I don't know that that's called. Same way "Azure Web Sites/AppHarbor" conveys something to me. 

--Ruben

Isaac Abraham

unread,
Sep 12, 2014, 6:18:17 AM9/12/14
to web-st...@googlegroups.com

No items show up in the list to add. It only happens when you manually change the fsproj to be a web-enabled project by adding a project type GUID. Like I said, it used to work – I suspect it might be a combination of that plus something else e.g. Web Essentials, which I also recently installed, that causes the issue.

 

From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ruben Bartelink
Sent: 12 September 2014 10:43
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

 

>It's a visual studio issue. It doesn't know how to handle projects that are F# and Website in one so you can't add anything when you do "add new". However you can copy files from other projects or manually edit the fsproj.

--

Andrew Cherry

unread,
Sep 12, 2014, 7:46:50 AM9/12/14
to web-st...@googlegroups.com
Wow, this is quite a discussion! I don't really have any great solutions or answers to add, but some general thoughts...

- Having multiple ways of doing things isn't necessarily too bad a thing - as long as we have good documentation and examples to help people make choices. I think some languages (Ruby, primarily) have actually suffered by having too much of a monoculture over time. Of course, that kind of adoption problem is the sort of problem we can only dream of :)

- OWIN is not the greatest piece of design work in the world, but it's a good idea for everyone to have some way of working with it - it does at least give a chance of things working together, rather than lots of lovely but incompatible walled gardens.

- I think there's certainly room for commercial and open source approaches to web in F#. I don't know WebSharper too well, purely because I know, for various reasons, that I'd be very unlikely to use it (it's in a part of the stack where I feel very strongly about having an open source solution, but that's purely a personal perspective). I know enough about it, and the fact that it's got some seriously smart people working on it, to know that most people should at least evaluate it and see whether the commercial/closed aspect is fine for them given the benefits (which I'm sure exist).

- ASP.NET vNext, from what I've seen, seems like *kind of* a step in the right direction, but mainly if you're a C# dev. That's understandable - most of the target market are. I'm sure it'll be made to work reasonably nicely with F#, but the fundamental issue is that the way of building websites it pushes (classes, methods, etc. mapping to HTTP requests, automatic serialization, and that kind of thing) is a basically un-functional way of building systems. F# works very well in an object world (a bit too well for my liking at times!) but I know I personally feel that I'm most productive (and most happy!) when taking a functional approach to solving a problem. So I think some *really* functional libraries/frameworks/stacks for building web things in F# are worth having.

- There are so many different aspects to what "web" means, as we've seen in the discussion so far. Having libraries which are special purpose, as opposed to very general like ASP.NET vNext seems like a functional approach. Being able to compose low level libraries (common abstractions), and a router, and a resource framework, to create a really good stack focused on just building very precise APIs, for example, seems like a functional approach - maybe you'd compose a different set of libraries to create a server side rendered "traditional" web app. 

- The Frost project is essentially an incubation of ideas (which will probably not end up being called Frost). It was originally all about writing good APIs - because that's what I had a wish to do! I took the approach of WebMachine (which has also been ported to various other languages - Liberator in Clojure, Lemmachine in Haskell, etc. - that last one is really worth a look by the way for what it tries to do!). To make it work I needed to write other parts of the stack - pipelines, routers, etc. so I've been playing with those too, but I am very much aware that what is currently Frost is undocumented and non-primetime. However, I am hoping that changes in the very near future. At a minimum I'm planning on a comparable implementation of the TODO backend example.

Anyway, some rambling thoughts. It's nice to actually see discussion around this. For quite a long time it seemed as if the number of people in the world that were interested in a good F# web story was probably about 8...

Andrew

Adam Granicz

unread,
Sep 12, 2014, 9:04:47 AM9/12/14
to web-st...@googlegroups.com
Regarding the "I don't know WebSharper but I'd be very unlikely to use it because I feel very strongly about open source solutions" bit: WebSharper is and has been for years fully open source.  And as such, it's also freely available for open source projects.  What's not open source are the private and premium *extensions* which are included in various subscriptions.
Adam Granicz, IntelliFactory
www.intellifactory.com

Ryan Riley

unread,
Sep 12, 2014, 9:14:00 AM9/12/14
to web-st...@googlegroups.com
It isn't a VS issue but an intentional design in the F# project system. The F# Power Tools project provides an ""Add Folder" feature, but it has some problems, again due to the F# project system.

From: Isaac Abraham
Sent: ‎9/‎12/‎2014 4:43 AM
To: web-st...@googlegroups.com
Subject: RE: Recommended F# approach for commercial Software as a Serviceapplication - also relates to "Sample Application" topic

Ryan Riley

unread,
Sep 12, 2014, 9:16:16 AM9/12/14
to web-st...@googlegroups.com
Ah! Sorry, I misread previously. Yes, I have seen that, too, but it doesn't seem consistent. The latest Visual F# Tools upgrade seemed to mostly fix it for me.

From: Isaac Abraham
Sent: ‎9/‎12/‎2014 5:18 AM
To: web-st...@googlegroups.com
Subject: RE: Recommended F# approach for commercial Software as a Serviceapplication - also relates to "Sample Application" topic

Ruben Bartelink

unread,
Sep 12, 2014, 10:08:31 AM9/12/14
to web-st...@googlegroups.com

>No items show up in the list to add. It only happens when you manually change the fsproj to be a web-enabled project by adding a project type GUID. Like I said, it used to work – I suspect it might be a combination of that plus something else e.g. Web Essentials, which I also recently installed, that causes the issue.

For avoidance of doubt... Why? ... To allow Web Publish? To switch on MVC tooling? Any specific part thereof?

--Ruben

Isaac Abraham

unread,
Sep 12, 2014, 10:09:28 AM9/12/14
to web-st...@googlegroups.com

If you were in the C# world and ran a website, would you do it as one project or two?

 

From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ruben Bartelink
Sent: 12 September 2014 15:09
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

 

>No items show up in the list to add. It only happens when you manually change the fsproj to be a web-enabled project by adding a project type GUID. Like I said, it used to work – I suspect it might be a combination of that plus something else e.g. Web Essentials, which I also recently installed, that causes the issue.

For avoidance of doubt... Why? ... To allow Web Publish? To switch on MVC tooling? Any specific part thereof?

 

--Ruben

--

Ruben Bartelink

unread,
Sep 12, 2014, 10:14:54 AM9/12/14
to web-st...@googlegroups.com
Andrew, 

Thanks - excellent info. Looking forward to FrostVNext a lot (And if I may speak for the lurkers, so are they!)

Be sure to post the start of the TodoMvc as you're doing it! 

--Ruben

Ruben Bartelink

unread,
Sep 12, 2014, 10:30:25 AM9/12/14
to web-st...@googlegroups.com

>If you were in the C# world and ran a website, would you do it as one project or two?

I am not questioning your decisions (and [surprisingly] not _trying_ to be argumentative) in any way.

I am trying to understand what you're doing. Then I could try it too and/or repro and/or decide I don't want to do that.

I dont have Mark Seemann's post or ref to it in the PluralSight video paged in and am attempting to build up a map of the problem you're saying you're having.

I'm for example am on VS2013 latest with the F# MVC 5 template and generate a project. I do no tweaking of project type guids.

I see 
- consistently (but havent looked for long and havent attempted to analyze what triggers it) "Specified cast is not valid." instead of the Web Publishing tab of the project props.
- Direct refusals to load my csproj if the files in the csproj are not in folder order (inc VS putting them in the wrong place). But I can do a fixup and life moves on

Other than that I'd have nothing to report.

(And to answer the Q: Yes minimize project count where possible. Certainly have no desire to split for any Astronautical or other reasons.)

--Ruben

Andrew Cherry

unread,
Sep 12, 2014, 10:37:06 AM9/12/14
to web-st...@googlegroups.com
Ah, I owe Adam an apology there - it is of course an open source core. Sorry, don't mean to be spreading misinformation! For me it's still out of contention purely because of the types of projects I tend to work on when I occasionally end up actually *using* some of the code I write, but WebSharper is still an impressive piece of work worth a look by anyone.

Andrew

Isaac Abraham

unread,
Sep 12, 2014, 10:44:27 AM9/12/14
to web-st...@googlegroups.com

Wasn’t trying to be argumentative either J simply saying, it was to cut down on project sizes – if I want a simple website, I want to be able to do it in one website rather than two J

 

Mark’s demo of this issue is fairly early on in his video – certainly within the first few sections.

 

The specified cast is not valid issue goes away with the latest Visual FSharp Tools (3.1.2) as far as I’m aware.

 

From: web-st...@googlegroups.com [mailto:web-st...@googlegroups.com] On Behalf Of Ruben Bartelink
Sent: 12 September 2014 15:30
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

 

>If you were in the C# world and ran a website, would you do it as one project or two?

--

Ruben Bartelink

unread,
Sep 12, 2014, 11:02:26 AM9/12/14
to web-st...@googlegroups.com
Have 3.1.2 but as I say, have done no tracing - while I havent got much junk, it's not a fresh wizard app either.

(Since I uninstalled the advertising toolkit the only thing not bang up to date is my WInPhone 8.1 emulators :P)

Right now I have to go watch videos...

--R

Ruben Bartelink

unread,
Sep 12, 2014, 12:45:13 PM9/12/14
to web-st...@googlegroups.com
I've watched it: Demo: How to create an F# Web Project is third last sequence in the first module.

He puts in the guid and talks about setting it to IIS express and there not being a template etc..


If you've followed my links and/or have the F# MVC 5 template. I'm in my up-to-date VS2013 w/ VFPT (3.1.2)

a) there is a template
b) there's no entering a GUID
c) there's no right clicking to make it IIS Express, it already is
d) there's no 2 projects

My csproj has:

    <ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>

and FlavorProperties

So I put it to the floor that the problems and fun you're talking about are historical and have been rendered null and void.

When you've satisfied yourself that I'm not ranting, rejoin me here and we'll give @panesofglass a big round of applause.

NB all this stuff is covered in all the other stuff around here. I know it's a lot to read, but it was a lot to write too and it's confusing for others to reiterate it.

... unless I am wrong. If you're experiencing something different, can you make sure you say *exactly* what you're doing though?

--Ruben

Isaac Abraham

unread,
Sep 12, 2014, 2:14:56 PM9/12/14
to web-st...@googlegroups.com
If they are historical then I must be imagining it then...

Either way... I'm not really sure what you're getting at - I'm not accusing anyone of anything. I was asked a question about what problem I was referring to with web projects under F#. I explained. The end.

From: Ruben Bartelink
Sent: ‎12/‎09/‎2014 17:45

To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Service application - also relates to "Sample Application" topic

Ruben Bartelink

unread,
Sep 12, 2014, 4:57:12 PM9/12/14
to web-st...@googlegroups.com
>If they are historical then I must be imagining it then...

No ifs or imagination involved.


Update 2013.19.12: It turns out that it's possible to hack the registry to make it possible to add standard F# project items to the project.

Update 2014.02.17: Since I wrote this article, new F# templates are now available for Visual Studio, including a template for F# ASP.NET MVC 5 and Web API 2 projects.

IOW there is an F# MVC / WebApi template and It Just works, thanks to the hard work of @panesofglass.

The reason I'm coming over all pedantic is that people read this stuff. They follow along. They see Ruben and Ryan saying it's all fine. Then they see doubt being cast.

>Either way... I'm not really sure what you're getting at - I'm not accusing anyone of anything. I was asked a question about what problem I was referring to with web projects under F#. I explained. The end.

And then they see people pooh poohing little items like this.

These things  need to be root caused and I was attempting to play my part in getting things clear. 

When people say "oh yeah but it doesn't work so I did this hack" and the response doesn't add up...

When people say "You misinformed person|You rude person|You person with a cross to bear against closed source software", I explain my reasoning (exec summary: "I feel it's not appropriate in my context, please confirm or deny. Here' have the floor so people can hear what your products do. Actually let me explain myself so ti might help you communicating the message about your product"). Crickets!

It's why I prioritize PRs on READMEs and issues over my desire to submit code PRs.

Between this subthread and my wonderfully productive two-way flow with Adam, I'm resolving not to put stuff into a threaded conversation black hole for quite some time.

I have dumped the junk I was going to type in here in https://jabbr.net/#/rooms/fsharp

If anyone wants to have a two way conversation about anything, I'll be there.

Now I'm going to read your blog and I'm going to learn stuff!

I also need to, for the sake of the F# web stack, Paket and my sanity, get to the bottom of why the wizard app jquery can't be updated - is it VFPT (and if so what ver) or VS.

--Ruben

Ryan Riley

unread,
Sep 12, 2014, 5:29:31 PM9/12/14
to web-st...@googlegroups.com
I think you two may be missing one another. I think Isaac's complaint was with the Add Item dialog and its tendency to sometimes fail to show any items (and it's duplicate). I've hit this less frequently since updating the Visual F# Tools, but I once again experienced it today. Restarting sometimes helps, but not always. I, too, thought it was Web Essentials, but it's inconsistent, and now that we are using a F# library + C# web project, I'm certain it's something with the Visual F# Tools.

To clarify why we use the F# library + C# web project now, it's something I've also done in the past with C# projects. If you are building a Web API and SPA, it can sometimes help keep files and context to a minimum by separating the projects even if you deploy them together. We have a lot of F# files and a lot of js files in our projects, and the separate projects make it a tad nicer. Also, we have many more people working in the F# project, so taking the JS files into a separate project is a means of cleaning up their experience. Lastly, Web Essentials doesn't currently work in F# projects (see CodePlex for the issue). I've toyed with the idea of using gulp.js, but I don't know if I really want to bring in another build dependency.

Ruben Bartelink

unread,
Sep 12, 2014, 6:51:04 PM9/12/14
to web-st...@googlegroups.com
>I think you two may be missing one another. 

Ya think :P

Your insight into partitioning strategies is v valuable. Someone should do an "C# F# MVC template" to model this :P

When one considers the minefield that mixing Folders with F# file ordering presents (as documented in https://github.com/fsprojects/Paket/pull/84 ), in the short to medium term it seems like a pretty valuable technique.

I need to learn waay more about the various JS build tools. Another one on the list :)

--Ruben

Ruben Bartelink

unread,
Sep 12, 2014, 7:01:51 PM9/12/14
to web-st...@googlegroups.com
> Lastly, Web Essentials doesn't currently work in F# projects (see CodePlex for the issue). 

I added upvote #5, can we get some more please?

amusing understatement in comments: "I think it would be a challenging and interesting work item for someone to tackle"

--Ruben

Dave Thomas

unread,
Sep 12, 2014, 8:26:47 PM9/12/14
to web-st...@googlegroups.com
How does any all of this apply to xplatform   f# e.g mono on osx/linux.  It would be nice if that had a presence too. 
--

Ryan Riley

unread,
Sep 12, 2014, 8:48:28 PM9/12/14
to web-st...@googlegroups.com
Apart from xbuild missing some things, everything pretty well works the same on *nix as on Windows. I don't know how to create templates for MD/XS. The only difference with the VS templates I've found is the need to specify FSharp.Core version in the fsproj. XBuild doesn't support variables in those, or so it would seem.

From: Dave Thomas
Sent: ‎9/‎12/‎2014 7:26 PM
To: web-st...@googlegroups.com
Subject: Re: Recommended F# approach for commercial Software as a Serviceapplication - also relates to "Sample Application" topic

Reply all
Reply to author
Forward
0 new messages