go-sumtype
esp-wifi
go-sumtype | esp-wifi | |
---|---|---|
11 | 7 | |
403 | 378 | |
- | 4.8% | |
0.0 | 8.9 | |
about 1 year ago | 3 days ago | |
Go | Rust | |
The Unlicense | Apache License 2.0 |
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.
go-sumtype
-
Small sum types in Golang
I find this implementation to be quite minimal and less clumsy than alternatives. Sure, you don't get nice exhaustive pattern matching. Also, type inference gets in the way when instantiating UserKey (though you can wrap it in constructor functions). But expressing your intent using types still makes your code much more convenient and easier to understand.
-
Switching from C++ to Rust
The call out to sum types is something I feel. I've been using Rust daily for almost 10 years now, and sum types are absolutely still one of the things I love most about it. It's easily one of the things I miss the most in other languages. I'm usually a proponent of "using languages as they're intended," but I missed exhaustiveness checking so much that I ported a version of it to Go[1] as a sort of lint.
[1]: https://github.com/BurntSushi/go-sumtype
-
Rusty enums in Go
A Google search for golang sum types currently shows my project as a second hit: https://github.com/BurntSushi/go-sumtype
-
Carbon Language: An experimental successor to C++
I've been writing Go and Rust nearly daily for about a decade now (Go is more than a decade, Rust is about 8 years). You are not going to teach me anything about the pros and cons of either language in a reddit comment. I do not need to be taught about the "iota mess" when I've written tooling for exhaustiveness checking in Go.
-
a go linter to check switch statements for default
https://github.com/BurntSushi/go-sumtype forces exhaustive type switches for interfaces specifically annotated to need that.
-
Go: Making state explicit using the type system
We can fix these two problems by relying on static analyzers such as go-sumtypes
-
Hacking sum types with Go generics
See also https://github.com/BurntSushi/go-sumtype
- What I'd like to see in Go 2.0
-
Upcoming Features in Go 1.18
go-sumtype[0] has completeness checking for sealed interfaces.
[0] https://github.com/BurntSushi/go-sumtype
-
I want enum more than generics
Pretty easy to achieve outside of the compiler: https://github.com/BurntSushi/go-sumtype
esp-wifi
-
Rust on Espressif chips – 29-09-2023
Good question! As far as I can tell from the docs, it looks like I2C is still synchronous [1], but this will be my first async embedded Rust project, so I'm still unfamiliar with the general shape and functionality of things.
For comparison, things like WiFi are definitely async [2]
[1] https://docs.rs/esp32s2-hal/latest/esp32s2_hal/i2c/index.htm...
[2] https://github.com/esp-rs/esp-wifi/blob/main/examples-esp32s...
-
The Embedded Rust ESP Development Ecosystem
Among these several abstractions, we can program a microcontroller device at any level we like. Additionally, we can develop code with a mix of low-level and high-level abstractions. Obviously, to make code more portable it's better to stick to higher-level abstractions. Also in addition to the above, there exists other crates supporting other functions in no-std development. These include wifi services in the esp-wifi repository, heap allocators in the esp-alloc repository, logging features in the esp-println repository, exception handlers in the esp-backtrace repository, and finally embedded storage traits in the esp-storage repository.
-
ESP32-C3 Wireless Adventure: A Comprehensive Guide to IoT [pdf]
I haven't done much with it yet, but I'm excited about the bare-metal (no_std) rust support for the esp32c3 (as opposed to some other variants that require a custom toolchain as I understand it).
Lots of details at <https://mabez.dev/blog/posts/>, and some examples of wifi on bare-metal at <https://github.com/esp-rs/esp-wifi>.
I hope to eventually get it working with MQTT (there may be examples already, I haven't yet looked in-depth), at which point I think this will be my go-to for the majority of my IOT projects going forward!
-
Switching from C++ to Rust
Esp-wifi is very actively being updated, looks like C3 is supposed to work[0][1], so if you tried more than a few weeks ago it probably changed.
[0]: https://github.com/esp-rs/esp-wifi#current-support
-
Rust for Embedded Development (e.g. microcontrollers)
I previously used the esp32-c3 both with bare-metal and with the idf in rust, but I did not like the experience. With the idf you get poor ide support and poor documentation and with bare metal you used to get no wifi at all, but the experience is a lot better. I have seen the new rust wifi driver https://github.com/esp-rs/esp-wifi and i am very interested, but this is still a sync driver afaik.
-
Embedded Rust Development
Also got an ESP32C3 to connect to my wifi network, which was really exciting: https://github.com/esp-rs/esp-wifi
-
ESP32 Packet Sniffing and Manipulation
Check the project https://github.com/esp-rs/esp-wifi, it implement bindings to the official SDK.
What are some alternatives?
go101 - An up-to-date (unofficial) knowledge base for Go programming self learning
esp-idf-svc - Type-Safe Rust Wrappers for various ESP-IDF services (WiFi, Network, Httpd, Logging, etc.)
enumer - A Go tool to auto generate methods for your enums
rust-esp32-std-demo - Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.
go - The Go programming language
esp-idf-template - Template application for https://github.com/espressif/esp-idf
hylo - The Hylo programming language
esp-pacs - Peripheral Access Crates for Espressif SoCs and modules
crubit
mo - 🦄 Monads and popular FP abstractions, powered by Go 1.18+ Generics (Option, Result, Either...)
espup - Tool for installing and maintaining Espressif Rust ecosystem.