Capabilities of F#

I know nothing of F#, haven’t even written a single line of F# code yet, so apologies if this question seems bothersome.

I intend to work with F# under Windows to develop Fluent UI based applications for Windows 11 and further. I will typically need capabilities like network programming, concurrency and symbolic computation.

Would F# offer me the ability to accomplish my goals using the language and it’s libraries under Windows? Or would I have to write the UI separately using C#?

Thanks.

My impression is that any sort of XAML-based project in F# is not well supported. In some cases, I believe it’s possible, but you’ll not have as smooth of an experience as you’d have with C#. Maybe that story has changed since I looked last, but I haven’t read anything that suggests it’s improved.

If specifically using Fluent UI is a goal, I suspect you’re better off having a C# project for the UI and F# projects for the rest. If Fluent UI isn’t a goal in itself, you might consider something like a React app with Electron to turn it into a desktop app all built with Fable so you’re in F#.

Fluent UI is, of course, a separate topic. But in terms of XAML-based desktop applications, F# is very well supported in AvaloniaUI (https://avaloniaui.net/).

As far as all the other aspects of building applications (networking, symbolic programming, etc.) F# has all the same capabilities as C#.

Instead of revamping old methods someone should just formulate an F# method that implements a JavaScript ViewMenu without C# that has a good FS.

I want to use either Giraffe, Saturn, or Fable to interopt with JavaScript. I don’t like blobing. Which one of them is my best bet for curtailing IO text from a JavaScript render over to F#?

Giraffe and Saturn are backend server libraries. Giraffe is more low-level and built on top of ASP.NET. Saturn is higher-level, and actually built on top of Giraffe. So you can use any Giraffe code in a Saturn project, or add some Saturn code into an existing Giraffe project.

Fable is a frontend library that converts your F# code into Javascript. If you want to interop with Javascript, Fable is your only option among the 3 you listed.

These days for any sort of full-stack web application, the SAFE Stack is usually recommended (where the S in Safe stands for Saturn and the F stands for Fable - so actually you’d typically use all three!)

1 Like

When we say “interop” does this regard more than rendering html and js views or should I be able to IO between html/js view engine results and F# code and reciprocally eg. render js text in a js textarea and have this piped in F# as an F# array string?

So Fable lets you write F# code that compiles to JS, and import JS code into F# so you can call it as if it were native F# code. No strings of JS code involved, it just does the translation from F# to JS for you.

Interoping with js-html and Saturn appears to meet F#'s standard laws of minimalism. Fable looks to be more on par with Web Sharper’s view engine innerworkings. The split frames between F# source, js source, etc… was not smooth runnings for me so I’m using Saturn. Moreover, there is no restriction in relating both FSharp script and js view in the same module for interfacing interopt between both langauges.