CommunityNews

CommunityNews

I rewrote my Rust keyboard firmware in Zig: consistency, mastery, and fun

I’ve spent the last year building keyboards, which has included writing firmware for a variety custom circuit boards.

I initially wrote this firmware in Rust, but despite years of experience with that language I still struggled quite a bit. I eventually got my keyboards working, but it took an embarrassingly long time and wasn’t fun.

After repeated suggestions from my much more Rust-and-computing-experienced friend Jamie Brandon, I rewrote the firmware in Zig, which turned out swimmingly.

I found this quite surprising, given that I’d never seen Zig before and it’s a pre-1.0 language written by a fellow PDX hipster with basically just a single page of documentation.

The experience went so well, in fact, that I now feel just as likely to turn to Zig (a language I’ve used for a dozen hours) as to Rust (which I’ve used for at least a thousand hours).

This, of course, reflects as much about me and my interests as it does about either of these languages. So I’ll have to explain what I want from a systems programming language in the first place…

https://kevinlynagh.com/rust-zig/

This thread was posted by one of our members via one of our news source trackers.

Popular Backend topics Top

PragmaticBookshelf
Go is a modern programming language that combines the reliability of compiled languages with the ease of use and flexibility of dynamic t...
New
PragmaticBookshelf
The next step in the evolution of user interfaces is here. Chatbots let your users interact with your service in their own natural langua...
New
bot
Kotlin v1.4.20-M1 has been released. Link: Release Kotlin 1.4.20-M1 · JetBrains/kotlin · GitHub
New
CinderellaMan
Create a cryptocurrency trading bot in Elixir (YouTube videos, ebook pay what you want) <span class="hashtag-icon-placeholder"></span>eli...
New
First poster: bot
A new Rust blog post/announcement has been posted! Get the full details here: Announcing Rust 1.53.0 | Rust Blog
New
mafinar
I did not add this to a “this weekend I’ll learn” like my few other journals as I am decided on using this in the long term. Last I work...
New
PragmaticBookshelf
Use WebRTC to build web applications that stream media and data in real time directly from one user to another, all in the browser. ...
New
PragmaticBookshelf
Delve into async features of JavaScript from ES2020 through ESNext. Start building custom asynchronous iterators and generators, and more...
New
sampu
I have a use case where a client is invoking a Rest endpoint via a load balancer, which in turn invokes a third party endpoint which is r...
New
Fl4m3Ph03n1x
Background I am trying to encode a structure into json format using the Jason library. However, this is not working as expected. Code L...
New

Other popular topics Top

New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1119 25038 737
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New