Fork me on GitHub

I'm curious, any using babashka on a rasberrypi ? How are you accessing the gpio pins?

Cora (she/her)02:07:16

just in case no one else responds, it looks like you could install wiringpi to get the gpio cli tool and then shell out to that from babashka

Cora (she/her)02:07:32

there are things like this that might be worth trying but I doubt they'd work


i would just use the /sys/class/gpio/ directory with regular file operations.

👍 4

Added a bunch more API functions from timbre and, links are updated in the discussion

🚀 6

Just to check my understanding - I guess it’s possible to have clj files which are used both from bb scripts and also from JVM clojure processes, correct? As long as they don’t use any of the built-in dependencies from bb (and presumably with a little care), they should work in both?


> As long as they don’t use any of the built-in dependencies from bb I didn't get this part.


on the JVM you would have to have those deps in your classpath, but in bb you don't if they are built-in


code that works in bb generally works in the JVM, but not always vice versa. most specifically, deftype/`definterface` aren't supported (currently) and reify/`proxy` in a very limited fashion


but bb tries to conform to the JVM Clojure semantics as much as possible


it's not a new / different dialect of Clojure in that respect


Right, so as long as the deps that the file uses is either built in (in bb) or pulled in via the classpath (in clj) files can be shared. That was my assumption, just checking.


And things like the default aliases are only available in bb in the user ns, right? So they will only be available in a script without an ns form.


e.g. str being aliased to clojure.string


correct. but this was actually just done for command line expressions. in an editor I recommend people to use explicit aliases


Sounds like good advice, but I’ll have to support those who choose not to follow it 🙂


I can add an inspection to gently suggest to them that they might not like to do that.


clj-kondo will also advice them that, in fact, it will just say: don't know what namespace str is


Hmm, maybe I should just not add support for them, then Cursive would do the same.


Ok, that will make at least one thing easier!


In hindsight perhaps I wouldn't have included those default aliases, but I don't want to break it either and for quick command line stuff it can be convenient.


Sure, no doubt.


I'm going to sleep now, I'll answer your other questions tomorrow if you have any.


Thanks, I think I’m good for now - thanks for all the support!


And thank you for supporting bb in Cursive, that is really cool


Yeah, I think it will be useful for many people (including me!)