in-one-weekend
semver-trick
in-one-weekend | semver-trick | |
---|---|---|
5 | 15 | |
0 | 414 | |
- | - | |
4.2 | 2.8 | |
about 2 years ago | 21 days ago | |
Rust | Rust | |
MIT License | 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.
in-one-weekend
-
What is one of the best ways to master Rust?
I followed that tutorial as one of my very first Rust projects. Here is my GitHub repo: https://github.com/LoganDark/in-one-weekend
- My first Rust project, a raytracer based on Ray Tracing in One Weekend book
-
How would you go about learning advanced Rust by coding with as little theory as possible?
my implementation
- First Rust project: Simple Raytracer!
-
Rust is hard, or: The misery of mainstream programming
I feel like this isn't just a case of people intentionally trying to ignore Rust's idioms, but just not knowing how to transfer over their existing knowledge. As someone who's learned over 15 programming languages throughout the years (rookie numbers, I know ;) it was relatively easy for me to learn Rust in about 2 weeks by diving straight into Ray Tracing in One Weekend (my implementation here), but I still feel like not many people could have done that, so I tend to hold off on assuming that they're intentionally trying to misuse Rust.
semver-trick
-
Making Rust supply chain attacks harder with Cackle
Let's say crate B depends on crate A with a pinned dependency, and uses one of its types in a public interface.
Crate C depends on them both. It now can't bring in updates to A until B does, and when B updates that's a breaking change, so it better bump its major version.
Take a look at this teick, for example, for foundational crates updating their major version: https://github.com/dtolnay/semver-trick
Now imagine that being an issue every single patxh update.
-
The module system is too confusing
Rust modules require a tiny bit more definition up-front, but they neatly decouple the module hierarchy from file layout so you can reorganize code however you like in future, and they support very fine grained control of privacy (such as being able to say pub(super) and pub(crate)). In extreme cases, you can even re-export symbols from one module in another without it counting as a breaking change, so you have even more options for evolving your project without breaking existing consumers. Look at the the semver trick as an example of how powerful this can be and how much freedom it gives library implementors. (And even if you're only a library consumer, wouldn't you rather be consuming libraries by implementors that had more freedom and power?)
-
My first year with Rust: The good, the bad, the ugly
A library author concerned about this can use the semver trick. TL;DR: if your current version is 0.42, you can do a 1.0 release, then do a 0.43 release that depends upon your 1.0 release and re-exports all the symbols.
-
Does Rust have any design mistakes?
I mean for all the parts of the standard library that do not change, one could presumably use the semver-trick.
-
Rust is hard, or: The misery of mainstream programming
The semver trick can help with libraries at least when they go to unify the ecosystem. Release new versions that replicate previous APIs in a compatible way while moving to the standard library implementation.
-
Roadmap
Because you still run into the problem that's been seen when various important crates upgraded and either didn't use the semver trick or had downstream crates specifying Cargo.toml version requirements too narrowly for it to be effective.
- The Rust SemVer Trick (2019)
-
This Year in Embedded Rust: 2021 edition
It's called the "semver-trick" [1].
[1]: https://github.com/dtolnay/semver-trick
- The Semver Trick
-
The chip shortage keeps getting worse. Why can't we just make more?
The JVM is 114MiB on my machine. A near-minimal ggez program in debug mode is about 100MiB,¹ and ggez is small for a Rust application library. When you start getting into the 300s of dependencies (i.e. every time I've ever got beyond a trivial desktop application), you're lucky if your release build is less than 100MiB.
Sure, I could probably halve that by forking every dependency so they aren't duplicating versions, but that's a lot of work. (It's a shame Rust doesn't let you do conditional compilation based on dependency versions, or this would be a lot easier. As it is, we have to resort to the Semver trick: https://github.com/dtolnay/semver-trick/ — not that many people do that, so it's functionally useless.)
¹: I can get it down to around 8MiB with release mode, lto etc., but that significantly increases the build time and only about halves the weight of the intermediate build files.
What are some alternatives?
Thruster - A fast, middleware based, web framework written in Rust
lang-team - Home of the Rust lang team
hello-world.rs - 🚀Memory safe, blazing fast, configurable, minimal hello world written in rust(🚀) in a few lines of code with few(1092🚀) dependencies🚀
cargo-llvm-lines - Count lines of LLVM IR per generic function
Hirrolot
rust-base64 - base64, in rust
nebulae - A multi-threaded, configurable, Nebulabrot renderer
metalang99 - Full-blown preprocessor metaprogramming
rust-quiz - Medium to hard Rust questions with explanations
RayTracingRust - A simple CPU ray tracer written in Rust
serde - Serialization framework for Rust