HackerTrans
TopNewTrendsCommentsPastAskShowJobs

kbd

3,464 karmajoined 16 years ago
https://github.com/kbd

comments

kbd
·2 days ago·discuss
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
·3 months ago·discuss
What can you do on a Mac with Shortcuts vs AppleScript vs Hammerspoon?
kbd
·4 months ago·discuss
That's cool, I hadn't heard of Squint, thanks! Looks lightweight. Another compile-to-js option that seems good is Gleam.
kbd
·4 months ago·discuss
Hmm I already avoid Lua by writing in Fennel, I’ll probably avoid the JS by writing… what Lisp compiles to JS, ClojureScript?
kbd
·7 months ago·discuss
It's Rust vs Python in this case.
kbd
·7 months ago·discuss
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
·7 months ago·discuss
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
·7 months ago·discuss
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
·7 months ago·discuss
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
·7 months ago·discuss
> 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
·7 months ago·discuss
> 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
·7 months ago·discuss
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
·8 months ago·discuss
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
·9 months ago·discuss
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
·9 months ago·discuss
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
·9 months ago·discuss
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
·9 months ago·discuss
I was soo excited when they announced this, but I've heard almost nothing since.
kbd
·9 months ago·discuss
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
·9 months ago·discuss
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
·10 months ago·discuss
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