HNHacker News
TopNewBestAskShowJobs

kbd

3,459 karma · joined October 26, 2010

https://github.com/kbd
submissionscomments
kbd··on Superlogical
Very cool to see a man execute on his vision. Ghostty -> libghostty -> terminal multiplexing -> ???
kbd··on Show HN: Microsoft releases Flint, a visualization language for AI agents
Thank you for summarizing it this way. All their flowery language (esp from OP) seems like long for "we figure out how the chart should look based on its data". From their page:

> Instead of requiring verbose low-level parameters such as scales, axes, spacing, and layout, the Flint compiler derives optimized chart settings from the data, semantic types, chart type, and encodings.

kbd··on Cherri – programming language that compiles to an Apple Shortuct
What can you do on a Mac with Shortcuts vs AppleScript vs Hammerspoon?
kbd··on Hammerspoon
That's cool, I hadn't heard of Squint, thanks! Looks lightweight. Another compile-to-js option that seems good is Gleam.
kbd··on Hammerspoon
Hmm I already avoid Lua by writing in Fennel, I’ll probably avoid the JS by writing… what Lisp compiles to JS, ClojureScript?
kbd··on How uv got so fast
It's Rust vs Python in this case.
kbd··on iPhone Typos? It's Not Just You – The iOS Keyboard Is Broken [video]
I type in Dvorak and frequently the iOS keyboard's swipe typing bugs out and acts as if the layout is in QWERTY. I kind of don't believe it will ever be fixed...
kbd··on Nimony (Nim 3.0) Design Principles
When I was learning Nim and learned how imports work and that things stringify with a $ function that comes along with their types (since everything is splat imported) and $ is massively overloaded I went "oh that all makes sense and works together". The LSP can help figure it out. It still feels like it's in bad taste.

It's similar to how Ruby (which also has "unstructured" imports) and Python are similar in a lot of ways yet make many opposite choices. I think a lot of Ruby's choices are "wrong" even though they fit together within the language.

kbd··on Nimony (Nim 3.0) Design Principles
The biggest thing I still don’t like about Nim is its imports:

    import std/errorcodes

    proc p(x: int) {.raises.} =
      if x < 0:
        raise ErrorCode.RangeError
      use x
I can’t stand that there’s no direct connection between the thing you import and the names that wind up in your namespace.
kbd··on Zig's new plan for asynchronous programs
Thanks for taking the time to respond. I will now think of Channels as queue + [mutex/communication guarantee] and not just queue. So in Go's unbuffered case (only?) a Channel is more than a 1-item queue. Also, in Go's select, I now get that channels themselves are hooked up to notify the select when they are ready?
kbd··on Zig's new plan for asynchronous programs
> channels aren't futures and futures aren't channels.

In my mind a queue.getOne ~= a <- on a Go channel. Idk how you wrap the getOne call in a Future to hand it to Zig's select but that seems like it would be a straightforward pattern once this is all done.

I really do appreciate you being strict about the semantics. Tbh the biggest thing I feel fuzzy on in all this is how go/zig actually go about finding the first completed future in a select, but other than that am I missing something?

https://ziglang.org/documentation/master/std/#std.Io.Queue.g...

kbd··on Zig's new plan for asynchronous programs
> I don't know enough Zig to know whether you can write a bit of code that says "either pull from this queue or that queue when they are ready"; if so, then yes they are an adequate replacement, if not, no they are not.

Thanks for giving me a reason to peek into how Zig does things now.

Zig has a generic select function[1] that works with futures. As is common, Blub's language feature is Zig's comptime function. Then the io implementation has a select function[2] that "Blocks until one of the futures from the list has a result ready, such that awaiting it will not block. Returns that index." and the generic select switches on that and returns the result. Details unclear tho.

[1] https://ziglang.org/documentation/master/std/#std.Io.select

[2] https://ziglang.org/documentation/master/std/#std.Io.VTable

kbd··on Zig's new plan for asynchronous programs
One of the harms Go has done is to make people think its concurrency model is at all special. “Goroutines” are green threads and a “channel” is just a thread-safe queue, which Zig has in its stdlib https://ziglang.org/documentation/master/std/#std.Io.Queue
kbd··on Async/Await is finally back in Zig
I wrote my shell prompt in Zig years ago in part because I was interested to use its async/await to run all the git calls in parallel for the git status. My prompt is still fast despite never having parallelized things -- slightly slower now after adding Jujutsu status -- but I'm looking forward to getting to do the thing I originally wanted and have my super fast shell prompt.

To speak to the Zig feature: as a junior I kept bugging the seniors about unit testing and how you were supposed to test things that did IO. An explanation of "functional core imperative shell" would have been helpful, but their answer was: "wrap everything in your own classes, pass them everywhere, and provide mocks for testing". This is effectively what Zig is doing at a language level.

It always seemed wrong to me to have to wrap your language's system libraries so that you could use them the "right way" that is testable. It actually turns out that all languages until Zig have simply done it wrong, and IO should be a parameter you pass to any code that needs it to interact with the outside world.

