
We are pleased to announce that
CoreCLR is now on github and now you have access to all of its source codes. CoreCLR is a .NET Core runtime environment, performing functions such as garbage collection or compiling to final machine code. .Net Core is a modular implementation of .Net that can be used as a base for a huge number of scenarios, the scope of which range from simple console utilities to web applications hosted in the cloud. To understand the difference between .Net Core and .Net Framework, look at the post
“Introduction to .Net Core”Now you can download CoreCLR source files, branch and pull requests, you can also compile it directly on your PC. We have released a full and current implementation of CoreCLR, which includes RyuJIT, .Net GC, native Interop, and many other .Net runtime components. This release follows the same principles as all our recent library releases released in open-source: make the whole .Net Framework open sourced.
Today, the .Net kernel compiles and runs (apparently CI is meant) on Windows. We will add implementations for Mac and Linux-specific platform things in the next couple of months. We also already have some Linux-specific code in .Net Core, but we just started porting from Windows to other platforms. On the contrary, we wanted to open the initial text from the very beginning, so that you could travel with us to other platforms, possibly contributing.
')
Let's see what's inside the repository.
The CoreCLR repository is very similar in structure to the CoreFX repository, in which many of you have managed to work over the past months. We will continue to develop both repositories at the same time so that you feel naturally, being in a truly huge code base.
In terms of size, the CoreCLR repository consists of approximately 2.6 million lines of code. And within the framework of these calculations, the GC takes about 55 thousand, and the JIT itself - about 320 thousand lines. We also recently shared with you that CoreFX occupies 500 thousand lines of code, which is about 25% of its estimated total size. And, it's scary to say, but when everything is ready, we will have about 5 million lines of code. On GitHub
One of the key differences between repositories is that CoreFX is written in C #, while CoreCLR contains a huge amount of code in both C # and C ++. Also CoreCLR repository requires a huge amount of code to build code, some of which are not included in the distribution with Visual Studio. We left the dependency on CMake, opensource and cross-platform project building system. Since we needed a build system that would feel great on both Windiws, Mac, and Linux, we looked at various options and as a result, we chose CMake.
You can learn how to build CoreCLR from the
CoreCLR Developer Guide . The team will keep updating it, especially when Linux and Mac become a reality.
We also very much hope that the community will contribute to the development of the project by creating pull requests (from a translator: CoreFX has a huge number of contributors who constantly write code for CoreFX). .Net Core because of its size works on a huge number of scenarios, and therefore it is very important to have a large number of tests to cover the maximum number of tests.
Conversation with the team
Under the link below you can see the dialogue with the team about the current release:
Building applications with .Net Core
It's great to see .Net CoreFX and CoreCLR implementations in open source. And you will be surprised what types of applications you can build with it. There are two types of applications that can be built at the moment:
- ASP.NET 5 Web Applications and Services
- Console applications
We talked about ASP.NET 5 applications for about a year and now you can build them using both .Net Framework and CoreCLR / CoreFX.
ASP.NET 5 uses mono runtime and can work on both Mac and Linux . Once .Net Core supports these systems, you can use it on these platforms. You can learn more about how to work with ASP.NET 5 from an
ASP.NET team blog or on the
asp.net web site. Also, if you want to try ASP.NET 5 in action right now, then download the Preview version of MS Visual Studio 2015.
We want to make it possible to build CoreFX and CoreCLR repositories and use the results in ASP.NET 5 applications, but for now this is not possible for several technical reasons, however we are working on it. The end goal is very complex: we need to be able to combine community changes (forks) and our own changes and get a base stack for your applications.
The console type of applications allows you to understand what CoreCLR is. It also provides a very flexible base for building absolutely any application, whatever you want. The largest percentage of infrastructure. which we use for testing uses this type of application. You can also build your own CoreCLR and run applications on top of it.
.Net Core Console Apps
At the moment, the console type of applications for .Net Core is a by-product of our process. And over the next few months, we will form it as a completely ready-made type of applications, including code templates in Visual Studio and a debugger (i.e. it does not exist, it seems,
- approx. Transl. ). We will also support OmniSharp for console applications (who do not know - Sublime text 3 based IDE for .NET). So, soon you will have a full-fledged opportunity to build cross-platform applications that will run from a single executable file.
Below is the first demo of the console application running under CoreCLR.
Console app walkthrough
The easiest way to build a CoreCLR application is to create a console application. You can get it from our new corefxlab repository. In order to use it, you can simply clone, compile and run it using the command line:
cd .\corefxlab\demos\CoreClrConsoleApplications\HelloWorld nuget restore msbuild .\bin\Debug\HelloWorld.exe
Of course, since you have cloned the repository, you can also open the * .sln file in your copy of Visual Studio. Please note that debugging is not yet possible ...
But it’s only for those who make mistakes, right?You can also modify CoreCLR and run a console application that will use the new runtime that you yourself just did, making changes to the kernel. At the moment, the automated assembly is not at the highest level, because in order to build the kernel yourself, at the moment it is necessary to do the following steps:
- Modify CoreCLR as your heart dictates.
- Build CoreCLR with build.cmd x64 release
- Copy the files from coreclr \ binaries \ x64 \ release to corfxlab \ demos \ CoreClrConsoleApplications \ HelloWorld \ NotYetPackages \ CoreCLR:
- coreclr.dll
- CoreConsole.exe
- mscorlib.dll
- Recompile HelloWorld.sln
Total
We were preparing to make CoreCLR open for several months, while developing many new features. Now you have the opportunity to observe the daily work of our team commit for commit (exactly the same as in CoreFX). Feel free to pick up your repository and watch for these changes. For our part, we will be watching the list of Issues and PR to be able to follow your wishes.
If you're excited and determined to chat with someone, visit the .Net Foundation forums. Here you will find several branches where you can learn more about CoreCLR. Also, the branches are monitored by members of our team who are ready to answer any of your questions.
We have a lot of things to do and the next stop is
.Net Conf - a virtual .Net conference, which is scheduled for March 2015 and there we hope to show you a good demo