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
20082026
-
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 -
…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…
comment by cb321 · 2026-09-14 · in Bad benchmarks and evals: Senior SWE-Bench, napkin math, and winter tires -
…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 . ;-)
comment by cb321 · 2026-07-08 · in Decoding the obfuscated bash script on a Uniqlo t-shirt -
…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 -
…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
comment by cb321 · 2025-12-31 · in 2026: The Year of Java in the Terminal? -
…( 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 -
…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 -
…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…
comment by cb321 · 2025-08-07 · in Cligen: A Native API-Inferred Command-Line Interface Generator for Nim -
…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…
comment by cb321 · 2025-07-23 · in Algorithms for Modern Processor Architectures -
…μ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 -
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 -
…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…
comment by cb321 · 2025-06-27 · in How much slower is random access, really? -
…scheduling in the OS. [1] https://stackoverflow.com/questions/360748/computational-com... [2] https://github.com/c-blake/bu/blob/main/doc/tim.md
comment by cb321 · 2025-03-10 · in Performance of the Python 3.14 tail-call interpreter -
…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 -
…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 -
…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 -
…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.
comment by cb321 · 2024-09-07 · in My first experience with Gleam Language -
…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…
comment by cb321 · 2024-08-09 · in Recent Performance Improvements in Function Calls in CPython -
…(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…
comment by cb321 · 2024-08-09 · in Recent Performance Improvements in Function Calls in CPython -
…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…
comment by cb321 · 2024-07-23 · in How fast can a human possibly run 100 meters? -
…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 .}
comment by cb321 · 2024-07-22 · in How fast can a human possibly run 100 meters? -
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…
comment by cb321 · 2024-06-23 · in Ask HN: What's the oldest file on your computer? -
…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) -
…-- 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…
comment by cb321 · 2024-03-30 · in Garbage collection for systems programmers (2023) -
…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 -
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 -
…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
comment by cb321 · 2023-11-05 · in Fdupes: Identify or delete duplicate files -
…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
comment by archargelod · 2023-10-25 · in Things I've learned about building CLI tools in Python -
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…
comment by cb321 · 2023-09-11 · in Removing garbage collection from the Rust language (2013) -
…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…
comment by cb321 · 2023-09-11 · in The Awk book’s 60-line version of Make -
…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…
comment by cb321 · 2023-09-11 · in The Awk book’s 60-line version of Make -
…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…
comment by cb321 · 2023-09-06 · in Writing Small CLI Programs in Common Lisp (2021) -
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 -
…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 -
…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…
comment by cb321 · 2023-08-21 · in GNU Parallel, where have you been all my life? -
…) 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…
comment by cb321 · 2023-08-21 · in GNU Parallel, where have you been all my life? -
…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…
comment by cb321 · 2023-08-21 · in GNU Parallel, where have you been all my life? -
…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) -
…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…
comment by cb321 · 2023-06-27 · in Ask HN: Why did Nim not catch on like Rust did? -
…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? -
> https://github.com/c-blake/bu That's quite an impressive amount of cmdline tools.
comment by sva_ · 2023-01-03 · in Offensive Nim -
…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 -
…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