For VM docs see NekoVM
Install-Package Ivy.NekoVM -Version 2.3.1-preview.6
- Documentation
- Improved API
- Marshaling default types (without
vabstract
andvkind
) - Marshaling POCO object
- Marshaling neko std types
- Marshaling non-primitive .NET types
- More tests
- Define global functions on runtime
- Improved Thread support
- Remove binaries from repo (automatization build for this)
- dotnet global tools neko compiler
- win-x64
- osx-x64 (need help with testing)
- linux-x64
using var vm = new Neko();
var module = vm.LoadModule(new FileInfo("module.n"));
// module.n
$exports.GetInt = function() {
return 42;
}
using var vm = new Neko();
var module = vm.LoadModule(new FileInfo("module.n"));
Console.WriteLine(module["GetInt"].Invoke()); // NekoInt32 { Value: 42 }
Each time you are going to use a VM API outside of the thread in which it was created, use the following code
vm.GuardBarrier()
Also, vm.ThreadID
id managed thread in which it was created (see Thread.CurrentThread.ManagedThreadId
)
dotnet tool install --global dotnet-nekoc --version 2.3.0-preview.2