News for hackers. Stuff that matters.
[dead]
Re:Kirei is a work-in-progress keyboard library written in Zig by timschmidt on Tuesday January 30, 2024 @01:01PM (#39193389)
Popularity isn't what defines rust. Speed, concurrency, and safety are. ;)
Re:Kirei is a work-in-progress keyboard library written in Zig by bluGill on Tuesday January 30, 2024 @01:10PM (#39193515)
I'd say Safety, speed, and concurrency in that order. When Rust advocates talk about the borrow checker I - as a C++ developer - get interested. I can get similar safety and speed from C++ if I use modern C++, but it is too easy to drop back to the unsafe C++ even when modern C++ does the job. (You can drop to unsafe rust if you need, but it isn't as easy, and thus I would expect that Rust developers are not doing that unless they have a real need)
Re:Kirei is a work-in-progress keyboard library written in Zig by jiripospisil on Tuesday January 30, 2024 @01:47PM (#39193991)
> I can get similar safety and speed from C++ if I use modern C++

Which modern C++ feature prevents data races?

Re:Kirei is a work-in-progress keyboard library written in Zig by kimixa on Tuesday January 30, 2024 @02:13PM (#39194303)
RAII mutex locks are a pretty good tool. But like all "modern" c++ features still require programmer diligence to use correctly. Though there are likely other tools outside a compiler error to help enforce this, like static analyzers, or even thread sanitizer to help detect possible issues on a running system.

And just like rust do little to protect against general race conditions, deadlocks, or the many other logic issues you can pretty easily hit around threading. Looking back at my experience around issues that involve threads, I suspect the vast majority of issues I see aren't data races.

Re:Kirei is a work-in-progress keyboard library written in Zig by jiripospisil on Thursday February 01, 2024 @04:35AM (#39214182)
> And just like rust do little to protect against general race conditions

IIRC those should be impossible if you avoid `unsafe`.

Re:Kirei is a work-in-progress keyboard library written in Zig by bluGill on Tuesday January 30, 2024 @03:12PM (#39195094)
Good architecture. Which isn't a c++ feature, but data races are not a big problem in my system because our architecture makes this easy. (We use qt signals/slots for cross thread messages)
Re:Kirei is a work-in-progress keyboard library written in Zig by lionkor on Tuesday January 30, 2024 @01:18PM (#39193606)
Hype isn't popularity, its usually a loud minority, and the kind of people happy to jump on anything.

That said, Zig is cool, and deserves some attention

Re:Kirei is a work-in-progress keyboard library written in Zig by nindalf on Tuesday January 30, 2024 @01:36PM (#39193849)
Zig is great no doubt, but the irony in this comment increased my RBC count.
Re:Kirei is a work-in-progress keyboard library written in Zig by codetrotter on Tuesday January 30, 2024 @05:13PM (#39196615)
It increased your Royal Bank of Canada count?
Re:Kirei is a work-in-progress keyboard library written in Zig by CRConrad on Friday February 02, 2024 @02:37AM (#39226119)
Perhaps his Red Blood Corpuscle count.
Re:Kirei is a work-in-progress keyboard library written in Zig by sophacles on Tuesday January 30, 2024 @01:37PM (#39193865)
It's worth noting there's a difference also between hype and genuine enjoyment/satisfaction with a product.

Look at sqlite threads - they happen here all the time, and there's cyclic periods where you'll see 2-3 a day for a week or two. This has been going on since forever, and there always seems to be someone in the comments wanting to jump on the "anti-hype train", even though after over a decade of popularity and satisfied users it might not actually be hype.

Re:Kirei is a work-in-progress keyboard library written in Zig by metadat on Tuesday January 30, 2024 @02:52PM (#39194811)
I'm struggling to understand the purpose of this library.

> Kirei is a keyboard library that you feed inputs to (which keys are pressed) and get outputs from (HID reports) ... It's not just a keyboard firmware

In what scenarios might one want to use it?

Re:Kirei is a work-in-progress keyboard library written in Zig by foxmoss on Tuesday January 30, 2024 @03:20PM (#39195197)
Screenshots/Examples are needed. I'm still not entirely sure if this keyboards for typing or music...
Re:Kirei is a work-in-progress keyboard library written in Zig by wredue on Tuesday January 30, 2024 @06:08PM (#39197237)
It’s for whatever. You feed button presses and get back a result.

But for a sample. Looks like this is what would sit on your custom keyboard and translate your key presses to something the OS you are plugged in to can use. It’s firmware.

Things like the glove80 and Voyager are pretty popular custom keyboards.

Re:Kirei is a work-in-progress keyboard library written in Zig by RockRobotRock on Tuesday January 30, 2024 @06:15PM (#39197331)
Software which makes a keyboard work how you would expect it to.

I agree that the wording is confusing. It's obviously targeting the custom keyboard hobbyists.

Re:Kirei is a work-in-progress keyboard library written in Zig by __mharrison__ on Tuesday January 30, 2024 @03:02PM (#39194929)
I've customized keyboard fw for ergodoxen and other keyboards. I've helped write tiling window managers. I have no clue what this is...
Re:Kirei is a work-in-progress keyboard library written in Zig by rational_indian on Tuesday January 30, 2024 @07:39PM (#39198142)
Why do we need this? What problem does it solve?

>> Kirei is a keyboard library that you feed inputs to (which keys are pressed) and get outputs from (HID reports) ... It's not just a keyboard firmware

This looks like a repeat of the nodejs leftpad situation but this time it's for keyboard firmware.

Re:Kirei is a work-in-progress keyboard library written in Zig by AlotOfReading on Tuesday January 30, 2024 @09:54PM (#39199210)
It takes the pin changes (matrix or already decoded keys isn't clear to me) and generates the appropriate HID reports based on whether they're tapped, long pressed, shifted, etc. Not the hardest code in the world to write, but a long way from leftpad and fairly easy to miss edge cases on the first try.

Besides, what's the issue with someone writing a personal abstraction library? Java programmers commit greater crimes than this daily.

Re:Kirei is a work-in-progress keyboard library written in Zig by ryncewynd on Wednesday January 31, 2024 @04:45AM (#39201868)
It's keyboard firmware for some riscv microcontrollers.

If you want to build a custom keyboard with certain low cost mcus

Re:Kirei is a work-in-progress keyboard library written in Zig by boomskats on Wednesday January 31, 2024 @02:09AM (#39200919)
This looks like a zmk-ish solution implemented in zig for cheaper/easier devboards like the ch551/2 (and seemingly rp2040, which zmk does support), but with better ux. Better explainer in OP's post on reddit[0]:

[0]: https://www.reddit.com/r/ErgoMechKeyboards/s/Dkoy7YZmWs