-
Notifications
You must be signed in to change notification settings - Fork 322
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
Python interop #1541
Python interop #1541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very simple implementation, overall! I want to see some changes to the tests before merge though.
spec_impl = | ||
Test.group "Http" <| | ||
pending = if is_ci then Nothing else """ | ||
The HTTP tests only run when the CI environment variable is set to true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The HTTP tests only run when the CI environment variable is set to true | |
The HTTP tests only run when the `CI` environment variable is set to true |
Test.specify "should allow mutual calling of instance-level methods" <| | ||
My_Type 3 4 . my_method_3 5 . should_equal 36 | ||
|
||
Test.specify "should expose methods and fields of JS objects" <| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test.specify "should expose methods and fields of JS objects" <| | |
Test.specify "should expose methods and fields of Python objects" <| |
obj.compare 5 . should_be_false | ||
obj.compare 11 . should_be_true | ||
|
||
Test.specify "should expose array interfaces for JS arrays" <| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test.specify "should expose array interfaces for JS arrays" <| | |
Test.specify "should expose array interfaces for Python arrays" <| |
Test.specify "should make Python strings type pattern-matchable" <| | ||
str = here.make_str "x" | ||
t = case str of | ||
Text -> True | ||
_ -> False | ||
t.should_be_true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a similar test for "make python numbers type pattern-matchable". Same for JS if we don't already.
import com.oracle.truffle.api.interop.UnsupportedTypeException; | ||
import com.oracle.truffle.api.library.CachedLibrary; | ||
|
||
@NodeField(name = "foreignFunction", type = Object.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you implement the JsForeignNode
using @NodeField
? Consistency matters for this, otherwise it might be seen as intentional or important.
public static DataflowError withTrace(Object payload, Node location, StackTraceElement[] trace) { | ||
var error = new DataflowError(payload, location); | ||
error.setStackTrace(trace); | ||
return error; | ||
public static DataflowError withTrace(Object payload, AbstractTruffleException prototype) { | ||
return new DataflowError(payload, prototype); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to update the Javadoc comment above as the arguments have changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ayyy true
This reverts commit 946700aff4960523d5a2e7ab9cfaa50e45481229.
Pull Request Description
Adds Python interop.
Important Notes
Checklist
Please include the following checklist in your PR: