Fork me on GitHub
#babashka
<
2022-07-13
>
pinkfrog02:07:00

Haven’t tested it yet, but saw you made a repo: https://github.com/borkdude/hato-native . Does that mean I cannot use the original hato directly with babashka? @borkdude

borkdude05:07:06

Yes, you can use hato natively with bb now

borkdude05:07:21

We even test that on CI

borkdude06:07:06

The hato native project was just a way to check if it ran with Graal. It does but it yields a big binary. But now we include java net http so it runs from source

pinkfrog06:07:08

> We even test that on CI Could you hint me the code?

pinkfrog06:07:26

What about cheshire, hato relies on it for json

borkdude06:07:51

Cheshire is part of bb

👍 1
borkdude06:07:54

We should probably update projects.md

pinkfrog06:07:25

Another question, possible to run jsonista on bb? It complains``: Unable to resolve classname: jsonista.jackson.DateSerializer```

borkdude07:07:02

not possible

Martynas M10:07:27

Is it possible to get a list of supported packages that can be imported from babashka script? I was wondering that if I'll start using it I could avoid going into docs and finding how to import what I want to. Maybe CLI command could do that? Something like bb --list-included-packages What do you think? This could be accompanied by a link to the docs then :thinking_face:

borkdude10:07:03

What about:

bb -e '(run! prn (remove #(str/includes? % "impl") (map ns-name (all-ns))))'

Martynas M10:07:22

Nice. It gave me the packages. But can we have a short cli switch? I can't remember this a command. Then you could have it as part of the CLI help.

Martynas M10:07:48

Actually all-ns is already useful but I'll probably forget it.

borkdude10:07:05

Yeah, I think that would be useful

Martynas M10:07:41

It's not that I need it but I was just wondering.

borkdude10:07:51

It ties into this issue: https://github.com/babashka/babashka/issues/1156 I think bb could print a list of libraries it includes with links to their respective doc pages

borkdude10:07:26

There is also this page: https://book.babashka.org/_/libraries.html But it may not be up to date. If you spot missing libs in there, please let me know

Martynas M10:07:32

Links to doc pages are findable from the library's package name. But you could then get bb version and find the possible imports this way too. Yeah, kind of low priority feature.

borkdude10:07:48

There is also bb print-deps

borkdude10:07:59

I bet you can write a script that goes through the deps information, finds the version control link and then spits out an HTML page :)

borkdude10:07:08

also, I want to make something like https://www.clojure-toolbox.com/ but for babashka. The clojure toolbox website code is already ported to babashka here: https://github.com/borkdude/clojure-toolbox.com-babashka We should just fill it with content

Martynas M10:07:36

Clojars sometimes links to sources. I don't know if they have an API but it's probably easy to create a client-side script that would try to get the link for a JAR and open it. But then that probably can't be included into babashka.

borkdude10:07:57

I meant as a temporary workaround ;)

Martynas M11:07:21

I don't know if the JARs themselves carry the information where the source is located at. At least I don't add this to my local uberjars that I build. So then it either has to be a hand-maintained list or it has to come from a third party such as Clojars (because authors of the libraries put the links there and you don't need to maintain a list yourself). So yes, you could make a crawler but I'm not in a position where I know that you can crawl Clojars. You could do it but I don't know, maybe they could give you an API or something. This way your script could download the source links and make a webpage for you. :thinking_face: OR if you build the libraries yourself you could have a buildscript that includes the URL of the source.

borkdude11:07:48

This information is available in the pom file

Martynas M11:07:36

I don't know what we're talking about anymore 😄 I don't think that I want to compile that webpage myself if I freshly installed bb from an older repository just to find that I can't use malli for this specific version of babashka :thinking_face:

borkdude11:07:39

Here is an example for clj-kondo:

$ bb -e "(babashka.deps/add-deps '{:deps {clj-kondo/clj-kondo {:mvn/version \"2022.06.22\"}}})" -e "(require '[ :as io])" -e '(def xml (slurp (io/resource "META-INF/maven/clj-kondo/clj-kondo/pom.xml")))' -e '(second (re-find #"<url>(.*)</url>" xml))'
""

borkdude11:07:57

As I said, I'm talking about a workaround script in user space

borkdude11:07:27

so given print-deps output, you could combine it with the above to get to the github repo

Martynas M11:07:09

Nice. So that would solve your issue with the unknown links. This one: https://github.com/babashka/babashka/issues/1156 At least it could solve it temporarily. You could hardcode this command into CLI and then run it for all found JARs :thinking_face:

borkdude11:07:45

For a built-in one I would just curate the content myself manually. Just some ideas for a hack script in user space ;)

1
borkdude15:07:53

Dear babashka hackers! I've put up https://babashka.org/toolbox/ now which is a direct port of clojure toolbox! All we need now is PRs that take info from this page: https://github.com/babashka/babashka/blob/master/doc/projects.md to here: https://github.com/babashka/toolbox, before a more public announcement will be made. If you see anything worth mentioning on projects.md or elsewhere, PR away!

🎉 6
💯 2