Fork me on GitHub
#babashka
<
2022-05-03
>
borkdude09:05:24

One question for you all: I have enabled some things in babashka to be able to run fipp and puget from source. The biggest thing to add was rrb-vector/catvec which adds some 350kb of binary size. What it does is concatenate vectors in O(log n) instead of O(n). I could easily "fake" that function by replacing it with into. The trade-off here is: • do we want higher performance for fipp (pretty printing) • do we want to save 350kb of binary size. The reason to add compatibility for fipp and puget are mainly for debugging purposes, e.g. having hashp work in babashka. I don't know many other libraries that need rrb-vector. Respond in thread with your thoughts please. 🧵

1
russmatney13:05:10

Personally, I prefer performance over binary size. My usage is 100% local dev though, so I'm not sure how much this impacts other use-cases.

Gunnar14:05:42

To start with, support for debugging sounds important to me, w.r.t. babashka. But then... sorry if these are stupid questions: 1. How large vectors need to be processed for the algorithmic complexity to have a visible impact? Visible -> because this is for pretty-printing, so it is only a case of being interactive with the programmer, or? Is it... vectors in the mega-byte range, for example? 2. Do people pretty-print mega-byte sized data structures a lot?

borkdude14:05:53

@U0359E1F02H 1) Yes, this would probably only used during dev time by programmers

borkdude14:05:00

2) I don't think so

borkdude14:05:15

I'm not exactly sure why fipp uses rrb vector

Gunnar14:05:40

I'm just trying to see if I'm missing something, since I'm leaning towards saving space definitely, if it has negligible impact (=space for other bb features to come)

Gunnar14:05:11

Not that you should put an unnecessary amount of time into this. But I bet you if anyone could whip up a benchmark in almost no time 🙂 Or maybe some other wizards will take the challenge and suggest a bit of code that generates large data structures to measure?

Gunnar14:05:01

> I'm not exactly sure why fipp uses rrb vector "Because they can?" 🙂

borkdude14:05:58

If more libraries that would be useful to run in bb would rely on rrb vector, the argument to "not fake" it would become stronger

borkdude14:05:03

as of now, it's "not faked" on master

Gunnar14:05:11

True. And switching over to rrb is a change that you can still make in the future then? Or, if someone complains about performance. My opinion only, and I'm a very small voice in this, but I'd "save" on the binary size whenever you can, sort of like saving for the future.

borkdude14:05:17

I tend to agree with that. If performance becomes a concern, we can switch

✔️ 1
Daniel Jomphe14:05:15

> I'm not exactly sure why fipp uses rrb vector I think it's because fipp starts with f for fast, and Brandon Bloom, the author, is a language and data-structures geek. I've always been tempted to use fipp because of that. For the current question, I also think it's safe to start with a simulation (using into).

borkdude14:05:38

Alrighty, pushed. Let's see in #babashka-circleci-builds if the 350-ish kbs go away

⏱️ 1
borkdude15:05:49

Yep, that worked. 350kb on macos and even 1.5mb or so on linux

😯 1
Dig15:05:19

“Programs must be written for people to read and debug, and only incidentally for machines to execute.” updated with respect to H. Abelson Don't care about speed or size as long as I have hashp and other debug tools.

borkdude15:05:05

@U01BDT7622X Alright. Let's try without rrb first and we can always improve. Here is the full sequence of what I did to make hashp work in babashka: https://github.com/brandonbloom/fipp/issues/81#issuecomment-1113957919 with babashka from master.

🙌 2
cap10morgan18:05:36

Just converted the build tooling for the official Docker clojure images to use babashka instead of shell scripts. It was stupid easy, even taking care of its usage of specs. And now it's faster too! Just a mind-bogglingly great tool you've got here, @borkdude! 😁 (not on GitHub yet but will be shortly)

🎉 14
Jeffrey Bay22:05:11

trying to use csv/read-csv but it says Could not resolve symbol and it couldn't find the namespace either with (ns foo (:require csv)) so I'm not sure how the (multiple) code examples i found are working?

Jeffrey Bay22:05:04

figured it out myself - the examples rely on being in the user namespace

Jeffrey Bay22:05:36

easy once i saw that in the readme

borkdude22:05:30

We should update those examples. Where did you see those?

Jeffrey Bay22:05:08

i searched "babashka csv" and found a github link: https://github.com/babashka/babashka/blob/master/test/babashka/scripts/csv.bb and this one https://cljdoc.org/d/borkdude/babashka/0.0.88-2 was where i got the answer that got me past it, although possibly not the best way?

borkdude22:05:02

that's a very old version on cljdoc there

Jeffrey Bay22:05:27

yeah, i noticed that - it was #4 on my google search or something though, thus my click

👍 1