Hacker News new | ask | show | jobs
by klibertp 4400 days ago
But you do realise that .NET is not only C#? And that F# had many (maybe even most, but I didn't research enough to say this) features that Swift has?

(And, on the related note, that Swift has not even one (or maybe? as I said, I didn't do enough research yet) novel, unique feature which wouldn't be already explored and implemented in other languages.)

What you're saying is an equivalent of "there's many things wrong with JVM, for example lack of type inference".

3 comments

This is a great point, and I think it's one of the most powerful things about .NET. You can compile most (many) other languages and use it all interchangeably. Build in one language, use in another.

Each language has its pros/cons, and depending on the project you're working on, you can pick which language is best for the task at hand.

This is addressed to. Not all languages compile cleanly to the CLR. Running in the VM has serious tradeoffs as well. Garbage collection is a serious problem for soft/hard real time apps. Understanding performance is difficult too because the VM may be doing stupid things behind your back and you can't directly control things like CPU cache locality with this many layers.

Porting the VM is also difficult. It is a really complicated piece of machinery, and if you are in truly cross platform environments, getting the VM up on new systems is a massive engineering challenge in by itself. Often these other environments are CPU and memory constrained too which isn't great for the .NET VM.

I'm not sure these are actually problems with the Microsoft stack, though. Most mainstream languages run in VMs these days — JavaScript, Ruby, Python, Lua, PHP, all JVM languages. Off the top of my head, the ones that don't are pretty much the three C's and Go.
F# is really cool, but the fact that it isn't the primary .NET client language does show. For example, Swift's mandatory option types are fantastic, and they're so integral to the language that they get special syntax support. Meanwhile, F# has an option type, but non-F# code doesn't know anything about it, so any actual use of the system frameworks litters your code with unexploded null mines.