This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-01
Channels
- # announcements (2)
- # babashka (93)
- # beginners (57)
- # biff (3)
- # cider (7)
- # clerk (5)
- # clj-kondo (9)
- # clojure (26)
- # clojure-austin (1)
- # clojure-bay-area (5)
- # clojure-europe (13)
- # clojure-norway (88)
- # clojure-uk (7)
- # clojurescript (3)
- # cursive (4)
- # datahike (2)
- # datalevin (10)
- # datomic (1)
- # events (4)
- # hyperfiddle (5)
- # jobs (3)
- # lsp (1)
- # malli (4)
- # missionary (3)
- # nrepl (1)
- # off-topic (45)
- # overtone (4)
- # pedestal (4)
- # polylith (13)
- # reitit (15)
- # releases (2)
- # shadow-cljs (30)
- # squint (1)
- # vim (1)
- # xtdb (6)
heya. I’m trying to play with juji-io/editscript in bb, and I quickly ran into this error that I don’t understand
user=> (require '[editscript.core :as e])
clojure.lang.ExceptionInfo: defrecord/deftype currently only support protocol implementations, found: IPersistentCollection [at editscript/util/pairing.cljc:68:1]
would this be a bb shortcoming, or am I using a too-old version of something…? 😵https://github.com/juji-io/editscript/blob/master/src/editscript/util/pairing.cljc#L68 that’s the line mentioned
I see. thanks!
(😳 rereading my first question — I didn’t mean “shortcoming” in a derogatory way. I like using bb a lot.)
bb has clojure.data.priority-map
built-in so if you can convince editscript to move to that, it might work :)
or you can maybe patch editscript in userland by using alter-var-root
or something to swap in that implementation
what you could try is add this file to your :paths
and then rewrite that priority-map
function to use clojure.data.priority-map
and if they are willing to have that in their project, they could add that as a .bb
file which bb always loads first
there is a library by #C1DV21X9P which kinda does the same thing and it does work in bb
yeah I’ve noticed that one, I’ll give it a try. thanks again!
yeah this one was it: https://github.com/lambdaisland/deep-diff2
Hi @borkdude! yes, I was thinking about GUI specifically... the interaction I thought about has: • an image/canvas • a slider control for tweaking the image • a button for OK/cancel and TUI doesn't support images (non-ASCII) or a slider control...
@borkdude a WebView would certainly do... Not sure about generic tools (GNU?) that can create WebView windows, but maybe there's some Node.js library that can do that, and offer a Tk-like API for some minimal GUI functionality on the WebView. (In that case of interfacing with Node.js it'd be nbb instead of bb)
you could use scittle in a webview: https://twitter.com/borkdude/status/1581616844607086592 not sure exactly what is a good way to launch a webview though, perhaps something on Node.js indeed, or maybe bun or so: https://github.com/theseyan/bunview
This isn't a bb question specifically but for projects like bb that create binaries for multiple OSes... What are some good suggestions/resources for figuring out how to get everything working for WIndows?
Do you use a VM to run windows?
I do have a Windows machine for testing, but when I didn't have it, I used to run a VM
I'm not just thinking about clojure fixes, but what environment to work in. What shell to use etc
Maybe I should get a cheapish WSL laptop...
shell: I try to stick to just cmd.exe
, I kinda dislike Powershell because it have too much "stuff"
I've actually shelled into a tmate session running in a GHA workflow before
but it was kind of a pita
If you can get windows running on CircleCi you might be able to log in while CI is running
You can also rent Windows desktops in the cloud, I believe that is how Alex Miller sometimes tests stuff
@borkdude I assume you added windows support after linux and mac. how long did it take to get it working?
I use GitHub Actions for my Windows CI. I use virtual machines for local Windows verification and troubleshooting. When I was on macOS I used Parallels, but now that I'm on Linux I use VirtualBox.
@borkdude do you find it easier to use cmd
rather than Bash in WSL
@UE21H2HHD does WSL work in the vm?
For OS support, in gneral (forgetting native image) I find that macOS and Linux are similar enough that I sometimes skip macOS, but Windows is different enough that it is always worth testing.
My build system is rather complex and completely Makefile driven so I'd really want to build in the bash environment. But I'd also do stuff in cmd as it made sense.
> @UE21H2HHD does WSL work in the vm? I did try it once, but can't remember why I stopped the experiment, might be because my dev box is aging. So I just use plain old Windows usually with cmd.exe but if I need to troubleshoot something powershell specific, powershell.
I've never tried powershell
right
I'm unlikely to go that route, but makes sense for you of course
@UE21H2HHD I've never tried parallels. Did you like it? Did it work on aarch?
FWIW: For CI, I find GitHub Actions easier to setup. But I did spend some getting CircleCI creating native images on all 3 OSses for babashka process. So might be an interesting place to borrow from if you go for CircleCI.
Note that GHA is fine for testing but you won’t be able to produce binaries for aarch64
I thought they added aarch support very recently
Also, we summarized some https://github.com/clj-easy/graal-docs/blob/master/doc/testing-strategies.adoc - probably worth a review if you haven't done so already.
hmm parallels == $$
Oh ya, not free. I felt it was worth it at the time though. I might have been suffering some issues with VirtualBox, can't remember. Maybe try VirtualBox first if free is important. (I'm finding VirtualBox ok on Linux these days... so...)
interesting thread, what does people use to try programs on MacOS when you are on Linux?
@UE21H2HHD no I needed more CPU and ram than fit in any MacBook Pro at the time for work
lol I got my old win11 vbox image running and password reset, then I went full screen and couldn't get out, so used the ctl+alt+F6 virtual terminal thing to kill vbox
I hate having to remember how to get vbox working reasonably well every couple years 😄
@U0739PUFQ I'm on Linux and am using VirtualBox to run macOS. But I think this is only technically legal if you are running on Apple hardware (which I am (long story (old hardware (deets on request)))). It was not easy to set up, and the macOS experience is not great, but I'm OK with it for small tests and troubleshooting. If you want to do serious dev work on macOS, I expect you should probably buy a Mac. If a Mac is your primary development box, an advantage is that you can set up VMs for Linux and Windows without too much trouble.
thanks @UE21H2HHD. I'm a debian user and just need a quick way of trying my open source work on macos when people report issues. I tried VirtualBox in the past but wasn't easy to get a macOS image and VBox params that worked
@borkdude, re https://github.com/babashka/babashka/releases do you end up paying bandwidth costs for these releases? I looked into this a bit yesterday and I saw there was a 1GB/mo limit. The graal native-image builds are kinda big so I was worried. Just dawned on me now to ask you about it wrt babashka
https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases#storage-and-bandwidth-quotas > Each file included in a release must be under 2 GiB. There is no limit on the total size of a release, nor bandwidth usage. That's good news. I think I must have seen the bandwidth usage re LFS.
At my new team we're using CockroachDB, I want to be able to send a query to CRDB server, e.g., cockroach sql --execute="SELECT * FROM blabla"
and using babashka or jet convert the results to edn. What's the best way?
Sadly, cockroach can't return results in json, it can in csv.
also, AFAIK babashka has sqlite pod, but I'm not sure if that would work with Cockroach. Maybe I can send requests directly from bb script?
@U0G75ARHC nbb might be a good fit here, I'm sure there's a nice node.js library for cockroach, but if you want to do it using the cockroach CLI this can work too with bb.
(require '[babashka.process :as p])
(-> (p/shell {:out :string} "cockroach sql --execute='SELECT * FROM blabla'")
:out
json/parse-string)
I'll try to find "nice nodejs library". I'm sure there'll be like 380 choices of which I could probably use two without hating myself. LOL
@borkdude you can't "embed" dependencies into your nbb script, so it can be shared as a single file, correct?
@U0G75ARHC no, you can't do this, but you can bundle it as a single file later
nbb bundle: https://github.com/babashka/nbb/tree/main/doc/bundle this packages the entire interpreter and yields about 1mb of JS. if you are looking for a smaller more lightweight solution, try #C03U8L2NXNC
you can create single files with squint too, using esbuild (similar to instructions in the nbb bundle docs)
Is there a strategy for running bb on OSes not supported by graalvm? (freebsd etc)