207 private links
Awesome
The current nightly preview to run rust file as scripts.
alias cargo-script='cargo +nightly -Zscript -q'
is my new friend.
Technical debt ? It's not anymore if the dependency is vendored in the crate itself.
Jon Gjengset make great tools. The idea of Noria is to compute reads in advance when update occurs. It leads to faster reads.
At a high level, Noria takes a set of parameterized SQL queries (think prepared statements), and produces a data-flow program that maintains materialized views for the output of those queries.
Rust is associated to software engineering. The post confirms rust concepts.
In all cases, it takes time for the worst or the best.
How to prototype in Rust?
- use simple types: String, Vec
, Box , Rc and Arc<Mutex > to avoid ownership and lifetime issues. - make use of type inference
- use
.unwrap()
, and quick context withbail!()
undwith_context
of the crateanyhow
- run the code (and tests) automatically with
bacon
- have a look to
cargo-script
- Use
println!
anddbg!
for debugging:dbg!
has advantages such as printing file name and line number, outputs the expression adn less syntax-heavy.dbg!(x)
- Design through types
- rely on the
todo!
macro - rely on the
unreachable!
for assumptions of dead code branches: it documents assumptions - rely on
assert!
for invariants: it documents assumptions - avoid generics and lifetimes: use concrete types and owned types
- keep a flat hierarchy (of files), then only starts playing with mod around. All in the same file.
- start small
It uses Tauri under the hood to provide efficient defaults to desktop apps.
Some issues while developing rust game engine.
A discussion follows on Lobste.rs https://lobste.rs/s/gpyj5x