228 private links
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
Interning works by ensuring that there’s only one canonical copy of each distinct string in memory.
CGP makes use of Rust's trait system to define generic component interfaces that decouple code that consumes an interface from code that implements an interface. This is done by having provider traits that are used for implementing a component interface, in addition to consumer traits which are used for consuming a component interface.
libSQL is a portability in WASM of SQLite.
The Turso project experiment a rewrite of SQLite in Rust with some technical implementation in mind:
Limbo is a research project to build a SQLite compatible in-process database in Rust with native async support. The libSQL project, on the other hand, is an open source, open contribution fork of SQLite, with focus on production features such as replication, backups, encryption, and so on. There is no hard dependency between the two projects. Of course, if Limbo becomes widely successful, we might consider merging with libSQL, but that is something that will be decided in the future.
Either all fields are public or all fields are private.
Pain in C++
- tools and compiler/platform differences
- ergonomics and (thread) safety
- community
Why Rust?
- fun & cool: better for a hobby project. It is a need.
- Great tooling
- Options are easier to use than C++'s pointers
use
system over#include
- simpler dependency management
- killer feature is Send and Sync, statically enforcing rules around threading.
Ship of Theseus strategy for the rewrite: component by component. The fish app should work exactly the same.
So if you are trying to draw any conclusions from this, consider the context: A group of people working on a thing in their free time, diverting some effort to work on something else, and deciding that after the work is finished it actually isn’t.
Gripes with Rust
- portability between OS: it allows to miss systems and ignoring version differences
- string translation and localization: format! are checked at compile-time
- building to other targets: "it is often better to use if
cfg!(...)
instead of#[cfg(...)]
because code behind the latter is eliminated very early, so it may be entirely wrong and only shows up when building on the affected system.
They also report mistakes they made.
There are good with quick-wins of the port to Rust. There is also some sad ones: CMake is not removed yet. Cargo is missing some features to install third dependencies (.fish scripts, 130 pages of documentation, the web-config tool and the man page generator).
Cygwin is not a supported platform.