Hacker GitHub

← All repos

c-blake/bu

View on GitHub ↗ ★ 77 Nim

B)asic|But-For U)tility Code/Programs (in Nim & Often Unix/POSIX/Linux Context)

43 mentions on Hacker News by 5 people: 0 stories, 43 comments · first 2022-11-11 · latest 2026-10-06

Mentions per year 43 mentions · busiest year 2023 (17)
20082026
  1. This is basically the philosophy of https://github.com/c-blake/bu/blob/main/doc/tim.md , but it uses a somewhat fancier estimator of the minimum than the sample min of dt's (which in some sense is guaranteed to be "a little" high). There…
    comment by cb321 · 2026-10-06 · in Benchmark in Milliseconds
  2. …unrealistic (or at least misleading) often impacts hash table lookup benchmarks as mentioned at https://github.com/c-blake/bu/blob/main/doc/memlat.md and probably many other benchmarks. Essentially, CPU work prediction/speculative…
  3. …the video, although your printer driver would have to strip the color escapes with a `sed` or maybe https://github.com/c-blake/bu/blob/main/noc.nim . ;-)
  4. …here is a nice punchline. [1]: https://gist.github.com/ZoomRmc/58743a34d3bb222aa5ec02a5e2b6... [2]: https://github.com/c-blake/bu/blob/main/doc/tim.md
    comment by ZoomZoomZoom · 2026-02-08 · in Tiny C Compiler
  5. …to tune this, but it used over 128 MiB of RSS. [1]: https://github.com/jarirajari/helloworld [2]: https://github.com/c-blake/bu/blob/main/doc/tim.md
  6. …( inspired by this very HN thread! ) and then either fzf, vip ( https://github.com/c-blake/bu/blob/main/doc/vip.md ), or whatever, the essence of the idea is really just two lines of Zsh code ( https://github.com/c-blake/b
    comment by cb321 · 2025-09-24 · in Zoxide: A Better CD Command
  7. …to get most recent 4 or whatever in the Zsh style (since, you know, that'd be 10x slower..) [1] https://github.com/c-blake/bu/blob/main/doc/newest.md*
    comment by cb321 · 2025-09-17 · in GNU Midnight Commander
  8. …to demo cligen/procpool. examples/cols was faster than awk or xsv for me (which has really moved to https://github.com/c-blake/bu now along with several others like `rp` - which is kind of a "concept piece" showing that any command-line is…
  9. …to mention the dependence problem, though, and the minimum dt solution that, relied upon by, e.g., https://github.com/c-blake/bu/blob/main/doc/tim.md . So, it's all good. He may have covered it in voice, even. He also mentions the Sattolo…
  10. …μs (AlreadySubtracted)Overhead 7454 +- 26 μs bash -lic logout 7934 +- 39 μs zsh -lic logout (Using https://github.com/c-blake/bu/blob/main/doc/tim.md ) About 20,000 entries in the Zsh history slowing it a little. All completion activated…
    comment by cb321 · 2025-07-21 · in Speeding up my ZSH shell
  11. At those time scales, you would be better off using `tim` ( https://github.com/c-blake/bu/blob/main/doc/tim.md ) than hyperfine { and not just because that is your name! Lol. That is just a happy coincidence by clipping one letter off of…
    comment by cb321 · 2025-07-18 · in lsr: ls with io_uring
  12. …program to demonstrate for "show me the code" and "it must just not be 'random enough'!" skeptics: https://github.com/c-blake/bu/blob/main/memlat.nim It uses the exact dependency idea @andersa mentions of a random cycle of `x[i] = i` that…
  13. …scheduling in the OS. [1] https://stackoverflow.com/questions/360748/computational-com... [2] https://github.com/c-blake/bu/blob/main/doc/tim.md
  14. …an effect that's roughly the size of your measurement precision, statistical tests can be useful. https://github.com/c-blake/bu/blob/main/doc/edplot.md linked by cb321 above discusses using the 2-sample Kolmogorov-Smirnov test, which is…
    comment by kragen · 2025-01-09 · in Writing a simple pool allocator in C
  15. …refinements / more analysis in follow up posts/something if this library has any legs for him. [1] https://github.com/c-blake/bu/blob/main/doc/tim.md [2] https://github.com/c-blake/bu/blob/main/doc/edplot.md ¹ Sure, fancy any-size…
    comment by cb321 · 2025-01-09 · in Writing a simple pool allocator in C
  16. …and/or need statistical testing for "actually even different at all", perhaps along the lines of https://github.com/c-blake/bu/blob/main/doc/tim.md ).
    comment by cb321 · 2024-12-09 · in Show HN: A portable hash map in C
  17. …spellcheck/autosuggest on typos, etc.). As examples, there are like 60+ such utilities over at https://github.com/c-blake/bu . Unsure all that adds up to "critical mass" for you, but it seemed worth noting.
  18. …kinds of things can create confusion which is part of the motivation for aforementioned https://github.com/c-blake/bu/blob/main/doc/tim.md . I should perhaps also have mentioned https://github.com/yglukhov/nimpy as a way to write…
  19. …(0.7686/.4322 = 1.78). (All programs emit 4999874750 as expected.) EDIT: This uses a Nim program https://github.com/c-blake/bu/blob/main/doc/ru.md run as `ru -t`, but for the very fast variants you can get a more precise wall time from…
  20. …ones here: https://github.com/c-blake/fitl/blob/main/fitl/gof.nim and referenced at the bottom of https://github.com/c-blake/bu/blob/main/doc/edplot.md (at the stage where one "plots / pools together multiple data points into some kind of…
  21. …be able to reduce measurement noise more than pure statistics in a project to time software like https://github.com/c-blake/bu/blob/main/doc/tim.md .}
  22. This might interest you: https://github.com/c-blake/bu/blob/main/doc/cbtm.md Can save & restore both btime & ctime via "underhanded" filesystem debugging utility scripting. (It is in Nim which might be an obstacle for some, but honestly it…
  23. …will vary based on experience with the tools, including how to simplify/explain them to others. [1] https://github.com/c-blake/bu/blob/main/doc/edplot.md
    comment by cb321 · 2024-06-23 · in I've stopped using box plots (2021)
  24. …-- seeing 40 ppb on one box and 73 ppb on another at the moment. Another example might be https://github.com/c-blake/bu/blob/main/doc/dirq.md which is a kind of ad hoc demon to monitor however many directories on Linux with inotify and…
  25. …outputs to FIFOs / named pipes and then have a simple record boundary honoring merge program like https://github.com/c-blake/bu/blob/main/funnel.nim with doc at https://github.com/c-blake/bu/blob/main/doc/funnel.md As long as "record…
    comment by cb321 · 2024-02-25 · in Neat Parallel Output in Python
  26. I think Nim is great for small CLIs. Some examples are over at: https://github.com/c-blake/bu . To quantify "small", using tools themselves in bu/ (and Zsh *): wc -l --total=never **.nim|cols 1|cstats ms q.05 q.95 75.5 +- 5.7,22.5,175.25…
    comment by cb321 · 2023-12-06 · in Mastering Nim, 2nd edition
  27. …faster in hot cache settings -- for this problem "really slow" usually comes from IO, though). [1] https://github.com/c-blake/bu/blob/main/dups.nim [2] https://github.com/jbruchon/jdupes
  28. …to prove what Nim's capable of - here's a cool repo with 100+ cli apps cligen author wrote in Nim: https://github.com/c-blake/bu
  29. 20 milliseconds? On my 7 year old Linux box, this little Nim program https://github.com/c-blake/bu/blob/main/wsz.nim runs to completion in 109.62 +- 0.17 micro seconds when fully statically linked with musl libc on Linux. That's with a…
  30. …one is willing to learn more specialized tools, even less key-downing is possible, such as (using https://github.com/c-blake/bu/blob/main/doc/cols.md ): grep ^[A-Za-z]|cols 2 You just lose that row number in the original input coordinates…
  31. …already know can substitute for a new prog.lang. Python even has eval . You may be interested in: https://github.com/c-blake/bu/blob/main/doc/rp.md You can actually get pretty far depending upon boundaries with the always implicit…
  32. …EDIT: https://nim-lang.org/ has much more detail and there are over 50 small CLI programs at https://github.com/c-blake/bu as rather extended examples. Using that musl approach I get tiny little 100 kB ELF executables that would work on…
  33. You might consider: https://github.com/c-blake/bu/blob/main/doc/cols.md That's in Nim, though that may not be much a barrier. (There may also be other tools in bu/ of interest.)
    comment by cb321 · 2023-08-28 · in CLI text processing with GNU awk
  34. …stay terse & keep a fairly fast edit-test turnaround in a fully statically typed language like Nim: https://github.com/c-blake/bu/blob/main/doc/rp.md
    comment by cb321 · 2023-08-28 · in CLI text processing with GNU awk
  35. …the lines of `awk` but with all the code just Nim snippets interpolated into a program template: https://github.com/c-blake/bu/blob/main/doc/rp.md . E.g.: $ ls -l | rp -pimport\ stats -bvar\ r:RunningStat -wnf\>4 r.push\ 4.f -eecho\ r…
  36. …) with https://github.com/Vindaar/shell and there are a slew of pipeline-y/Unix-y utilities over at https://github.com/c-blake/bu Nim is statically typed and (generally) native-compiled, but it has very low ceremony ergonomics and a…
  37. …creates as many FIFOs as you have parallelism and just be careful about emitting whole records like https://github.com/c-blake/bu/blob/main/doc/funnel.md . That one's Nim, but the meat is only like 50 lines and easily ported to C like your…
  38. …is even more terse than awk yet statically typed and trivially convertible to run much faster like https://github.com/c-blake/bu/blob/main/doc/rp.md You can statically introspect code to then generate related/translated ASTs to create…
    comment by cb321 · 2023-08-12 · in The Bipolar Lisp Programmer (2007)
  39. …started 8 years ago in 2015 - Rust argh is much newer). There are over 50 CLI utilities in Nim at https://github.com/c-blake/bu , many of which do something novel rather than just "re-doing ls/find/cat with a twist". While they are really…
  40. …file tree" of such content-based slices then you could use any true duplicate-file finder (like https://github.com/c-blake/bu/blob/main/dups.nim ) on the little signature system to identify duplicates and go from path suffixes in those…
    comment by cb321 · 2023-03-07 · in Self-Host All the Things?
  41. > https://github.com/c-blake/bu That's quite an impressive amount of cmdline tools.
    comment by sva_ · 2023-01-03 · in Offensive Nim
  42. …now I've written over 150 command-line tools with https://github.com/c-blake/cligen . A few are at https://github.com/c-blake/bu or https://github.com/c-blake/nio { screw 1970s COBOL-esque SQL ;-) } or in their own repos. I use quite a few…
    comment by cb321 · 2023-01-03 · in Offensive Nim
  43. …thing, I have timed (yes, on one CPU, one test case, etc..many caveats) the tokenizer used in https://github.com/c-blake/bu/blob/main/rp.nim to be faster than that used by the Rust xsv. Of course, you really shouldn't tokenize a lot if…
    comment by cb321 · 2022-11-11 · in A cost model for Nim