HN user

kbd

3,464 karma

https://github.com/kbd

Posts22
Comments814
View on HN
www.youtube.com 3y ago

Zig's I/O and Concurrency Story – King Protty – Software You Can Love 2022

kbd
13pts1
github.com 4y ago

'go mod tidy' broken in Go 1.18 using go.work

kbd
1pts0
cone.codes 4y ago

Using Zig to Build Native Lua Scripts

kbd
10pts1
youtube.com 4y ago

CrystalConf 1.0 Videos Released

kbd
4pts1
dev.to 5y ago

Async CPU bound workers in Zig

kbd
3pts0
www.reddit.com 6y ago

Nimporter 1.0 released (seamlessly import Nim code from Python)

kbd
95pts6
redmonk.com 6y ago

RedMonk Programming Language Rankings: January 2020

kbd
9pts0
media.ccc.de 7y ago

Taming the Chaos: Can we build systems that actually work?

kbd
4pts0
labs.spotify.com 7y ago

Introducing Chartify: Easier chart creation in Python for data scientists

kbd
2pts0
medium.com 7y ago

(Jupyter) Notebook Innovation at Netflix

kbd
3pts0
om.co 8y ago

Dean Allen, R.I.P.

kbd
17pts6
github.com 9y ago

Progress – tool to show progress for cp, mv, dd...

kbd
2pts0
techcrunch.com 9y ago

Fitbit acquires Vector Watch

kbd
4pts0
panic.com 10y ago

The Panic Sign

kbd
9pts0
www.myce.com 10y ago

Skylake CPUs have 'inverse Hyper Threading' to boost single-thread performance

kbd
43pts21
www.michaelnygard.com 10y ago

Redeeming the Original Sin

kbd
1pts0
morepypy.blogspot.com 12y ago

Rewrites of the STM core model – again

kbd
98pts32
www.techdirt.com 13y ago

Charles Carreon Has To Pay $46K In Legal Fees

kbd
101pts32
roberto.costumero.es 14y ago

Go vs C benchmark. Could Go be faster than C?

kbd
14pts0
morepypy.blogspot.com 14y ago

Plotting using matplotlib from PyPy (proof of concept embeds CPython in PyPy)

kbd
3pts0
mail.python.org 14y ago

PyPy support for Python 3 (pypy-dev)

kbd
61pts17
samba.org 14y ago

Samba 3.6.0 released

kbd
1pts1

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.

Hammerspoon 4 months ago

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

Hammerspoon 4 months ago

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

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.

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.

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?

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

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

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.

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.

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

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.

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.

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.

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/

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!

Yes. Multiple times. Senior software engineer. Still recovering from last burnout after being laid off last year. I tend to get a job, work there for a number of years, then we either get acquired or I get laid off and I take a year or two off to recuperate in between...

I've started seriously starting coding again though so there is light at the end of the tunnel. It sucks to not do what you enjoy doing because you're burnt out from doing it for pay for the man.