kbd··on Trump pardons convicted Binance founder
It doesn't really matter who is more egregious, but IMO a country's leader pardoning his own family members is about as banana republic as it gets.
kbd··on Trump pardons convicted Binance founder
The pardon power has been so abused these past few administrations that it's clear there should be constitutional changes in the pardon power, either congressional review, or strip it altogether.
kbd··on The macOS LC_COLLATE hunt: Or why does sort order differently on macOS and Linux (2020)
In my Zsh startup on Mac I had to worry about collation, as I expected ~ to sort last (I have a directory prefixed with ~ to load plugins that need to be loaded last). Idk why a locale of utf-8 has it sorting differently, but I needed LC_COLLATE=C to have it sort as expected:

    # source all shell config
    export LC_COLLATE=C # ensure consistent sort, ~ at end
    for file in ~/bin/shell/**/*.(z|)sh; do
      source "$file";
    done
kbd··on Python 3.14 is here. How fast is it?
I was soo excited when they announced this, but I've heard almost nothing since.
kbd··on Simple Hotkey Daemon for macOS, Ported to Zig
I gave it a glance at some point but don’t see why I’d use it. It’s just some dude’s config. I have my caps lock rebound to a “hyper” key so every important thing is one key combo away.
kbd··on Simple Hotkey Daemon for macOS, Ported to Zig
I wonder how much of my Hammerspoon config I could replace with this...

Edit: upon reflection, not much actually: https://github.com/kbd/setup/blob/2eaeaecf76c22be3ecef5c8563...

kbd··on Better Curl Saul: a lightweight API testing CLI focused on UX and simplicity
curlie has had the best balance of ergonomics and power of all the cli tools I've tried. It's full curl underneath but provides a nice ergonomics layer that matches tools like httpie. https://github.com/rs/curlie
kbd··on Apple's Software Quality Crisis
Figure I’ll add my own obscure bug that’s never fixed. Apple finally released a Dvorak keyboard for iOS. Except a lot of times it bugs out and stays in QWERTY mode just for swipe typing even when you’re in the Dvorak layout.
kbd··on Show HN: Jq-Like Tool for Markdown
Cool thanks for sharing! I'll have to check this out. I've wanted something similar.

After trying a bunch of the usual ones, the only "notes system" I've stuck with is just a directory of markdown files that's automatically committed to git on any change using watchexec.

I've wanted to add a little smarts to it so I could use it to track tasks (eg. sort, prune completed, forward uncomplete tasks over to the next day's journal, collect tasks from "projects", etc.) so I started writing some Rust code using markdown-rs. Then, to round-trip markdown with changes, only the javascript version of the library currently supports serializing github flavored markdown. So then I actually dumped the markdown ast to json from rust and picked it up in js to serialize it for a proof of concept. That's about as far as I got so far. But while markdown-rs saves position information, it doesn't save source token information (like, * and - are both list items) so you can't reliably round-trip.

FWIW, the other thing I was hoping to do was treat markdown documents as trees (based on headings) use an xpath kind of language to pull out sections. Anyway, will check out your code, thanks for posting.

kbd··on JReleaser: quick and effortless way to release your project
Had the same question, surprised it's not addressed in the faq.
kbd··on Borgo Programming Language
Go deserves to get TypeScripted. Another effort in this vein is Go+

https://github.com/goplus/gop

kbd··on PEP 750: Tag Strings for Writing Domain-Specific Languages
At least in the spirit of "the language shouldn't be able to define things the user can't" (see: Java string concatenation) this seems like a good change.
kbd··on Show HN: Posting v1 – The modern HTTP client that lives in your terminal
Textual trending to a new de-facto basis for cross-platform gui apps is a HUGE improvement from every new app being js and Electron!

Not to mention replacing heavy Java gui apps as well! The myriad DB guis for whatever historical reason have mostly been slow heavy, and paid, Java apps.

I'd actually written a thing that integrated cli db tools(eg [1]) with kitty[2] and visidata to show a query editor and then results underneath in a kitty split pane. Now I've been using Harlequin[3] in my terminal. So nice to have these apps be fast programs that live in a terminal tab instead of their own bloated poorly-keyboard-driven Electron apps.

[1] https://github.com/kbd/setup/blob/main/HOME/.config/litecli/...

[2] https://github.com/kbd/setup/blob/main/HOME/bin/kw

[3] https://github.com/tconbeer/harlequin/

kbd··on Show HN: Posting v1 – The modern HTTP client that lives in your terminal
After never being happy with Postman or Insomnia and defaulting to 'curlie' for http requests, Posting is the first http gui that I'm actually sticking with. I have a terminal tab with it open all the time and it somehow manages to be more efficient than "up arrow+enter" (since you can just hit enter).

Thanks for improving my workflow, Darren!

kbd··on What I think about Lua after shipping a project with 60k lines of code
Anyone here use https://fennel-lang.org/ to make Lua more palatable/fun?
kbd··on Gh-dash: A beautiful CLI dashboard for GitHub
More than "not bad", Textual is probably best in class for TUIs atm, but I wish Python had static builds! Even Javascript can build executables now with Bun!
Page 1 of 28Next →