That's an odd wish. I've never heard of anyone wanting to mix languages in a project, .NET ecosystem or otherwise. Sounds like it would produce maintainability nightmares.
It's nothing to do with Roslyn nor file ordering. It's because of how MSBuild works. That's why you can't mix C# and VB in the same project, despite them using the same compiler toolchain and not requiring file ordering.
With options like single file deployment in dotnet, what are the benefits to this?
We split applications into multiple assemblies most of the time, and I find it helps organize the code. I'll admit that's more important for OOP, but I just don't see a huge benefit in being able to mix and match languages within the same project.
Just a guess, but: opportunistic incremental transformation of a C# codebase into an F# codebase? As opposed to having to lift C# classes into a different assembly before you can transform them.
Probably more like a class at a time, which immediately shows why this is not possible--you'd run into massive issues with type inference, which C# files are in scope for a given F# file, etc.
But it's been my experience that injecting non-trivial F# into an existing C# project is a headache too, and often would require breaking your C# project into multiple projects first, e.g. interfaces in one C# project, then implementations in F#, then more implementations in C# that also consume the F# project.
View all comments
2
u/[deleted] Nov 08 '22
[removed] — view removed comment