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
extending the jvm as a target #38
Comments
It’s an interesting idea and there are a lot of ways to go about it.
I’m not sure what the most useful approach would be, but the first is probably the least amount of work, as the runtime doesn’t need to be rewritten. All that said, porting to the JVM is not really a goal right now unless someone wanted to spearhead that effort. |
I had assumed that the c byte code provides an intermediary for targeting various virtual machines (llvm,jvm, custom hardware etc). Am I wrong in thinking that? |
For me, there is a serious need for an clojure compiler - mainly for targeting android. It’s rather a long term thing but I’d like that problem solved. If that were possible I have a feeling that many clojure devs that would jump onboard. I’m not sure what your goals are for Janet but this is something to consider. Honestly, if I had a knowledge to write a compiler, I would have done it by now. |
No, the bytecode is executed directly by the interpreter. To really port Janet to the JVM, one would probably have to rewrite the entire language in Java. Can Clojure not do AOT compilation on Android? I would have assumed that would be easily possible. |
llvm isn't a virtual machine. It is a compiler intermediate representation. The bytecode that the Janet compiler produces is run in a bytecode interpreter. Janet is not really looking to be at all compatible with Clojure. Clojure has some cool ideas, and many other ideas that are infeasible without a really good compiler (GHC) or a really good JITting runtime (JVM). Janet will never have lazy sequences as a core abstraction because they are too slow. Clojure jumps through many hoops to make them reasonably fast, like using chunked sequences, and that is already considering the Clojure is implemented on top of the JVM, which is good at optimizing code that produces a lot of garbage. If you are looking for a static Clojure compiler, look elsewhere. If you are looking for a kind-of Clojure-like language that can run on the JVM, Janet is not there yet, and probably won't ever be unless someone else works on that. |
Thanks for the clarifications. And congrats on the amazing work with Janet. It’s finally got me excited about clojure again. |
I'm curious about the possibility of the compiler targeting the jvm. I asked this question on reddit a while back and the amount of upvotes surprised me: https://www.reddit.com/r/Clojure/comments/aluoar/what_is_the_status_of_some_of_the_clojure_static/
The text was updated successfully, but these errors were encountered: