You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been stuck thinking about closures (see #51), and eventually rejected them.
It dawned on me that I could support exporting functions to the host environment without using closures, which would remove the need of an event loop.
Perhaps something like this:
def onMouseMove x, y : "company.product.onMouseMove"
# ...
end
The : "company.product.onMouseMove" means that the command will be exported to the host using that name. The name will be hashed into a 64-bit number, just like native commands.
This means inside the host, you could do something like:
The sink_ctx_call function would hash the string (alternatively could use sink_ctx_callhash so symbols could be stripped), then execute the function, and get the result.
This is effectively the reverse of the native function API, which seems very logical and useful.
The text was updated successfully, but these errors were encountered:
I've been stuck thinking about closures (see #51), and eventually rejected them.
It dawned on me that I could support exporting functions to the host environment without using closures, which would remove the need of an event loop.
Perhaps something like this:
The
: "company.product.onMouseMove"
means that the command will be exported to the host using that name. The name will be hashed into a 64-bit number, just like native commands.This means inside the host, you could do something like:
The
sink_ctx_call
function would hash the string (alternatively could usesink_ctx_callhash
so symbols could be stripped), then execute the function, and get the result.This is effectively the reverse of the native function API, which seems very logical and useful.
The text was updated successfully, but these errors were encountered: