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
So I'm thinking about the potential script runner library. I'm trying to decide on how to go about it.
Currently, the engine in airport has the ability for a node to call a function that was declared in another node. This is ok as a start, but I actually want to hoist this ability into a core library, I'm just not sure how.
Here's a proposal for how it might look in the lang:
//caller.toyimportrunner;//run an external script file (must end in .toy or .tb)varsubject: opaque=runScript("./subject.toy");//call a function from the external file, and receive any return valuessubject.callScriptFn("example","hello world");//get a variable from the external filevarvariable: int=subject.getScriptVar("variable");//42//must clean up the file at some pointsubject.freeScript();
The opaque variable subject would essentially be the root-level scope of subject.toy. This would allow for type checking, etc. as well.
This is, in theory, a big change to how I've been envisioning the language so far, and would mean that the import/export feature would be deprecated and removed. The version number would also be bumped to 0.7.0.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So I'm thinking about the potential script runner library. I'm trying to decide on how to go about it.
Currently, the engine in airport has the ability for a node to call a function that was declared in another node. This is ok as a start, but I actually want to hoist this ability into a core library, I'm just not sure how.
Here's a proposal for how it might look in the lang:
The opaque variable
subject
would essentially be the root-level scope of subject.toy. This would allow for type checking, etc. as well.This is, in theory, a big change to how I've been envisioning the language so far, and would mean that the
import
/export
feature would be deprecated and removed. The version number would also be bumped to 0.7.0.Beta Was this translation helpful? Give feedback.
All reactions