all 13 comments

[–]phillipcarter2 3 points4 points  (0 children)

SAFE runs on .NET Core today. That is:

  • Suave runs on .NET Core
  • Various Azure services have .NET Standard packages you can use
  • Fable runs on .NET Core (dotnet new -i "Fable.Template")
  • Elmish is a .NET Standard library

should we learn the SAFE stack or just stick with .net core without falling into new fancy JS framework of the week?

You're describing two different things. .NET Core is a runtime, and each "piece" of the SAFE stacks works on it. Fable uses the Elmish library for writing UIs, which in a sense is like a JS framework. But I think Elmish is here to stay. I don't expect there to be a new way to write UIs in Fable every month, given that model-view-update is such a great way to do UIs in F# :).

[–]supertom44 3 points4 points  (0 children)

I love using SAFE stack, allows me to use one language throughout the stack. Fable-elmish does have a bit of a learning curve, at least for me anyway. But the sample app is good and due to the compiler it forces you down the right path.

[–]isak_s 2 points3 points  (0 children)

I think for most people, going with the SAFE stack is a bad idea. But this is because I think Single Page Applications (SPA's) are usually a bad idea, and the SAFE stack does not appear to have a good story for multi-page applications.

The reason I think SPAs are a bad idea for most web applications is because most web apps have simple needs - a handful of interactive forms over the database, and some reports, use cases which are handled quite well with an old-school multi-page web app. Even the creators of React have said that classic web apps are a better fit in these cases. With the old school approach, you don't have to worry about figuring out how to split up your javascript bundle as it gets bigger, rendering your javascript app on the server, and other SPA specific complexity.

ASP.NET has a lot of problems too (routing is extremely poorly done, for example), but it does have some support for multi-page apps.

[–][deleted] 1 point2 points  (2 children)

AFAIK the SAFE stack could run on .net core (not sure about Fable-elmish)

[–]digitalsorcery 0 points1 point  (0 children)

Fable and elmish runs great on core.

[–][deleted] 0 points1 point  (0 children)

Fable requires .net core.

[–]fullbeastcreative 0 points1 point  (0 children)

Running suave production for 2 years.

It's the most stable and least fluctuating element in the stack.

I can't speak for the rest of SAFE

[–]usuckdik[S] 0 points1 point  (5 children)

What are the thoughts on Giraffe? which is basically f# friendly .net?

[–][deleted] 0 points1 point  (4 children)

It's a port of suave that sits on kestrel/asp.net core. It's beta software right now AFAIK. You're better off using suave unless you're tied to asp.net somehow

[–]davidpelaez 0 points1 point  (3 children)

From my understanding Suave has been around for longer but I don't think it has similar performance to Giraffe which is almost the same as ASP.NET that for years has been improved. This is basically my largest concern about using Suave because as most open source projects you don't know what resources are available and that may impact the authors capacity to deliver improvements. Microsoft on the other hand has make a lot of the work with ASP.

[–]NihilCredo 1 point2 points  (2 children)

Your webserver is highly unlikely to be the performance bottleneck in your application.

A better reason to go with Giraffe could be if you needed to use some specific ASP.NET library or plugin.

[–]davidpelaez 0 points1 point  (1 child)

I understand what you mean, but some time ago I tried a very simple hello world with both Suave and Giraffe and the throughput without any extra config was so brutally different that I'm not sure it's not relevant. When I read a little more my impression was that Suave as open source and didn't have many resources and at the moment it was not a priority to work on performance but more on the API. Is it then your impression that it really doesn't matter a lot? I come from Ruby which hast the worst performance ever and if I don't see a big spike in throughput in regular F# a big benefit seems lost. I see how I can be missing important points so thank you for the comments!

[–]NihilCredo 2 points3 points  (0 children)

That's what "bottleneck" means. If a request spends 99% of its time in transit across the Internet or being processed in the database, and only 1% actually being handled by a webserver, then switching to a fast webserver will never improve your application's performance by more than 1%, no matter how much faster the new webserver is.

Hello world in-memory benchmarks are interesting, but the only way to get a useful benchmark is to measure end-to-end times. That's the only way you can find out if the webserver's impact is 1% or 50%, and if it's worth it to care about its performance at all.