Better HN
topnewbestaskshowjobs
Log inSign up

kbd

3,459 karma · joined Oct 26, 2010 (16y ago) · 850 submissions

https://github.com/kbd
Submissions

comment 3mo ago · link · parent

Very cool to see a man execute on his vision. Ghostty -> libghostty -> terminal multiplexing -> ???

comment 4mo ago · link · parent

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.

comment 7mo ago · link · parent

What can you do on a Mac with Shortcuts vs AppleScript vs Hammerspoon?

comment 8mo ago · link · parent

That's cool, I hadn't heard of Squint, thanks! Looks lightweight. Another compile-to-js option that seems good is Gleam.

comment 8mo ago · link · parent

Hmm I already avoid Lua by writing in Fennel, I’ll probably avoid the JS by writing… what Lisp compiles to JS, ClojureScript?

comment 11mo ago · link · parent

It's Rust vs Python in this case.

comment 11mo ago · link · parent

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...

comment 11mo ago · link · parent

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.

comment 11mo ago · link · parent

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.

comment 11mo ago · link · parent

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?

comment 11mo ago · link · parent

> 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...

comment 11mo ago · link · parent

> 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

comment 11mo ago · link · parent

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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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

comment 1y ago · link · parent

I was soo excited when they announced this, but I've heard almost nothing since.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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...

comment 1y ago · link · parent

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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

Had the same question, surprised it's not addressed in the faq.

comment 1y ago · link · parent

Go deserves to get TypeScripted. Another effort in this vein is Go+

https://github.com/goplus/gop

comment 2y ago · link · parent

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.

comment 2y ago · link · parent

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/

comment 2y ago · link · parent

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!

comment 2y ago · link · parent

Anyone here use https://fennel-lang.org/ to make Lua more palatable/fun?
12345
29