Comments (5)
So when I had thought about this earlier, my idea was to use reflection (and some heuristics) to infer the argument types (and thus the exact method), but then cache the results of the reflection. In my experience, most java code that use reflection heavily always cache the results, given how slow it is. So that could be one option. I believe that is how the python-java interface works.
I'll have a think about the syntax. My criteria are somewhat contradictory, to reduce the cognitive overhead for both the java and the julia developer.
from javacall.jl.
Caching results from reflection API sounds promising! I also have some progress on a generated functions approach in high-level-macro
branch, but still not sure this will work well in practice.
from javacall.jl.
Could the dot syntax / auto-completion be handled by the getfield
and fieldnames
methods added in Julia 1.0?
from javacall.jl.
Yes, that's the idea. It's just that we've not had the time to implement this.
from javacall.jl.
I wanted to propose a roadmap for this since there are multiple proposals on the table.
My vision for the JavaCall package is to provide a solid foundation that takes care of most of the low level interface of the JNI and provides a Julian method of calling Java. We should be able to do a few things like inferring or automatically importing the return type.
For some of the examples above, I would like to point out that the below is not really Java. You could not compile that with javac
.
@java begin
foo = new Foo()
foo.doStuff("hello").doAnotherStuff()
foo.bar
end
It would be closer to something like Groovy. My proposal to support that would be a GroovyCall.jl package which would depend on JavaCall.jl. In that case, we let Groovy handle the syntax parsing.
What to expect:
- Limited support in
JavaCall.jl
to make calling Java methods easier. It is reasonable to infer the return type given the argument types, for example. - A series of packages built upon
JavaCall.jl
that supports higher level syntax via Groovy, etc.
from javacall.jl.
Related Issues (20)
- Ways to mitigate overall jankyness (intermittent NoClassDefFoundError and IllegalMonitorStateException) HOT 16
- Segmentation fault on JavaCall.init HOT 13
- Possible memory leak in `convert_result` HOT 4
- Use BinaryBuilder to install java?? HOT 4
- Error when loading JDK 15 x64 on Windows with Julia 1.6 RC 1 HOT 6
- Calling of java methods in a .jar file fails, but listing methods works fine. HOT 17
- TagBot trigger issue HOT 3
- Git history removed? HOT 10
- Avoiding Exceptions during automatic testing HOT 16
- Can IJulia Jupyter/Pluto run on Linux without JULIA_COPY_STACKS=1? HOT 6
- Calling java.lang.String constructor doesn't return reference to String object HOT 4
- JVM installs signal handlers by default HOT 11
- JavaCall crashes Julia 1.6.3 on macOS HOT 11
- help with jmathplot HOT 1
- jvoid missing in JavaCall v0.7.7 HOT 10
- Is 'pattern == "*.jar"' in jvm.jl a bug? HOT 3
- Allow multidimensional array inputs HOT 2
- how to set JULIA_COPY_STACKS=1 in jupyter? HOT 2
- handling of Enum types HOT 8
- Call methods of a class generated in runtime HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javacall.jl.