3 ms·
What about using F# just for the compiler and C# for the rest of the backend? That way, the friction of using libraries goes away, for example, using asp.NET co
by Scarbutt 6y ago
What about using F# just for the compiler and C# for the rest of the backend? That way, the friction of using libraries goes away, for example, using asp.NET core or other third party libs will be smoother. Though joggling between two languages may seem to have higher cognitive overhead I think you are already doing this by having to call C# APIs in lots of places.
- rienbdj 6y agoThere is no friction to using C# libraries in F#, it’s just that you will be using the imperative / OOP features of F# rather than the functional programming ones.
- Scarbutt 6y agoThere's overhead in reading documentation, ex: all of asp.net core docs and examples are in C#.
- cjaybo 6y agoDoes your proposed solution remove the need for reading documentation?
- Scarbutt 6y agoNo, the overhead will be in how to best map the F# to the C# code all the time while reading C# docs versus just not having this mental juggling in C#.
- piaste 6y agoThere's barely any overhead to consuming c# libraries from f#. You type "open SomeLib" instead of "using SomeLib;" and "let x = SomeClass (foo, bar)" instead of "var x = new SomeClass(foo, bar)". You check return values with "match Option.ofObj value" instead of "if (value != null)".
- andendau 6y agoThere's some level of friction in working with databases. Not insurmountable but painful.