wasmtime-dotnet icon indicating copy to clipboard operation
wasmtime-dotnet copied to clipboard

wasmtime NetStandard 2.0

Open onehundredfeet opened this issue 5 years ago • 5 comments

Hi,

In order to use this inside Unity, I've 'ported' the system to NetStandard2.0. It was a fairly quick port, but didn't modify too much of the code. I would be much more comfortable if there was an official port. Or #if 's in the code to handle it.

I'm happy to put my code somewhere if you want to see it, but I'm sure it's inferior to what the author of the module would do.

Cheers, Ryan.

onehundredfeet avatar Oct 01 '20 20:10 onehundredfeet

Hi @onehundredfeet. Sorry for the delayed response as I've had most of October off.

The biggest hurdles with supporting netstandard 2.0 is the lack of Span, BinaryPrimatives, and nullable reference types (i.e. C# 8.0).

There are some unsupported hacks one can do to enable C# 8.0 with a netstandard2.0 TFM, but I'd rather not do that (or lots of #ifs in the code if we can avoid either).

However, I don't want this to be a barrier to adoption, but it does seem that the Unity folks are busy updating to a more recent version of Mono which should bring netstandard 2.1 support (maybe even net5.0 if we're lucky?).

Perhaps the best course of action is to wait and see if Unity will release a new version soon rather than hack this library to work with a 3 year old TFM.

peterhuene avatar Oct 30 '20 21:10 peterhuene

No worries.

Most of what is needed, span etc, has been made available with system.memory. I’ve successfully got wasmtime up and running in unity with minimal changes. I’ve checked it into my branch if you’re ever curious.

onehundredfeet avatar Oct 30 '20 22:10 onehundredfeet

I’ve checked it into my branch if you’re ever curious.

Hi @onehundredfeet , sorry to be a bother, but do you have your version of wasmtime uploaded anywhere?

I'd be happy to throw a PR together for it (if I can get it working...)

zalo avatar Dec 09 '20 02:12 zalo

@onehundredfeet are you able to share your Unity specific branch?

jazzay avatar Jan 20 '21 17:01 jazzay

PR #94 upgrades to .Net 6? Does that address this issue so it can be closed?

alexhiggins732 avatar Feb 24 '22 06:02 alexhiggins732

PR #162 set the target to netstandard2.1 which should work in Unity.

martindevans avatar Oct 19 '22 15:10 martindevans