0xF6 / neko_vm_binding

Neko Virtual Machine for C# 😺

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NekoVM

Neko Virtual Machine for C# 😺

For VM docs see NekoVM

Telegram

Deprecated as of 2021-09-09

See HaxeFoundation/neko

Install-Package Ivy.NekoVM -Version 2.3.1-preview.6

🧬 Roadmap

  • Documentation
  • Improved API
  • Marshaling default types (without vabstract and vkind)
  • 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

💫 Fast start

using var vm = new Neko();

Load *.n modules

var module = vm.LoadModule(new FileInfo("module.n"));

Get exports from module

// 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 }

Threading

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)

Install compiler

dotnet tool install --global dotnet-nekoc --version 2.3.0-preview.2

About

Neko Virtual Machine for C# 😺

License:MIT License


Languages

Language:C# 59.9%Language:C 40.1%