4 ms·
Fable is a brilliant project. It doesn't try to hide the fact that when you write a Fable program, you're fundamentally in the JS ecosystem. This can be a bit
by phillipcarter 5y ago
Fable is a brilliant project.
It doesn't try to hide the fact that when you write a Fable program, you're fundamentally in the JS ecosystem. This can be a bit of a shift if you're used to doing stuff in .NET, but it means that everything will more or less work with your code.
It also comes with a few tools/utilities to ease the F#-JS bridge you're on.
- amelius 5y ago> it means that everything will more or less work with your code So you can call any .NET library?
- lgessler 5y agoby "everything" I think GP is referring to the JS ecosystem
- amelius 5y agoOk. Wouldn't it make more sense to compile .NET bytecode to JS?
- mumblemumble 5y agoI've never dealt much with transpiling to JS, but I would guess that it's a lot easier to do it from the AST or some other higher-level intermediate representation than it is from CIL instructions. That way you don't have to fuss with programmatically figuring out what stack manipulation instructions are trying to accomplish or any other target-specific noise like that.
- phillipcarter 5y agoNot necessarily. Aside from being more technically challenging, it's more of a "what are our goals" kind of question. Do you want to give F# developers who are afraid of javascript a way to avoid it altogether, or a way to bring those developers into the javascript ecosystem?
- pharmakom 5y agoFable has easy interop with JS libraries because it compiles to JS.
- DimmieMan 5y agoNot quite, it's a middle ground, https://fable.io/docs/dotnet/compatibility.html https://fable.io/docs/dotnet/compatibility.html Blazor, (or Bolero as an F# friendly extension) compiles to WASM to run any .Net library. In practice you occasionally find something that doesn't quite work, for the most part things related to IO and the TPL but I occasionally run into some more niche functionality with Date & time for example. You can use most of the core F# library and some non fable centric libraries (e.g. FSharp.UMX of FSToolkit.ErrorHandling) work just fine. I find it mostly a non issue, as any IO you want to go through the browser API instead or it's not supported. It didn't take take long at all to easily slip into the "I'm in the browser now" mindset.