haxe icon indicating copy to clipboard operation
haxe copied to clipboard

[cs] support .NET Core

Open nadako opened this issue 9 years ago • 10 comments

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 dotnet tool and other .NET Core stuff.

nadako avatar Jul 26 '16 12:07 nadako

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,

Neverbirth avatar Jul 29 '16 06:07 Neverbirth

What's the status on this?

robinrodricks avatar Feb 18 '19 04:02 robinrodricks

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.

nanjizal avatar Feb 18 '19 05:02 nanjizal

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.

nadako avatar Feb 18 '19 09:02 nadako

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

kLabz avatar Jun 08 '19 09:06 kLabz

Not quite ready yet; making some progress while writing a new tool to manage net-libs but haxe still cannot compile .NET core apps

kLabz avatar Jun 18 '19 20:06 kLabz

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.

VictorioBerra avatar Aug 19 '22 15:08 VictorioBerra

None, I'm finally free from dotnet )

kLabz avatar Aug 19 '22 16:08 kLabz

Does this mean haxe will no longer support transpiling to C# in the future?

VictorioBerra avatar Aug 19 '22 16:08 VictorioBerra

No, though that makes it one less people to bother Simn with this target whenever he feels like we should drop it

kLabz avatar Aug 19 '22 16:08 kLabz

I guess that won't get better support than what's already been added.

kLabz avatar May 17 '23 20:05 kLabz