Fork me on GitHub
#babashka
<
2023-03-22
>
Alejandro07:03:21

Is there by any chance a possibility to work with figwheel in babashka?

borkdude08:03:25

Can you be more specific?

Alejandro08:03:20

Well, I'm going to publish a jar that watches html for changes and reloads it in browser using figwheel. Jar is fine, but I wonder if I can do this with babashka. Excuse me for my ignorance, I'm new to babashka, I'm not sure how far I can go with it.

borkdude08:03:18

I think @U042NRFKHQE recently published something like this

Alejandro09:03:56

Oh. Here goes my pet project haha. Thanks for the link

😅 2
keychera09:03:35

👀 small fun fact: I was actually reading figwheel sourcecode wondering if I can recreate hot reload with just babashka, but I didn't get anywhere and then I stumbled upon @U04V15CAJ's quickblog which actually gives me the idea for this Anyway @U03RQQ5E8Q1 you can ask me anytime if you have any question!

Alejandro09:03:47

@U042NRFKHQE, I've just made a tiny and minimal cljs app that uses figwheel and re-renders hiccup using reagent, which can be converted from html in target dir. Haven't thought about using htmx for this, which makes a lot of sense. Thanks for sharing your project.

2
Andrew14:03:52

Hey guys. I was wondering if there's some library or ready-to-use code snippet for Babashka to display some kind of spinner in terminal

borkdude14:03:20

I think this one works: https://github.com/weavejester/progrock Else you can look at bblgum: https://github.com/lispyclouds/bblgum which relies on having gum installed

Andrew14:03:36

Thanks! 🙏

borkdude14:03:29

Printing a spinner is nothing more than putting the characters:

| / - | \ - |
on the screen alternated with a backspace and a sleep

borkdude14:03:53

the ansi codes you can probably look up in the progrock lib

Andrew14:03:04

Yeah, I was just too lazy to write it myself 😅

borkdude14:03:32

I get that :)

Andrew14:03:34

Funny how ChatGPT keeps inventing non-existent libraries :rolling_on_the_floor_laughing:

seancorfield15:03:00

I think pmonks has a spinner library on GitHub (on my phone so too lazy to go search for it).

borkdude15:03:39

that spinner library uses jansi which won't work in bb unfortunately

🥲 2
seancorfield15:03:32

Ah, good to know.

borkdude15:03:33

but maybe some parts of it could be re-used

mmz15:03:02

Trying nix for package management and one of my favourite packages is available! Thank you maintainers! 🥳 https://search.nixos.org/packages?channel=22.11&amp;show=babashka&amp;from=0&amp;size=50&amp;sort=relevance&amp;type=packages&amp;query=babashka

🎉 4
joakimen17:03:52

Unrelated to babashka, but how are you finding Nix? Tried it a couple of times but found the naming conventions and documentation unintuitive, to say the least

onetom17:03:56

the nix expression language is quite unusual indeed, just like how clojure was unfamiliar at the beginning, but it worth the effort to overcome this feeling, in exchange for the reproducibility it delivers. combined with https://direnv.net and the nix-direnv package, which adds more aggressive nix-shell caching to the use nix direnv integration, it's really a pleasure to use, imho. we are primarily using Nix on macOS for the past ~5 years and it had a bunch of hiccups, but it's started to stabilize now. that being said, im still not sure how to have shell.nix files, without a bunch of conditionals, if i want them to work on both macOS & Linux. currently we are using nixos channels, even on macOS, instead of the nixpkgs channel in shell.nix files, eg:

with import (builtins.fetchTarball {
  name = "nixos-unstable-on-2022-10-24";
  url =
    "";
  sha256 = "sha256:1sycxqcf6npp901xpq6n39hvkqilvjvh2j29him6kczvjspkcnnz";
}) { };

onetom17:03:16

i have some friends, who tried the new, upcoming flake support in Nix and they said, the overall experience is much nicer that way and things are a lot snappier too.

joakimen17:03:15

That's pretty much my impression; people who manage to get into it are satisfied. It feels like I'd need to take a course or something to get into it, which sounds like a considerable ask for what is pretty much a sophisticated package manager (gross simplification). I'll count your vote for it though, might give it another try. 👍

onetom17:03:34

@U0422G22932 if we can find some time which works for both of us, im happy to have a screen sharing session over http://pop.com and get u over some of the hurdles

onetom18:03:42

i was lucky to be the colleague of https://github.com/adisbladis for awhile and he eased some of us into Nix 🙂 without his help, i would have also just given up on Nix. since then the docs improved a lot, but it's still a substantial undertaking to use it for a serious dev setup

joakimen18:03:49

That’s a kind offer! When I get around to explore it again, I’ll first brush up on the current documentation, and if things are still unclear, I’ll shoot you a DM (wrote down your username) 🙂 Thanks!

👍 2
mmz12:03:25

@U0422G22932 It's too early for me to say anything about it, but I did like these blog posts so far: https://ianthehenry.com/posts/how-to-learn-nix/

👀 2
joakimen12:03:53

> Five years later, I’m still running NixOS. And I still have no idea how it works. 😄

😁 2
joakimen12:03:19

But yeah, that looks like a decent ELI5 guide, I’ll add it to the list! Thanks

2