Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Comparison of C Sharp and Java
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Using GraalVM==== <syntaxhighlight lang=Java style="font-size:90%"> Context polyglot = Context.newBuilder().allowAllAccess(true).build(); //Ruby Value rubyArray = polyglot.eval("ruby", "[1,2,42,4]"); int rubyResult = rubyArray.getArrayElement(2).asInt(); //Python Value pythonArray = polyglot.eval("python", "[1,2,42,4]"); int pythonResult = pythonArray.getArrayElement(2).asInt(); //JavaScript Value jsArray = polyglot.eval("js", "[1,2,42,4]"); int jsResult = jsArray.getArrayElement(2).asInt(); //R Value rArray = polyglot.eval("R", "c(1,2,42,4)"); int rResult = rArray.getArrayElement(2).asInt(); //LLVM (in this case C, but could be C++, Go, Basic, etc...) Source source = Source.newBuilder("llvm", new File("C_Program.bc")).build(); Value cpart = polyglot.eval(source); cpart.getMember("main").execute(); </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)