Anders Hejlsberg – What brought about the birth of the CLR? (2004)
channel9.msdn.com
channel9.msdn.com
The "father" of the CLR is probably Mike Tougtangi, or Chris Brumme. I'm not exactly sure who was on that original team.
Can you explain that? Are there incentives to do other stuff?
I really miss having them when doing work in other languages, even with some of the covariance gotchas, they're just amazingly good.
> He was the original author of Turbo Pascal and the chief architect of Delphi. He currently works for Microsoft as the lead architect of C#[1] and core developer on TypeScript.
For better or worse, he influences with his C# syntax ideology now TypeScript and indirectly JS/ES6.
1. OS isolation -- the VM provides a platform-neutral API for OS services, and abstracts away details like clocks etc.
2. Intermediate language representation, a JIT (or several JITs, in the case of the JVM) and dynamic code loading/manipulation.
3. A GC (or several GCs, in the case of the JVM).
Each of these features is completely independent (in fact, some JVMs don't even provide #2, opting for AOT compilation. Golang, OTOH, is not perceived to run in a "VM" -- simply because its "managed runtime" is statically compiled with the program, and no JIT is available -- yet it provides #1 and #3, just like some JVMs).
Now, as to why you'd want to provide each of those features -- well, there are different reasons. #1 is great for cross-platform portability. #3 is great for simplifying programming, esp. in multithreaded settings. #2, the JIT, is actually an optimization layer with some tradeoffs. A JIT can always produce machine code at least as efficient as the most sophisticated profile-guided optimizing compiler, and then some; to do that, it trades off warmup-time, and extra CPU cycles that can make a difference on energy-constrained platforms (although a JIT with caching might enjoy both worlds). In addition, a JIT is an absolute necessity when trying to achieve high-performance when running dynamically-typed languages. Another downside to JITs is that they're very hard to write well (i.e. while they can surpass the code quality emitted by AOT compilers, it takes more effort to even match that quality).
So, in general, there is no such thing as a "managed runtime" -- just a collection of features, each with its own motivation. That name also has a connotation of overhead, which again, is completely false. A GC may add some overhead (RAM, latency) but may also reduce overhead (throughput, more scalable concurrency) -- depending on your application. A JIT may add overhead -- warmup time, extra cycles -- but may also reduce overhead (more efficient generated code).
To rephrase my question - why it is not possible to have statically linked this collection of features into standalone executable? Like Go. I understand that Go is bare-bones compared to .NET, but Delphi/C++Builder also supports fully standalone executables. As for cross-platform (source) portability - it could use Ahead-Of-Time compilation into native exe.
Go is designed mostly for smallish programs (command line programs like Docker or simple services), so static AOT compilation and static linking makes sense.
Java, OTOH, is mostly used in large, important, performance-critical server-side services, where the added performance offered by having a JIT is important, and the warmup time isn't, while dynamic linking allows for dynamic code loading/swapping.
Just like there are JVMs that do AOT compilation to a native binary, there's nothing stopping .NET from doing the same[1]. There's also nothing stopping a single SDK from providing both options. It usually boils down to a question of what the users of that SDK need.
[1]: I would bet that that's exactly where MS is going. Like I said before, writing a good JIT is hard, and OpenJDK's HotSpot is years ahead of the CLR in that respect and only widening the gap with its next-gen JIT, Graal. I think MS would realize that it's easier for them to just do AOT.
It would be interesting if you could compile a traditional desktop app into a dependency-free EXE, or bundle up an ASP.NET app with an embedded server as you can with modern Go microservices. I would go from "somewhat interested" to "chugging Kool-Aid and changing my career path" if those use cases entered the picture. I'm not sure whether either of those are in future plans, though.
I might be wrong about this, but my understanding is you can do this. The restrictions are mostly just about certain uses of reflection and dynamic linking.
You can do that today: http://docs.asp.net/en/latest/conceptual-overview/dotnetcore...
It's also a bit confusing whether this "Kestrel" embedded server is production-grade (like Golang, or the embedded server options for Spring Boot in the Java world)... or whether it's meant for development only (https://www.nuget.org/packages/Kestrel).
It's amazing that CoreCLR is coming to multiple platforms within the next year or so... but what IS the production deployment story for Linux going to be, seriously? What is the development story for OS X? (VS Code looks interesting, but surely they're going to have to port the "real" Visual Studio, right?)
Don't get me wrong, I'm not a naysayer! Since I've started exploring .NET, I've found C# to be an improved version of Java that I'd really like to work with. F# seems like a more coherent alternative to Scala. Documentation, availability of learning resources, and community friendliness are outstanding. Still, I'm not 100% convinced yet of the cross-platform reality living up to the extraordinary hype. It really is too soon to judge, but I'm definitely watching closely and believe that the next 6 to 12 months will be crucial.
As for the language differences, Java will eventually catch up with all of the syntactic sugar.
Still waiting for things like Extended MAPI and other parts of the ShellAPI to get "wrapped" up somehow. But I'm moving on from those spaces so it does not matter to me personally too much now.
We figured this would be awesome, as we wouldn't have to port the old libraries to .NET 4.5 (and yes - porting would be required. Sadly that library was written very poorly and used reflection on private methods that didn't exist in 4.5, among other uglyness).
The long and short of it though is the way you "call into" the .NET 3.5 code is through COM. This had lots of implications, such as no support for generics, lots of difficulty debugging, etc. We decided to just bite the bullet and upgrade the old lib instead, and I think we made the right choice. COM is a mess.