Peter Munch-Ellingsen: Why I wrote my own keyboard firmware in Nim (NimConf 2021)
Nim Programming Language1 HN recommender · recommended in 1 month, 2021-2024
3K views · 5 years ago · talk · dated
Peter Munch-Ellingsen explains at NimConf 2021 why he wrote his own keyboard firmware in Nim instead of using QMK or Arduino. He shows that the resulting firmware is very small.
Pointed to as a real-world example of Nim in embedded work, mostly by the author himself.
44:50My personal fight against the modern laptop
linux conf au 2017 - Hobart, Australia
121K views • 9 years ago
1:24:36C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024
CppCon
23K views • 1 year ago
35:41clojure.core/typing - Matt Adereth
ClojureTV
40K views • 10 years ago
22:17WWDC24: Go small with Embedded Swift | Apple
Apple Developer
138K views • 2 years ago
59:48The Road to Zig 1.0 - Andrew Kelley
ChariotSolutions
168K views • 7 years ago
1:02:49Hacking with Andrew and Brad: tip.golang.org
The Go Programming Language
99K views • 11 years ago
1:22:21Introducing a Memory-Safe Successor Language in Large C++ Code Bases - John McCall - CppNow 2023
CppNow
18K views • 3 years ago
1:36:27CppCon 2016: Dan Saks “extern c: Talking to C Programmers about C++”
CppCon
175K views • 10 years ago
41:04Design Your Own Keyboard!
Ben Vallack
140K views • 4 years ago
40:56"Liberating the Smalltalk lurking in C and Unix" by Stephen Kell
Strange Loop Conference
25K views • 12 years ago
1:04:26CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”
CppCon
40K views • 8 years ago
12:31OSCON 2010: Rob Pike, "Public Static Void"
O'Reilly
119K views • 16 years ago
1:19:52CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
264K views • 10 years ago
1:13:11Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains
JetBrains
979K views • 5 months ago
56:36GopherCon 2014 Opening Keynote by Rob Pike
Confreaks
38K views • 12 years ago
30:12Casey Muratori | Smart-Pointers, RAII, ZII? Becoming an N+2 programmer
xDahl
162K views • 2 years ago
1:05:56Lang NEXT 2014 Panel Systems Programming in 2014 and Beyond
25msr
3K views • 8 years ago
1:00:29Google I/O 2012 - Meet the Go Team
Google for Developers
108K views • 14 years ago
1:29:27The Forgotten Art of Structured Programming - Kevlin Henney [C++ on Sea 2019]
cpponsea
245K views • 7 years ago
23:57GopherCon 2016: The Design of the Go Assembler - Rob Pike
Gopher Academy
116K views • 10 years ago
4 comments from Hacker News
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] - ▶ this video
Well, you give yourself a whole lot of extra work by attempting to create a Python to C transpiler, basically creating an even less mature and less popular language ecosystem than Nim has, when you could use Nim and get most of the benefits (statically typed, compiled to C) out of the box and enjoy their growing ecosystem. It seems that Prometeo is currently more limited than Nim. Maybe I'm not understanding your use case well enough and maybe your approach is actually a locally optimal solution, and I honestly greatly respect your effort and want to see your project succeed, cuz I love Python too. I even wanted to make a faster python myself at some point. Just, the more I learn about Nim, the more I appreciate its design 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: ▶ this video There is also another talk about embedded programming in Nim from the same conference, here: link
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: ▶ 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 of just getting out of the way and letting your programs fly. Your point about shell-scripting is kind of valid, it is indeed a weakly typed world. But with how fast Nim compiles the edit-test cycle feels as fast as Python, and you save a lot of time from having a silly typo that you only encounter after having run your script for a little while. The reason why Nim is good for pretty much anything is that the speed of the compiler and the garbage collection will rarely if ever stand in your way, and the flexibility of the syntax that stems from meta-programming allows it to be molded perfectly to the use-case.
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: ▶ this video