thiserror
Our great sponsors
raylib-5k | thiserror | |
---|---|---|
5 | 14 | |
22 | 4,021 | |
- | - | |
0.0 | 8.7 | |
over 1 year ago | 8 days ago | |
Go | Rust | |
- | 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.
raylib-5k
-
Making Games in Go for Absolute Beginners
A game made with it for raylib game jam along with the raylib bindings and other engine stuff: https://github.com/nikki93/raylib-5k
-
Show HN: I made a 2D shoot 'em up game with Go, using Entity Component System
I do also really like Go for various reasons, and have been working on a Go -> C++ transpiler and associated ECS libs to make a personal game project with. I used it to make a game for Raylib game jam earlier this year too: https://github.com/nikki93/raylib-5k You can see what the development workflow looks like in this video (the ECS stuff also has an editor): https://www.youtube.com/watch?v=8He97Sl9iy0
I'm trying to decide how much time I should devote to making this easier to set up / use by other people in the medium term, since it's just a side project for me. Might make a codespaces template so it's quick to get started.
-
Why Am I Excited About WebAssembly?
For the client I use a simple go -> c++ compiler I wrote and compile to wasm from that actually. It had zero overhead interfacing to / calls to C/C++ (including generics<->templates) since it's just generating that. Example web game made with that: https://github.com/nikki93/raylib-5k
I think I've seen wasmtime before. If I needed to interface to any C/C++ things on the server I would probably just write in C/C++ (or Gx) yeah.
-
Generics can make your Go code slower
Sweet! I've been using it for the same. Example game project (did it for a game jam): https://github.com/nikki93/raylib-5k -- in this case the Go gets transpiled to C++ and runs as WebAssembly too. Readme includes a link to play the game in the browser. game.gx.go and behaviors.gx.go kind of show the ECS style.
-
Packet Lost: A game (playable in browser!) made for Raylib jam using a Go->C++ transpiler and WebAssembly. GitHub repo link in comments!
GitHub repo: https://github.com/nikki93/raylib-5k
thiserror
-
Rust Learning Note: Exception Handling
We can utilize third-party libraries to simplify the code above. For example thiserror (https://github.com/dtolnay/thiserror) provides convenien derive macro for Error trait:
- I can't get my mind around Result, Option, or basically how control flow works in most Rust programs
-
Ideas for crafting CLI in Rust
thiserror crate makes it easy to do so using macros on CliError enum.
-
I love building a startup in Rust. I wouldn't pick it again.
Depending on your use case, thiserror and/or anyhow.
-
Hey Rustaceans! Got a question? Ask here (52/2022)!
What is the benefit of splitting a proc-macro crate into (usually) two crates, proc_macro_crate and proc_macro_crate_impl? Why not just have one crate? Does it offer any benefits to to overall compilation times? An example of this can be seen in the thiserror crate where there's a thiserror and thiserror_impl crate.
-
Parsing of DeviceId
You might want to use thiserror to generate implementation for Error and Display.
-
Rust for web development: 3 years later
thiserror for my error types.
-
What crates would you consider essential?
thiserror - https://crates.io/crates/thiserror
-
Generics can make your Go code slower
I dont think you realize how ridiculous this comment is. Youre comparing 10 lines of Go, with 200 of Rust:
https://github.com/dtolnay/thiserror/blob/master/src/lib.rs
-
Is this a good way of handling errors in Rust?
There are crates out there that help you reduce this boiler plate. thiserror is good for creating custom errors and color-eyre or anyhow are good for dynamic errors.
What are some alternatives?
donburi - Just another ECS library for Go/Ebitengine
anyhow - Flexible concrete Error type built on std::error::Error
goloader - load and run golang code at runtime.
color-eyre - Custom hooks for colorful human oriented error reports via panics and the eyre crate
usbarmory - USB armory - The open source compact secure computer
displaydoc - A derive macro for implementing the display Trait via a doc comment and string interpolation
temporal-polyfill - A lightweight polyfill for Temporal, successor to the JavaScript Date object
tracing - Application level tracing for Rust.
airplanes - A 2D shoot 'em up game made with Go, Ebitengine, and donburi. Featuring ECS (Entity Component System).
rust - Rust for the xtensa architecture. Built in targets for the ESP32 and ESP8266
proposal - Go Project Design Documents