Fork me on GitHub
#babashka
<
2019-12-12
>
borkdude11:12:57

One thing I'm wondering about: should src be the default classpath if the --classpath option is omitted? or the current working directory? Both? Neither?

sogaiu13:12:00

at least for clojure, i think the current working directory (project dir?) is typically not on the classpath. does that seem right?

sogaiu13:12:14

i'm a little wary of the consequences of choosing something diff - not sure why.

borkdude14:12:03

I can also choose not to set anything right now

borkdude14:12:26

if you use the bbk script you will use clojure to get a classpath

borkdude14:12:38

which will always have src

borkdude22:12:35

Merged the classpath branches to master now

sogaiu22:12:34

lgtm:

$ ./bb --classpath ./examples "(require '[classpath])"
hello from classpath
$ cat examples/classpath.bb 
(ns classpath)

(println "hello from classpath")

borkdude22:12:38

you can also try src-bash/bbk -Sdeps '{:paths ["examples"]}' -e "(require '[classpath])"

borkdude22:12:55

the bbk script will be packaged along with the binary

sogaiu22:12:55

$ ./src-bash/bbk -Sdeps '{:paths ["examples"]}' -e "(require '[classpath])"
hello from classpath

sogaiu22:12:19

no, ty for all of your work :thumbsup:

sogaiu22:12:50

i see that bbk seems to be based on the clojure bash script -- does that seem right?

borkdude22:12:25

it's based on the script that the planck REPL ships as plk

sogaiu22:12:42

ah, interesting -- so any ideas what might happen for windows?

borkdude22:12:07

the bbk script will work if clojure works

sogaiu22:12:16

i mean the bash part

borkdude22:12:00

I guess you can revert to using bb --classpath $(clojure -Spath) worst case, best case it will be ported to babashka 😉

borkdude22:12:25

planck also doesn't work on Windows afaik

sogaiu22:12:53

ah, haven't tried it there

borkdude22:12:20

at least, I didn't see installation instructions for it. I guess theoretically it could

sogaiu22:12:52

well, everyone will be using bb for their multi-platform scripts before long anyway 🙂

borkdude22:12:17

it's funny you tried the .bb extension, I didn't document that explicitly but bb will first look for a .bb file, then .clj, then .cljc

sogaiu22:12:43

nice that it worked -- been trying to use that to keep things differentiated

borkdude22:12:06

so you can make a tools.cli entrance script with fast startup, before firing up the JVM and fail fast, all within the same code base using the same deps.edn

sogaiu22:12:23

that sounds vaguely like something planck or some other thing mfikes did at some point

borkdude22:12:29

you can also use reader conditionals for it btw

sogaiu22:12:37

the quick starting part at any rate

borkdude22:12:07

what planck does is show the prompt and accept input before it's even ready, so by the time you finish typing, the runtime is ready. it just seems faster

sogaiu22:12:35

ah, right (having the .bb file extension should make things easier for tooling -- this is a bit of a headache trying to tell apart jvm clojure from clr clojure)

borkdude22:12:57

what lumo did on top of that is make a pre-baked image of the node runtime

sogaiu22:12:12

that sounds a bit like what native-image does

borkdude22:12:34

it's also a bit like saving the state of a virtual machine and quickly restoring it

sogaiu22:12:07

re: planck and windows: https://github.com/planck-repl/planck/issues/416 -- looks like not yet?

borkdude22:12:28

re: bb on windows, it would be helpful if the issue about it collected the current state in the top post / first comment, so we can keep track of the state of affairs

sogaiu22:12:42

i'll see what i can do about that

borkdude22:12:08

I lost track a bit on that. Are there any things we're waiting for from GraalVM? the pipe stuff? we can live without it in Windows maybe? etc.

sogaiu22:12:20

makes sense -- will try to summarize in the top post / first comment

borkdude22:12:29

thanks! 🛏️

👍 4