why DID microsoft make .NET? like, the benefit of a VM is portability so why make a VM and then be like "... and it will only run on x86 windows computers! :3"

i guess so that they could have multiple languages all target the same common language runtime and interop easily?

@eniko feels a bit like everyone treated x86 as an end of history architecture.
@eniko at the time their entire business was oriented towards making everyone a fulltime customer of theirs, as in "we only enter a market in order to own that market".
@eniko I am guessing that various fuckups with manual memory management (both in and outside of MS) was the reason.
@eniko because java was taking off as a cross platform language and microsoft didn't want any of that?
@slaeshjag @eniko Microsoft absolutely wanted some of that. They had their own JVM and everything. And then Sun sued that into the ground, and somewhere in the dust of the settlement they spun up .NET to replace it
@eniko I mean, it does work on ARM64 Windows systems (although I don't know if compiled code is actually portable, or you'd need to recompile for ARM64 anyways)
@eniko Oh, also 32bit ARM, the note I just read said that .NET doesn't support instruction sets *before* ARMv7
@eniko (Although I don't know if Windows is still a thing on 32bit ARM at all)

@neocturne @eniko Fun fact: native support for .net 4 was only added in Windows 11 ARM64. On Windows 10 ARM64, .net worked through x86 emulator.

Anyway, as long as .net executable is marked as any architecture, it'll run (JIT) in ARM64 mode.

@jernej__s @neocturne @eniko yeah, I actually ported mono to arm64 nt and included it with my winforms app for win10-on-arm64 scenarios...
@jernej__s @eniko Oh wow, I wasn't aware of the emulation.
@eniko When marketing has more say than the engineers...
@eniko I say marketing, but it's just an arbitrary restrictions the higher-ups added to keep those pesky non-windows machines away.
@eniko the VM was never about portability, only about managed memory. The possible portability was a fig leaf they could use against their main competition (Java) while never delivering on it (kind of like BSky and decentralisation). It was never intended to run on other OS’s never mind architectures (Mono forced their hand on the former)
@eniko it fits Microsoft’s whole strategy in that era, when they considered open source / open standards an existential threat. They would submit things to standards bodies that made it look like they were being open while in practice hobbling everything so it only ran on Windows. Docx, .Net and C# were officially standards, but were impractical to use outside Windows because you needed the proprietary parts to build most projects.
@eniko Didn't it come out a few years after Java? Is it possible they were just aping the concept? "The competition have a successful product doing thing, why aren't we doing thing?"

@uastronomer @eniko It was very explicitly about Java.

MS wasn't interested in explicit multi-platform VM but had it in mind in case they might switch to other architectures eventually. .NET does run on other architectures (ARM at the very least) and platforms (there are implementations now for all major OSes: Linux, mac, iOS, and Android)

@eniko wasn't it for Windows Phone dev too?
@buherator was it, originally?
@eniko @buherator in a way! .net was a big deal on Windows CE, but it was a subset of .net - kind of like Java MIDP vs Java SE
@eniko idk the history but IMO it'd make sanse to support the primary arch first (providing a memory safe option for devs too!) then use the abstraction of the bytecode as needed. E.g. a quick search shows that .NET 4 was available for Itanium too.
@eniko They also made a scaled down version for Windows CE called the .NET Compact Framework.
@eniko I think original idea was to compete with Java, but with lovely vendor lock.
@eniko well, there is also the .NET Compact Framework which supported ARM (for Windows Mobile) and PowerPC (for the XBox 360). So the architecture of .NET in general did support other architectures, though due to Microsoft not supporting other products than their own it appears as if only x86 is supported. Mono definitely improved that 🤔
@eniko Wasn't Itanium going to be the next big thing when .net was getting done?
@jernej__s @eniko i've seen evidence that .net for dec alpha existed at some point (probably would have been com+ then) before nt on alpha died
@eniko silver light ran in the browser like Java. Barely worked on non windows pcs though.
@eniko because they wanted Java, but Java sadly had a very huge downside in MS's eyes: it was Not Invented Here 🤡

@eniko my theory: when .NET was created, Windows still ran on one non-x86 machines: the DEC Alpha.

I think the goal behind it, other than "make a better Java", was "everyone should be running Windows, but they might not be running it on x86-compatible hardware"

@eniko I believe it was just to try and shake the hegemony of Java
@eniko .net only exists because Microsoft got ass hurt when Sun sued them for trying to make Java incompatible back in 2001.

@Elthas @eniko

Yes: Microsoft licensed Java from Sun and wrote J++ -- a Java implementation with several Microsoft specific extensions. Sun objected and sued, out of concern that customers would use the extensions, locking them into the Microsoft implementation and platform. I can't say that I've ever really understood Sun's lawsuit, but the courts seemed to agree with them.

So Microsoft could no longer implement their own Java.

@Elthas @eniko

Microsoft was a well known language company before MS-DOS and Windows. I heard that they reassigned their people who had implemented J++ to create C# and .Net, which I would describe as a Java clone, with some of the more obvious design problems of Java fixed. Then, over time, Microsoft expanded and extended .Net extensively.

@eniko compete with Java on paper and acquire research talent from Cambridge and Edinburgh CS departments. I don't think it ever started with any plausible business plan.
@eniko .NET project management is scuffed, most projects have their own SDK and the nuget cache I find is reliably erroneous 😭

@eniko This is a really good question. There's a lot of interesting speculation, here. What's also interesting is that the information available *at the time* also feels like speculation. I did a DDG search for "pc magazine microsoft dot net" between 12/1998 and 12/2002 and all the stuff I found was really vague and markety. I think the most concrete claim I found was this: https://www.zdnet.com/article/the-evolution-of-the-net-technologies/ which claims it was written to promote "open standards" for servers(???)

Wild stuff. 

The evolution of the .NET technologies

The Microsoft .NET initiative is all-encompassing, ever-present, and in certain ways, brand-new—but the underlying technologies have been with us for some time. In this article, we’ll explore the evolutionary process that made .NET possible, from MS-DOS and the iterations of Windows to ActiveX. It’s all come together to culminate in .NET.

ZDNET
@eniko It was basically “what if java, but windows only”.

@eniko the whole point of .NET and C# were to have Java without having to follow the rules to say it was Java

Because heaven forbid that the Mighty Microsoft should ever need to follow rules set by anyone else

From what I understand it is actually a by-product of their attempt to break Java compatibility.

Microsoft bought a Java license from Oracle and added support for the language to their IDE.
However, they started to add features to the language that were not part of the standard and not present on other operating systems.

By creating templates that use these features, they caused programs made using their IDE unable to run on anything other than Windows.

According to Oracle, this was copyright infringement. They claimed Microsoft called their language Java, even though it was not Java. They sued Microsoft and won the case.

As a result, Microsoft had to change the name of their language. This became J++.
This was later used as the base for C#.

I assume they wanted to make it sound as if it was a successor to C or C++,
like how many people think C++ is the successor to C.

The reason they continued with a VM was likely for Windows CE compatibility.
Windows CE is still commonly used in factories.
@eniko Because they couldn't control Java.
@eniko @catsalad At the time, Windows Dev was basically C++ or VB, MFC, and COM (the supposed “DNA” tech stack) and it was pretty painful.
I think the core goal was to just replace all of that, and the CLR made that easier (and even then there was talk of supporting other processors).
But the dev team, led by Anders Hejsberg, thought big. Not sure marketing had as much to do with it.
(I was part of a customer group that got regular demos and updates back then).

@eniko In the late ‘90s, Microsoft was worried about threats to the desktop monopoly. The biggest ones were from the web, because people who could replace a Windows app with a web app could then replace Windows with Macs, Linux, BeOS (which was about to be the next big thing briefly) and so on. Windows is not a great OS. Few people buy Windows because they want Windows, they buy Windows to run Windows apps.

They undermined Netscape in various ways, including bundling IE4 and building a load of Windows-only things into IE.

Java was another threat. Microsoft built J++, which was a good implementation of Java (faster than Sun’s) and also bundled a load of Windows-only things. In particular, it didn’t clearly mark the extensions (which Java implementations were required to do), so it was easy to think you were writing a portable Java App when you were actually writing a Windows app. Sun sued Microsoft over this, leaving them with good VM technology that they couldn’t put in products (the lawsuit wasn’t settled until a year or so after .NET was released but the writing was on the wall long before).

At the same time, Intel told everyone that Itanium was the future. x86 was going to die. An architecture transition had a risk of undermining the Windows monopoly because moving to a new architecture would reduce the value of legacy apps (if you are emulating the ISA, you might also emulate a legacy OS and run shiny new apps on a different system). Having an architecture-agnostic executable format would have made it easier to move.

Finally, looking as if you are able to transition to a different architecture gave Microsoft more leverage in talks with Intel. This made it easier to get features into the x86 architecture that Windows wanted (which is part of the reason why x86 is so awful now. The Windows team does not have good taste when it comes to proposing new architecture).

@eniko Because they thought that having a memory-safe, JIT compiled, multi-language VM and tools was something that could sell copies of Visual Studio, which would lead to more windows software, which would sell more copies of windows.

It’s not really more nefarious than that- make it nicer to write windows software so that there’s more of it so people keep buying windows. Cut off some of the reasons people might want to use Java for that purpose.

@eniko Sure, the tech derives from the Java VM that they were forced to stop making. But that style of language and environment was the hot way to program, even without “write once run anywhere,” and the thought was that it would still sell.

@eniko Microsoft first built J++ (their Java version) but the anti-trust settlements caused them to start over with something new: C# and what became known as .net, the idea being it would replace Win32 *finally*. But instead it became a divergent thing.

Thankfully and incredibly dotnet today is amazing and genuinely cross platform.

RISC-V is in progress which is really interesting, but Arm and x86 are stable. I doubt you’ll get MIPS or Sparc or PowerPC though.

@eniko also I believe that they considered it enough that they formally specified the language and runtime via ECMA (current fully specified version is 8, with 9 in draft and the current production version is 13).

Mono was indeed both cool that it was created and entirely within the scope of the entire idea behind C# and the CLR.

Naturally the most money and developer hours was being focused on Windows so it worked best there on x86 systems.

@eniko @catsalad a big benefit of the VM thing is ABI resilience. .Net started effectively as “Component Object Model 2”
@eniko of course it was portable, it supported x86 and x64 both 😆

@eniko when it came out there was support for more than just x86. MIPS, Alpha, PowerPC, and Itanium were all supported (for some capacity of supported) at one point in time

You can find some of this in things like "Rotor" (aka SSCLI - the shared source CLI) which was source available (not open source) .NET from back in the day

It just wasn't until much later that it became widespread enough to be more meaningful in production

@eniko A lot was heavily influenced by x86 of course; and much of the other platform support bit-rotted or was pulled as Windows dropped support, but it definitely wasn't the only consideration when the overall VM was designed and considered.

.NET Core also wasn't the first case of cross platform .NET from Microsoft; just the first one that really "stuck" (and itself was derived from much of the original Silverlight "fork" that existed). 

@eniko @tannergooding This. Also, .NET Compact Framework was a thing.