--
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.
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 beNancyFX 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!
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.
--
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.
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.
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?
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:
--
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.
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.
--
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.
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.
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 PluralSightMark'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.
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.)
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#.
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
That's my master plan, yes. ;) Amazing that OWIN is still based on delegate signatures, and I hope to keep it that way!
>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
>Suave - had a scan, said no. Questions of it: what does it build on? Owin ? WebApi ? dyfrig? Who the hell are these people?
>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. :)
>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.
We use the Microsoft.Owin.SystemWeb host to run in Azure Web Sites
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.
>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.
> 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.
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 beNancyFX 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.
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?
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.
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.
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.
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.
--
>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.
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
--
>If you were in the C# world and ran a website, would you do it as one project or two?
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?
--
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
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.
--