svd2nim
py_regular_expressions
svd2nim | py_regular_expressions | |
---|---|---|
7 | 43 | |
17 | 1,724 | |
- | - | |
4.5 | 2.8 | |
4 months ago | 9 months ago | |
Nim | Python | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
svd2nim
-
Memory-mapped IO registers in Zig. (2021)
Nim's maintainer agrees with you I believe, and the API is as you suggest (volatileLoad and volatileStore): https://nim-lang.org/docs/volatile.html
However, under the hood, Nim compiles to C. So these are macros that typecast to volatile, does the read (or write), then casts back to non-volatile.
(Small plug for my nim project that is somewhat related to OP: https://github.com/EmbeddedNim/svd2nim)
-
New embedded programming language with C as a host language
C++ has decent industry acceptance in embedded nowadays, or at least that has been my impression.
After C++, rust is likely the most popular, quite a lot of effort has been put into running rust on embedded, see eg https://github.com/rust-embedded. However, once again to my understanding, industry acceptance is still highly marginal.
After that, there's a bunch of toy-ish efforts to run other languages. Zig, nim, python and javascript variants, etc. Usually anything that has C ABI compatibility should be possible to get up and running (without writing a compiler backend from scratch). I've had fun with some toy projects using nim for ARM cortex-M targets (https://github.com/EmbeddedNim/svd2nim, https://github.com/auxym/nim-on-samd21, https://github.com/EmbeddedNim/picostdlib).
Using Nim (and eg svd2nim to generate the equivalent of CMSIS headers for register access in pure nim), it would be entirely possible to write even the low level stuff (SPI drivers and whatnot) in 100% nim, with the same performance as C and better safety (better static type system and compile-time checks, etc). Runtime (eg overflow) checks and garbage collection are available (at the cost of some performance) but optional. See eg. a pretty basic higher-level API for GPIO access, that provides native performance, since the abstraction is implemented as macros (compile-time abstraction): https://github.com/auxym/nim-on-samd21/blob/master/src/port....
-
specify address of a variable
Any chance your MCU is ARM? If so check out my project to generate the register mappings from CMSIS SVD files: https://github.com/EmbeddedNim/svd2nim
-
Emulator of Original Dell Charger Using ATTINY85
To be clear: Ratel isn't my project, just something I'm following due to interest.
In the interest of shameless self promotion :), my own experimentations are :
https://github.com/EmbeddedNim/svd2nim
https://github.com/auxym/nim-on-samd21
And I've used and contributed to picostdlib (https://github.com/beef331/picostdlib), the rp2040 support library.
All just as a hobby, but it's interesting to learn that some companies are actually looking into Nim for firmware! Embedded seems like such a slow moving industry. I believe the author of Nesper and Nephyr also developed them for professional work.
- Ask HN: What's Your Side Project?
-
An Embedded USB Device Stack in Ada
Many vendors provide svd files which describe the hardware registers. It's possible to convert the svd automatically like they do for C. Here's an example for Nim [1]. Rust has one as well.
Though I agree that MCU's currently involve a lot of busy work. It's why I'm working on building a nice system building on Zephyr using Nim [2]. It's pretty great to write a few dozen lines of concise memory safe code to do somethinguseful, and then be able to run it on dozens different MCUs.
It'd be great if there was more Ada core in these systems, as Zephyr is all built in C. At least it's modern clean C and well tested.
1: https://github.com/EmbeddedNim/svd2nim
-
Writing embedded firmware using Rust
If you're curious, I have this in MVP status at the moment: https://github.com/auxym/svd2nim
py_regular_expressions
- Understanding Python re(gex)?
-
TUI app with 100+ interactive Python Regex exercises
These exercises have been adapted from my Understanding Python re(gex)? ebook (free to read online).
-
Show HN: Interactive Exercises for Python Regular Expressions
This new version is a TUI app built with Textual. Previous one was written using `tkinter` [0] and covered only four of the `re` functions.
Now, any valid Python expression is accepted as a solution. Both the builtin `re` and third-party `regex` modules are covered.
These exercises have been adapted from my Understanding Python re(gex)? ebook [1] (free to read online, and PDF/EPUB versions are free till the end of this month).
I'd appreciate your feedback, happy learning :)
[0] https://news.ycombinator.com/item?id=29391107
[1] https://github.com/learnbyexample/py_regular_expressions
- Understanding Python re(gex)? with hundreds of examples and exercises (eBook)
-
Understanding Python re(gex)? with hundreds of examples and exercises (free till Feb 5)
Visit https://github.com/learnbyexample/py_regular_expressions for markdown source, example files, exercise solutions, sample chapters and other details related to the book.
-
Show HN: Interactive exercises for Linux CLI text processing commands
Last year, I did a similar project for 75 Python regular expressions exercises: https://github.com/learnbyexample/py_regular_expressions/tre...
That was with Tkinter. I'm planning to update the regex book next year (to add new features like possessive quantifiers and other misc changes). Along with this update, I'll probably make a TUI version and add support for rest of the exercises.
-
Show HN: The Typing of the RegEX
If you are interested in Python regex, here's my tkinter app with 75 interactive exercises: https://github.com/learnbyexample/py_regular_expressions/tre...
This assumes you already know Python regex. If you'd like learn first, see my free ebook: https://learnbyexample.github.io/py_regular_expressions/
-
Best site to learn regex?
I have an entire book dedicated for learning regex from the basics, with hundreds of examples and exercises. I cover both re and third-party regex module. It is free to read online: https://learnbyexample.github.io/py_regular_expressions/
-
What's the coolest thing you've built so far?
A tkinter GUI that helps you to practice your understanding of regular expressions with 75 exercises: https://github.com/learnbyexample/py_regular_expressions/tree/master/interactive_exercises
-
Py Regex
https://github.com/learnbyexample/py_regular_expressions/blob/master/py_regex.md.
What are some alternatives?
rp2040_hal - Ada drivers for the Raspberry Pi RP2040 SoC
bms-tools
probe-run - Run embedded programs just like native ones
RegExr - RegExr is a HTML/JS based tool for creating, testing, and learning about Regular Expressions.
picostdlib - Nim wrapper for the raspberry pi stdlib
regex-generator - Generate regular expressions from sample texts.
kcgi - minimal CGI and FastCGI library for C/C++
mpack - MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]
nephyr - Nim wrapper for Zephyr
PropertyWebBuilder - Create a fully featured real estate website on Rails in minutes! ⛺
dotfile - Simple version control made for tracking single files
resholve - a shell resolver? :) (find and resolve shell script dependencies)