Skip to content
0:00 / 0:00

#nim#keyboardfirmware#microcontroller

Peter Munch-Ellingsen: Why I wrote my own keyboard firmware in Nim (NimConf 2021)

Nim Programming Language

3.2K subscribers • 2 videos on Hallway

YouTube
  • Recommended by 1 person: 1 on Hacker News.
  • Presented by Peter Munch-Ellingsen
  • Linked in the descriptionPMunch/badger
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

3.3K views5 years ago1 recommendation

Programming languagesSystems programmingEmbedded systemsLanguage design and type systems

Peter Munch-Ellingsen explains why he chose to write custom keyboard firmware in Nim and how it achieves extremely small binary sizes.

github.com/PMunch/badger

Why it's here

1 person recommends this

What people say. Recommended as a great example of using Nim for resource-constrained embedded systems.

pure_simplicityon Hacker News • Recommends

On “Show HN: Prometeo – a Python-to-C transpiler for high-performance computing”

…ign decisions and think to myself: this is the faster version of python I'm looking for. Now, we just need the large package ecosystem that python has, but I'm willing to both wait and participate in making it come about. This presentation about writing keyboard firmware in Nim may be helpful, if you're willing to give Nim some more consideration: link to this video There is also another talk about embedded programming in Nim from the same conference, here: link…

PMunchon Hacker News • Mentions

On “Nim 1.6”

Oh it definitely can run on those devices! I wrote my own keyboard firmware from scratch in Nim, and the firmware sizes are vanishingly small compared to even simple "hello world" level stuff in Arduino. I did a talk on it for NimConf2021: link to this video

PMunchon Hacker News • Mentions

On “Nim 1.6”

Nim works super well for embedded. The thing is that you can turn off the garbage collector and do manual memory allocation if you want to. Or simply use ARC which works a treat on embedded. I wrote my own keyboard firmware in Nim (and did a presentation of it during NimConf 2021: link to this video ). It runs super fast and the code size is smaller than some simple "Hello world" level programs using the Arduino system. As for gamedev the ability to tune the GC by turning off automatic collection and then running it with a time-limit is perfect for preventing lag-spikes when a lot of stuff is going on (looking at you Java..). Nim actually performs very well, and the garbage collector does a great job o…

archargelodon Hacker News • Mentions

On “Embedded Rust in Production?”

I don't have any first-hand experience with embedded myself, but I've seen positive comments on different forums about using Nim in production for embedded devices. For example, see a couple pages of comments by girvo 1. Also there's a video on writing keyboard driver in Nim 2. 1 - link 2 - link to this video