Patterns to mix F# and C# in the same solution

前端 未结 8 782

I studied few functional languages, mostly for academical purposes. Nevertheless, when I have to project a client-server application I always start adopting a Domain Driven

相关标签:
8条回答
  • 2020-12-24 12:12

    We have an application which gets all of its functionality by loading MEF parts. Most of the parts are written in C#, but there is one part which does binary data processing which is written in F#. In this case F# was simply better suited for the job.

    The F# part conforms to an interface defined in C# and the C# application has no idea it's dealing with an F# part (other than the dependency on fsharp.dll).

    Of course this doesn't just apply to F#, if someone wants to write or rewrite a part (addon, module, whatever you want to call it) in a different language it will be picked up by MEF and provided to our application without any disadvantages.

    We choose the language that is best suited to solve a specific problem and MEF abstracts all the specifics away from us, so we have nothing to worry about.

    0 讨论(0)
  • 2020-12-24 12:17

    I use F# for exploratory programming in my C# solutions. E.g. I fire up my C# WPF app through visual studios F# interactive console and poke around in the running application. Can save you a lot of edit-compile-debug sessions..

    0 讨论(0)
提交回复
热议问题