Peter Munch-Ellingsen: Why I wrote my own keyboard firmware in Nim (NimConf 2021)
Channel:Nim Programming Language · Length:37:40 · Published:2021-06-26 · Views:3365
Summary
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.
Why HN recommends it
Pointed to as a real-world example of Nim in embedded work, mostly by the author himself.
This presentation about writing keyboard firmware in Nim may be helpful, if you're willing to give Nim some more consideration — HN, 2021
C, C++, Rust, Go & systems languages · Embedded systems & DIY electronics
Subtitles (excerpt)
hello everyone uh welcome to this presentation for nimconf2021 uh my name is peter monkelingsen i'm a computer scientist from norway you can find me on irc as pmonk also on the nim forums and github with the same nickname you can also find me on my website peterme.net where i publish articles and stuff a lot of it about about nim so my talk this year for nimconf is titled uh why i wrote my keyboard firmware in nim um so just a little bit of background um i've been programming for a long time and i've been programming microcontrollers for quite a while uh but i've been doing it in arduino uh so most of you are probably familiar with arduino it's a c plus plus based um library or ecosystem for programming mostly avr microcontrollers um i started with that when i was quite young i remember getting my first arduino when i was still living in my parents basement [Music] and more recently i was i wrote a game for something called an arduboy which is what you can see behind me here um and it is a very interesting it's a like a credit card sized game handheld console it has a small uh one bit display an arduino leonardo uh and a couple of buttons like the old sort of game boy layout um and it runs um arduino code obviously since it's an arduino-based
On Hacker News
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 u… — pure_simplicity, 2021-11
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] - [VIDEO] — archargelod, 2024-10
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: [VIDEO] — PMunch, 2021-10
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: [VIDEO] ). It runs super fast and the code size is smaller than some simple "Hello world" level programs using the Ar… — PMunch, 2021-10
Related videos
- 8-bit computer update · Ben Eater · 6:53
- CppCon 2015: Andrei Alexandrescu “std::allocator...” · CppCon · 1:12:27
- Reverse emulating the NES to give it SUPER POWERS! · suckerpinch · 22:21
- Lexical Scanning in Go - Rob Pike · GoogleFOSSSydney · 51:17
- “Hello, world” from scratch on a 6502 — Part 1 · Ben Eater · 27:24
- CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step” · CppCon · 59:33
- RustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West · Rust Programming Language · 42:29
- CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17” · CppCon · 1:19:52
- Shenzhen: The Silicon Valley of Hardware (Full Documentary) | Future Cities | WIRED · WIRED Investigations · 1:07:51
- Ideas about a new programming language for games. · Jonathan Blow · 1:55:24
- CppCon 2014: Mike Acton "Data-Oriented Design and C++" · CppCon · 1:27:46
- How I program C · Eskil Steenberg · 2:11:32
- Google I/O 2012 - Go Concurrency Patterns · Google for Developers · 51:27
- "Programming a 144-computer chip to minimize power" - Chuck Moore (2013) · Strange Loop Conference · 40:12
- CppCon 2015: Kate Gregory “Stop Teaching C" · CppCon · 1:00:11
- Zig: A programming language designed for robustness, optimality, and clarity – Andrew Kelley · Recurse Center · 54:13