Hacker News new | ask | show | jobs
by tombert 2384 days ago
I did something similar for a large-ish C# project and F#. The company I worked for was mostly an F# place, but we had a fairly large legacy codebase written in C#; typically we had the pattern of "if you had downtime or need to fix a bug in the C#, just rewrite the C# code into F#".

Annoyingly, at least with the typical msbuild pattern, you have to be using the same language at the project level, but you can have as many projects as you want per solution (it's weird). So it's not as seamless as the JS/TS system, but overall it's not too bad, since you still can mix and match somewhat.

1 comments

MSBuild assumes you want a 1-to-1 relation between projects and assemblies, so assemblies and projects are interchangeable. There is no hybrid C#/F# compiler than can produce one assembly out of source code from both languages, so you’ll always need at least 2 compilers to be involved, hence the need to have a csproj and an fsproj side by side in your code base.

Regardless, major kudos for your rewrite!

Yeah, I knew that actually; it's still annoying :), but after awhile you kind of get used to figuring out how to split up the stuff you're going to rewrite.

It wasn't just me; it was everyone on my team, and probably everyone in the company; I'm pretty glad they did that though; F# ain't perfect, but I like it a lot better than C#.