ceifa / wasmoon

A real lua 5.4 VM with JS bindings made with webassembly
MIT License
498 stars 32 forks source link

Improve async and custom type support #18

Closed timstableford closed 3 years ago

timstableford commented 3 years ago
ceifa commented 3 years ago

I loved the type extension idea! But maybe it is very tied to metatables, no? Would be nice to pass some other types to it, like function, thread, etc.

timstableford commented 3 years ago

An extension doesn't necessarily need a metatable as long as it implements push value and get value. My thought was to leave these default handlers in here but there's no reason at all that they couldn't all be removed to an extension if you'd like?

ceifa commented 3 years ago

An extension doesn't necessarily need a metatable as long as it implements push value and get value. My thought was to leave these default handlers in here but there's no reason at all that they couldn't all be removed to an extension if you'd like?

Nice, so it's okay. we can leave it that way and maybe migrate some other types later

timstableford commented 3 years ago

An extension doesn't necessarily need a metatable as long as it implements push value and get value. My thought was to leave these default handlers in here but there's no reason at all that they couldn't all be removed to an extension if you'd like?

Nice, so it's okay. we can leave it that way and maybe migrate some other types later

I was incorrect, it required a small tweak. It already was fine for pushValue but getValue meant adding a new isType handler