News for hackers. Stuff that matters.
Re:.NET 5.0 – New APIs by systemvoltage on Tuesday September 22, 2020 @04:59PM (#24559817)
Can someone please explain what .NET framework is? Everytime I come across it, it seems like a mysterious microsoft thing and Wikipedia's explanation is even more confusing:

> .NET Framework (pronounced as "dot net") is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library called Framework Class Library (FCL) and provides language interoperability (each language can use code written in other languages) across several programming languages.

What is .NET framework really?

Elsewhere, it is described as "A framework to build applications in Windows", but I thought that's what the Windows API helps with.

Any help with clarification would be great, thank you.

Re:.NET 5.0 – New APIs by runfaster2000 on Tuesday September 22, 2020 @10:46PM (#24562432)
.NET was built in the time of early Java, and so has many similar characteristics: virtual machine with a garbage collector, executes compiled processor- and OS-independent binaries, supports multiple languages, and a large class library. A lot of these early bets were good. .NET has been used in almost all the relevant computing devices today, to greater or lesser degrees of success (not all from Microsoft).

More recently, .NET has been focused on cloud native space and high-performance web applications. It has been open source and cross platform for about 5 years now.

Here's an example of work we've done for containers: https://devblogs.microsoft.com/dotnet/using-net-and-docker-t...

Here are two good blog posts to demonstrate what we've been up to performance-wise:

https://devblogs.microsoft.com/dotnet/performance-improvemen...

https://devblogs.microsoft.com/dotnet/arm64-performance-in-n...

Re:.NET 5.0 – New APIs by josteink on Tuesday September 22, 2020 @05:04PM (#24559869)
> What is .NET framework really?

At its core: It’s what Microsoft made to compete with Java back in 2002.

It’s a development platform, with associated tooling, compilers and a runtime. It has a common standard-library independent of language used by the developer (which aids cross-language interop), but realistically speaking most people just use C#.

You can use it to create network services, console applications, web assembly programs or desktop GUI applications. It’s quite versatile.

And .NET 5 will seemingly be the first version to officially supersede the previously Windows-only “.Net Framework” with a modern, open-source, cross-platform version instead.

As a Linux desktop-user, I’m loving it.

Re:.NET 5.0 – New APIs by scruple on Tuesday September 22, 2020 @06:12PM (#24560594)
Are you building and/or using any .NET desktop GUI applications _on_ linux? I'd love to poke around some open-source projects to see how these are being made today.
Re:.NET 5.0 – New APIs by pknopf on Tuesday September 22, 2020 @09:00PM (#24561843)
I've built this: https://GitHub.com/qmlnet/qmlnet

I used it in medical devices within some of the larger medical device companies.

Re:.NET 5.0 – New APIs by ZeroClickOk on Tuesday September 22, 2020 @08:48PM (#24561752)
Re:.NET 5.0 – New APIs by cgrealy on Tuesday September 22, 2020 @07:38PM (#24561316)
> And .NET 5 will seemingly be the first version to officially supersede the previously Windows-only “.Net Framework” with a modern, open-source, cross-platform version instead.

You don't count .Net core?

Re:.NET 5.0 – New APIs by setr on Tuesday September 22, 2020 @08:11PM (#24561518)
.net core ran in parallel with .net framework

.Net 5 is where they drop framework and core actually supersedes it

Re:.NET 5.0 – New APIs by at_a_remove on Tuesday September 22, 2020 @07:14PM (#24561125)
If it is any consolation, Microsoft's description of .NET at its first launch was even more nebulous than that. I avoided it out of sheer confusion at how it was going to wax my car, do my taxes, and save my soul.
Re:.NET 5.0 – New APIs by kumarvvr on Tuesday September 22, 2020 @09:56PM (#24562165)
Haha. Inspite of the hyperbole, MS did manage to steer .NET very well.

I only wish there were more libraries in the Data Analytics area, something akin to Pandas library in Python.

Re:.NET 5.0 – New APIs by pizza234 on Tuesday September 22, 2020 @05:09PM (#24559937)
I suppose that it's very similar in spirit as Java, with the difference that Microsoft presented in a more encompassing way (assuming that the definition of "software framework" was given by MS).

Often in fact Java is described as a language, while, at a minimum, a Java distribution includes the JVM and the standard library.

Describing as a software framework is therefore (in this sense) more exact, as the .NET framework includes the CLR and its standard library (and possibly, other components).

The difference with the Windows API is that they are lower level. The simplest possible component one may think of is probably LINQ - querying functionalities are intuitively higher level than system APIs.

Re:.NET 5.0 – New APIs by Const-me on Tuesday September 22, 2020 @07:45PM (#24561365)
It’s huge, has 2 decades of legacy, and has many parts. Here’s the main ones.

1. Virtual machine and JIT compiler, usually called CLR = Common Language Runtime, it runs byte code called CIL = Common Intermediate Language. They have renamed it a few times; older docs/tools may call the byte code MSIL = Microsoft Intermediate Language, or just IL. In modern .NET this thing is platform-agnostic.

2. Standard libraries for that runtime. The modern implementation is called CoreFX. It includes large count of batteries: collections, LINQ, threading and synchronization, async-await runtime, reflection, and much more. Fortunately, CIL is very compact representation of code, takes a small fraction of an AMD64 equivalent.

The lower-level pieces are platform-agnostic, but there’re many windows-only pieces implementing GUI and integration with other OS-specific services like WMI, registry, ADSI and more. For WinForms and similar they just use [DllImport] to consume Win32 and GDI+. For WPF this includes large amount of compiled C++ DLLs that consumes DirectX 9 to render GUI and implement resource-intensive algorithms. For UWP this includes COM interfaces to call native Windows APIs (albeit these interfaces might be a part of Windows SDK, I’m not sure).

3. Programming languages and compilers for them, the main ones supported by MS are C#, VB.NET, and to lesser extent F#. Modern version has a single compiler for C# and VB called “Roslyn”, F# is a separate program. There’re third-party ones, see IronPython. Also some .NET based products include their custom compilers or code generators who produce CIL code from something else in runtime, I did it a few times, not too hard.

There’re smaller pieces like framework SDK (a set of command-line tools to create, compile and run projects), msbuild (a build system typically used on Windows or for larger projects), and many other random programs/libraries of varying utility.

Update: Forgot an important component, NuGet package manager. It’s an equivalent of Python’s pip, or JavaScript’s npm, an online repository of code packages. The majority of packages there only contain CIL code, i.e. they’re very small and platform-agnostic. The most popular package there is an alternative Json parser, was downloaded 650M times. Microsoft uses nuget to deliver optional pieces of the standard library, developers like me are publishing their weird libraries too https://www.nuget.org/profiles/ConstMe

Re:.NET 5.0 – New APIs by pjmlp on Wednesday September 23, 2020 @05:29AM (#24564880)
You missed C++/CLI.
Re:.NET 5.0 – New APIs by Const-me on Wednesday September 23, 2020 @06:17AM (#24565210)
Yes. Also .NET native, remoting, WCF, asp.net, and lots of other things. Two reasons.

1. The ecosystem is huge. People are writing thick books on these subjects.

2. Most of the above (except asp.net) is windows-only stuff. Even on Windows, the stuff most useful if you’re maintaining something from 10-20 years old, less so for new projects, at least in my experience.

Re:.NET 5.0 – New APIs by pjmlp on Wednesday September 23, 2020 @06:33AM (#24565306)
Well, C++/CLI support was the biggest feature for the .NET Core 3.0 release, so it does matter.

Although I do concede that most likely Microsoft would happily get rid of it, and have everyone make use of C++ code in .NET via UWP components instead, preferably using C++/WinRT.

Re:.NET 5.0 – New APIs by Inception on Tuesday September 22, 2020 @05:42PM (#24560280)
This is a pretty good explanation video about the .NET ecosystem in general: https://www.youtube.com/watch?v=bEfBfBQq7EE
Re:.NET 5.0 – New APIs by liversage on Tuesday September 22, 2020 @07:13PM (#24561120)
To simplify things you can say that .NET consists of three things:

1) A garbage collecting virtual machine (like the JVM) that executes Intermediary Language (IL) by just-in-time compiling it to native code.

2) A set of programming languages (C# being the most popular) that compiles to IL.

3) A broad set of libraries that are part of .NET or available from the NuGet package manager. This includes basic features like collections, JSON serialization and cryptographic primitives but also huge frameworks for web development using databases etc.

In recent years Microsoft has open sourced big parts of .NET and basically rebuilt it from the ground up to make it cross platform. In the process a lot has been improved in terms of usability and efficiency making .NET a serious contender when it comes to building something like large scale cloud applications.

The next major release of .NET is expected in November where the "old" Windows only version and the new improved cross platform version (.NET Core) will converge into .NET 5.

Re:.NET 5.0 – New APIs by wenc on Tuesday September 22, 2020 @05:26PM (#24560135)
A really handwavy description would be that it's kinda like a "runtime".

It's very roughly analogous to the Java Runtime Environment (JRE). .NET binaries are very roughly like JAR files.

(I realize the analogy is rough, but I think it would connect with folks who've never worked with a Microsoft stack)

Re:.NET 5.0 – New APIs by kqr on Wednesday September 23, 2020 @01:12AM (#24563213)
You would definitely be excused for feeling puzzled. I got thrown into a full time cross-platform .NET development role with zero experience in .NET, and figuring out how it all fit together (especially a couple of years ago) was a nightmare.

I wrote down some of my discoveries here: https://two-wrongs.com/dotnet-on-non-windows-platforms-brief...