Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cb321
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
cb321
1y ago
Once you have a little frecency command-line utility like https://github.com/c-blake/adix/blob/master/util/lfreq.nim ( inspired by this very HN thread! ) and then either fzf, vip ( https://
92.
▲
by
cb321
1y ago
`hash -d` (aka "named directories") is surely an alternative and if that suits you, by all means. I see at least two downsides: 1) now you have to remember to say `make -C ~c` { not `make -C $c` which I think most would find more
93.
▲
by
cb321
1y ago
Glad to be appreciated. You might also enjoy this snippet from my zshrc: my-expand() BUFFER=${(e)BUFFER} CURSOR=$#BUFFER zle -N my-expand # Make Alt-E expand environ vars w/o val escape bindkey '^[e' my-
94.
▲
by
cb321
1y ago
In Zsh with `setopt autocd cdablevars`, shell variables more or less work like cd-aliases. You could also just add `a=projectA; b=projectB; c=projectC` to your `~/.zprofile` and then at prompts type 1-letter commands `a`, `b`, `c`. On
95.
▲
by
cb321
1y ago
In that case, since you are already de-duping "externally", you might play with `setopt HIST_IGNORE_ALL_DUPS HIST_IGNORE_DUPS HIST_SAVE_NO_DUPS` combinations. It's been many years since I looked at it, but I think these cons
96.
▲
by
cb321
1y ago
It's 10x slower than a more specialized command [1] for me, but adding recursion only requires adding one extra asterisk (`**` instead of `*`) and maybe a D if you want to include dot files or triple star if you want to follow symlinks
97.
▲
by
cb321
1y ago
That sounds way too long. Mine takes like 15 ms on a 2015 cpu and I activate zsh-syntax-highlighting and new style completion and everything, but yeah oh-my-zsh often adds nutso overhead. Anyway, I suggest you profile your zsh start-up.
98.
▲
by
cb321
1y ago
A lot of people in this subthread are echoing this, but it's at most maybe very slightly easier. For example, TinyCC is a one-pass C compiler and yet C has sub-scopes int foo() { / ... / { int x; / ... / } }. Th
99.
▲
by
cb321
1y ago
Also, very cool. For example, https://github.com/SciNim/Measuremancer has Nim make the utf8 ± character be an operator that constructs an uncertain number with which to do error propagation arithmetic upon. So, you c
100.
▲
by
cb321
1y ago
Like literally anything, it will depend upon how much your code does, what libraries it uses and so on, but here's a trivial little example to at least dispell a worry of multi-megabyte outputs for trivial things: echo echo 1 >
101.
▲
by
cb321
1y ago
Nim also has term rewriting macros (e.g. https://scripter.co/notes/nim/#term-rewriting-macros ) which can transform patterns. The relevance is that you could combine that with `||=` to probably get whatever short-
102.
▲
by
cb321
1y ago
With `nim cpp` the Nim compiler actually just generates C++ from the Nim source for the backend to compile. So, calling C++ code is just emitting the calls at a C++ source level and so is straightforward. The situation with Rust "sha
103.
▲
by
cb321
1y ago
The "dual" of this type-dispatch of template/macros is that the scoping rules also allow you to use a template or a macro to define a bunch of things which are only "in effect" in a sub-scope, like, e.g. that old C
104.
▲
by
cb321
1y ago
Yeppers - https://github.com/treeform/nim_emscripten_tutorial FWIW, people have been doing that for about as long as there's even been an emscripten, but the article is pointing out the lack of more tight integrat
105.
▲
by
cb321
1y ago
This is a decent overview, but misses a few nice things. Interested readers should not assume it is exhaustive (generally something they should not assume..) E.g., because the feature is so rare (controversial?) it doesn't get mention
106.
▲
by
cb321
1y ago
You would probably enjoy the UFCS https://en.wikipedia.org/wiki/Uniform_function_call_syntax of Nim, D, etc. Basically `h.g.f(x)` or in Nim you can drop the parens and say `h.g.f x` { but it may not scale past a singl
107.
▲
by
cb321
1y ago
GNU indent was already at version 1.9.1 by 1994: https://ftp.gnu.org/gnu/indent/ If you grab that version and unpack it and look at /OChangelog then it seems to date back until at least 1989, same as Python i
108.
▲
by
cb321
1y ago
If you are in an even more "approximate" mindset (as opposed to propagating by simulation to get real world re-sampled skewed distributions, as often happens in experimental physics labs, or at least their undergraduate courses),
109.
▲
by
cb321
1y ago
Your link itself admits the 0.05 makes it a different formula. Both Y and L* go to zero for hard black which is a very common color (the most common for me) and would be infinite with black in there. I disagree this is all "not rea
110.
▲
by
cb321
1y ago
I don't think you & I have much disagreement here as I like the way you write about approximations and edge cases and things involving human judgement calls and "both not either" kinds of testing. The WhyAPCA document yo
111.
▲
by
cb321
1y ago
As per discussion of this new OKLCH idea in TFA - Are we even sure we have great formulas for measuring/defining contrast in the first place? Do you agree / disagree with any of the counterexamples over at: https://git
112.
▲
by
cb321
1y ago
I would also push back (agreeing with @TylerE, but linking in this part of the subthread seems best). It all depends, but sometimes macros change the division of labor between library authors and library users so that they specifically hav
113.
▲
by
cb321
1y ago
It sounds like you don't know how the Bash/Zsh ideas I mentioned work. They run the command with --help, parse the output, and from that generate the completions, wiring them in to the completion system. That method is a zero co
114.
▲
by
cb321
1y ago
For those programs that have betrayed shipping man pages, instead say relying only on a --help system, do you happen to know if the fish shell has an analogue to Zsh `_gnu_generic` and Bash `complete -F _longopt`? If not, do you have any
115.
▲
by
cb321
1y ago
The answer to your question is that command-lines have a much larger diversity of syntax ( even to get help !) than most people realize. Folks have their 30..60 commands they run frequently and don't run into many or conveniently forg
116.
▲
by
cb321
1y ago
_gnu_generic is fantastic. I use it all the time. If your CLI toolkit emits colorized help, but skips said colorization if NO_COLOR[1] is set then you can prefix _gnu_generic with NO_COLOR=1 as in https://github.com/c-blak
117.
▲
by
cb321
1y ago
There are anthropomorphic euphemisms like "hallucination", but isn't it true that LLMs literally Randomize TFM?
118.
▲
by
cb321
1y ago
There hasn't been a ton of benchmark comparisons. From memory, on what remains in examples/: The cligen/dents stuff is faster than anything not so enabled with a new kernel call and some perf stuff mentioned right in the com
119.
▲
by
cb321
1y ago
For simple commands, it is pretty easy if your CLI toolkit sticks to a _gnu_generic kind of format, but for subcommands it gets hard. Since in cligen ( https://news.ycombinator.com/item?id=44820383 ) the "proc signature
120.
▲
by
cb321
1y ago
There is actually a lot more in cligen/ than only CLI generation from proc signatures. https://c-blake.github.io/cligen/ covers some of that.
More ›