Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triton modernization #3

Open
5 tasks
kevzhao2 opened this issue Jul 9, 2020 · 1 comment
Open
5 tasks

Triton modernization #3

kevzhao2 opened this issue Jul 9, 2020 · 1 comment
Assignees

Comments

@kevzhao2
Copy link
Owner

kevzhao2 commented Jul 9, 2020

Checklist for Triton modernization (v2.0.0):

  • Use GitHub actions for testing/generating artifacts/etc
  • Drop .NET Framework 3.5/4.0 support (only supporting .NET standard 2.0/2.1)
  • Support Lua 5.4
  • Look into Lua support of new C# features (such as ref returns, etc.)
  • Improve Lua syntax of indexed properties

More to come as I think of them.

@kevzhao2 kevzhao2 changed the title triton modernization Triton modernization Jul 9, 2020
@kevzhao2 kevzhao2 self-assigned this Jul 9, 2020
@kevzhao2
Copy link
Owner Author

kevzhao2 commented Jul 9, 2020

One potential strategy for supporting CLR <-> Lua interop is to make use of dynamic code generation.

For any type T which needs to CLR <-> Lua interop, we can do something like the following:

  • Generate a type-specific metatable that all instances of T will use in Lua, with the following:
    • __index: A dynamic method which will take the supplied index, and do one of the following: perform a field get, perform a property get, or return a proxy C function for method calling.

      Note that we don't necessarily need to marshal the supplied index to a string if we're just performing direct byte comparisons. This will potentially save a string allocation.

    • __newindex: A dynamic method which will take the supplied index, and do one of the following: perform a field set or perform a property set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant