> Basically a single assembly has to be written in the same language.
This is like saying a single js file has to come from only js files, still bundlers today merge all kinds of types in there - in a single sweep.
I am not writing this since I think mixing C#/F# is the future (well, it would be cool), but because it could allow the C# ecosystem to improve. Right now the best thing we have for metaprogramming in C# is Fody; and I personally think we could do better.
Hopefully this expressed my idea a little bit better.
Or, you know, use ILMerge, which is pretty much the equivalent of the JS bundlers you mention. With some custom MSBuild targets you should be able to create a project file that contains C# and F# files, both of them compile to intermediate assemblies (although you can't have circular dependencies between both), and a step afterwards merges the assemblies into the actual one.
`<OutputType>module</OutputType>` in your project file (or `/target:module` at the command line, and you get a smaller unit.
This is actually untrue - though the tooling does not make it easy.
If the output type of a 'project' is set to `module` instead of `assembly`, it can be added as a module reference to another project which builds an assembly.
The downside used to be that completion in the IDE didn't work, but as far as I'm aware there's no real reason why multi-module assemblies couldn't easily be exposed by tooling if it was considered important enough.