292 private links
- giving every integer a shared helper method: define a trait with two required methods and one default method,
- Making class AnimatedServo still count as a Servo: require a trait in another trait
- adding a method to a type you don't own: implement a new trait for the primitive type
- giving a tiny Enum a full set of standard behaviors: the standard traits already exist and
derive - making a wrapper feel like the thing inside it: the wrapper can implement the thing and implement
DerefandDerefMut - adding union to any collection of range sets: mock a wrapper around a BTreeSet for example
- treating fifteen integer-link types the same way: to avoid writing the same method bodies 15 times, write a
macro_rules - Giving Only OutputArray<8> (8 bits) a Byte-Oriented Method: implement a general methods in the general impl block. It's named Constraint-Gated Methods.
- How would you make some methods available only when the method’s type parameter has the required capabilities? Use
serdeandpostcardwith aHashMapstanding in for flash memory.
News about Lychee and why recursive link checking is not trivial.
Challanges:
One is named "distributed termination detection": know when you're done. "The classic solutions (Dijkstra–Scholten, token passing) just don’t map well onto Tokio’s channel-based world.
Another is the cycle because it's a DAG.
Then there is backpressure with the checker and the sender to the channel. If that channel is full, the response handler blocks; if it blocks, no responses are consumed; if no responses are consumed, no request slots free up.
Deduplication Races can occurs because the links are checks aynchrono
Leaky abstraction because the recursion spreads everywhere: reponses need to carry discovered links, requests need a depth, the collector need to understand recursive inputs, stats and formatters need to handle duplicates.
There is hope though because there is progress!
None of those are lychee problems. They’re hard concurrent-systems problems. We just lacked the vocabulary to talk about them, and while I wasn’t looking, those primitives got built. Sometimes the most important code you write for a feature is the code that never mentions the feature at all. So no, I don’t think we failed. We made progress by stumbling into the right direction.
Even the best have "No idea" for "Safety" at some places. Another one: https://github.com/rust-lang/rust-analyzer/blob/932186d9c2046257c0a1fc38c1cecf7bc19736c3/crates/hir-def/src/lib.rs#L536
There is an "// SAFETY: Come fight me" in the rust uuid crate :D
The ecosystem is fragmented
One example to illustrate why Go is so great for backend services is that the Go services I'm working on don't even have a reverse proxy / load balancer in front of them. Thanks to Go built-in TLS and ACME (Automatic Certificate Management Environment), they are directly exposed to the internet, something that may not be possible due to the complexity of wiring together rustls and axum and ACME. Small details like that compound fast and considerably improve the deployment, management and operation of your backend services. Hey, even UUIDs are coming to Go's standard library.
Also async Rust will waste your time compared Go and your CI/CD pipelines may take 10 times more time (e.g. 4 minutes for Go, 40 minutes for Rust, for a service of the same size).
It seems Ruby is better with Ruby on Rails
Pertinent comments here about the importance of a large or a small standard library.
I think that what you're actually looking for is The Rule of Least Power, just applied to types. You should choose the lightest weight, conceptually simplest approach you can that keeps the code intelligible to others.
Smart Pointers should be used only when regular borrowing does not work.
AppWrite support Rust with a dedicated SDK
Why?
Async in Rust is hard. The biggest drawback of async is the fragmentation of the ecosystem. Now you have sync functions and libs, async functions and libs, and different runtimes that are incompatible and thus require dedicated libraries for I/O.
An anemic standard library for daily needs.
The steep learning curve before being productive.
When Rust makes the most sense?
- common core for cross-platform apps. Proton leads the way.
- system programming
- embedded development
- insane scale
The project is available at https://github.com/kadir/cloakrs
There are a number of serialization libraries that outperform JSON in NodeJS.
It's important to avoid generating extraneous garbage when doing these kinds of benchmarks.
It's important to provide an appropriately sized buffer when performing serialization.
If you care about serialization performance, consider using a different programming language with better tradeoffs.
A Finite State Transducer seems to be the best algorithm instead of a full index search.
The data don't need to be stored in a database indeed. They only need to be searched as text.
An example of scripts rewritten in Rust