-
Notifications
You must be signed in to change notification settings - Fork 7
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
Foreign Function Import #25
Comments
The other option is to have the type system span both languages. So we can directly give types to some JavaScript functions. Then we just import them and give a type signature. |
I an going to start with this simple syntax:
To bring the foreign function into scope with the specified type. |
@keean wrote:
The type of JavaScript stuff is always Also on writing we may need to do conversion for example to |
Not when you are calling out. Calling JS from Zen we control the types that are given to the function, so if you declare colsole.log takes a String, you will only be able to pass a string to it. For return values we would give them a datatype with runtime tags, so they would get assigned into a disjoint union and you can match on the type in Zen. I would have a builtin datatype like this:
Function types and object types will need a bit more thought. |
Are we sure a JavaScript |
@shelby3 it might be a double, I will check, but the principle is this will let us write any wrapper code for native inside our language where things are type safe. |
This issue is for discussing the mechanism that will be used for interfacing and importing foreign functions.
The text was updated successfully, but these errors were encountered: