haxe
haxe copied to clipboard
[cs] support .NET Core
Microsoft is reworking the .NET infrastructure and now there's a new version of .NET called ".NET Core".
Basically it's an overhaul and cleanup of the framework, but it introduces a new core API library that is incompatible in some parts with older one. For example, Thread doesn't have CurrentCulture field anymore - it was moved somewhere else.
To support .NET Core, Haxe should support -D netcore or something and based on that we need:
- use proper APIs in the standard library
- use proper APIs in the compiler-generated stuff (not sure if there's any)
- think about how to integrate compilation (hxcs) and extern loading with the
dotnettool and other .NET Core stuff.
From what I understood, .NET Standard will be released during the first or second quarter of 2017, and it will bring greater and better parity with the standard .NET framework, so maybe it will be easier to wait for that? I haven't played enough with both (hxcs and Core) to really know if in this case the wait would be worth it,
What's the status on this?
robinrodricks, you can check the std library for cs here and watch for changes:
https://github.com/HaxeFoundation/haxe/tree/development/std/cs https://github.com/HaxeFoundation/haxe/tree/development/std/cs/_std https://github.com/HaxeFoundation/haxe/tree/development/std/cs/internal
You will see mostly changes are only related to improvements in Haxe language in stabliity and features, or target edge cases. If you look at hxcs changes there have not been many recently.
https://github.com/HaxeFoundation/hxcs/commits/master
but Haxe Mono always works well for me, Jonas (https://twitter.com/cambiatajonas) has some nice graphics music notes stuff with c# target.
I don't think anyone worked on .NET core support, but I also think it's mostly a matter of changing some API usages in standard lib.
I have been using .NET core with haxe for a year now (started with 2.1.0, now using 2.1.7). It's actually supported, but you have to define it yourself in a hacky way (some randomly picked version > 35 for -net-ver and a custom --net-std).
I'll try to make it into something like this for .NET core 2.1.11 (current LTS):
-net-target=netcore
-netcore-ver=2.1.11
Not quite ready yet; making some progress while writing a new tool to manage net-libs but haxe still cannot compile .NET core apps
Any movement on this?
Ideal DX would look like this:
sudo add-apt-repository ppa:haxe/releases -y
sudo apt-get update
sudo apt-get install haxe dotnet6 -y
mkdir ~/haxelib && haxelib setup ~/haxelib
Then simply run haxe build.hxml and it should work.
None, I'm finally free from dotnet )
Does this mean haxe will no longer support transpiling to C# in the future?
No, though that makes it one less people to bother Simn with this target whenever he feels like we should drop it
I guess that won't get better support than what's already been added.