Fork me on GitHub
#babashka
<
2023-09-27
>
wilkerlucio16:09:00

hello! is it possible to have a simple bb script that depends on some external library, but makes it detect/install the library when the user doens't have it? (the idea is to handle a single file script with a dependency, and let it auto-install first time it runs in case the user doesn't have the dependency installed already), is that possible thing with bb?

lispyclouds17:09:44

just a heads up, doing this would need java to be installed

🙏 1
borkdude17:09:13

yes, add-deps would be that thing

borkdude17:09:43

the alternative is an uberjar or uberscript

wilkerlucio17:09:59

yeah, and I remembered about add-deps by looking at my own tutorial at: https://pathom3.wsscode.com/docs/tutorials/babashka kkkkk

😆 1
hansbugge19:09:03

Is *unchecked-math* supposed to work the same in bb as in clojure?

hansbugge19:09:08

$ clj
Clojure 1.11.1
user=> (set! *unchecked-math* true)
true
user=> (+ Long/MAX_VALUE 1)
-9223372036854775808

$ bb
Babashka v1.3.184 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (set! *unchecked-math* true)
true
user=> (+ Long/MAX_VALUE 1)
java.lang.ArithmeticException: long overflow [at <repl>:2:1]

borkdude20:09:52

The var exists for compatibility but so far it hasn't been respected. I guess you could also write (unchecked-add 1 Long/MAX_VALUE) in bb, but of course it would be nice to fix

borkdude21:09:34

Feel free to post a github issue about it

vlad_poh20:09:11

Has anyone tried deploying a babashka script as an azure function?