-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
clojars/maven like pull mechanism for pods #18
Comments
Are there any existing examples of systems that leverage maven for downloading binaries and running them? I think you first have to unzip the .jar to the filesystem before you can run a binary? A system like brew seems more geared towards distributing binaries. Note that pods can be implemented in any language, including Rust or Python. How would you declare a dependency on Python with Maven? With brew this is possible. |
I'm not too familiar with how the bb.pods system works. I was following the honeysql example trying to get a couple of my libraries to work. Not really knowing why it wasn't working, I guessed that I had to compile the libs into a pod in order to have it be usable with bb. That's why I thought about using maven to download the sources and then have them compiled because I assumed that in order to use a pod, it has to be compiled with graal in current system. As I'm on OSX, I'm happy if the pods are being distributed via brew but I wouldn't know how they'll be distributed on other OS's. But whatever form |
@zcaudate The problem with the hara.log require is that the namespace could not be found. This works:
You needed |
Brew works for linux and macOS. For Windows a similar thing is called scoop. |
@borkdude: I was getting that error with
Would it be better to compile it into a pod? |
@zcaudate I think it would be good if you could get a picture of all the missing classes and other items that are needed to make your library work with babashka. You can do that with a local checkout of babashka and then use |
sweet. I'll give that a go. |
I'm now getting this error here when running in the local directory
|
@zcaudate Here are some tips on getting started: https://github.com/borkdude/babashka/blob/master/doc/dev.md One thing to note: you need to clone with the |
okay, I got it started and resolved a couple of issues but this error came up.
AbstractMethodError should just resolve to java.lang.AbstractMethodError but it doesn't seem like it has an effect when I add it to the the |
@zcaudate Got it. You should also add it to |
@borkdude. Done. How about
|
@zcaudate |
@zcaudate An option could be to use |
What's the hurdle with implementing deftype? Would it be possible to alias deftype to compile as defrecord in sci? Also, is there a more systematic way of doing this? Like generating an |
@borkdude: This works in bb. deftype.
|
The hurdle with deftype is the implementation of interfaces. Bb is running an interpreter and cannot emit JVM bytecode like Clojure can to construct implementations of interfaces. So I guess deftype would fail in a lot of cases if we alias it to defrecord. defrecord only works for implementing protocols at the moment. |
that code does contain interfaces so I guess pods is the way forward then. would something like this work? |
Writing down some thoughts I had. If checking in binaries into git wasn't an anti-pattern, I think Clojure git deps could be used to implement an ecosystem of binaries more or less like brew, but using deps.edn. The classpath can then be used as the binary path, a bit similar to a nix env. I would have a purpose for this (babashka pods). The git deps stuff could be made to work with GraalVM as well I think, so everything could be very fast after deps have been downloaded (but even without GraalVM, it's already fast due to classpath caching). Maybe instead of checking in the binaries themselves, there could be links to releases in the source, with checksums, etc. But most of the gnarly dependency stuff could be handled by tda. Implementing something like brew this way would only require a couple of tens of lines of code maybe. There should be a couple of conventions like where to store the binaries in the source root categorized per operating system / architecture. E.g. a repo could have |
Closing this issue and starting a new one, because the discussion in this one got a little bit off topic. |
Clojars/maven pull mechanism is implemented here now: https://github.com/babashka/pod-registry |
@borkdude: wow. congrats. this is so cool. now I'm just waiting for you reimplement the clojure compiler in truffle to get jit/hotspot for bb. I'm kinda half joking here but somehow I have a feeling that it'll probably happen sooner rather than later. |
@zcaudate Co-incidentally, I was just thinking about this, haha. |
it'd be great to have some sort of a repository for pods - maybe leveraging maven itself so that you can specify the dependency and have that dependency be pulled down, compiled (the first time) and loaded by bb.
The text was updated successfully, but these errors were encountered: