UIKit is an example of a high-level dynamically linked library. Rust isn't ready for that category of use case - but to be fair neither is C++ :)
> Rust does offer a wide variety of functionality for working with shared data. It is definitely syntactically more verbose than in languages that don't try to tame mutation, but it's essentially equivalent functionality
My point regarding shared data is not about Rust's verbose syntax, but about its unwanted runtime checks which no other languages perform.
Here's what I have in mind (doing my best pseudo-Rust):
struct CounterWidget {
count: u32,
limit: u32,
didClick: fn(),
};
impl CounterWidget {
fn clicked(&mut self) {
if self.count < self.limit {
self.count+=1;
didClick();
}
}
fn setLimit(&mut self, limit:u32) {
self.limit = limit;
}
}
The Counter widget has a count and a limit, and a callback for when it's clicked. It also has a landmine: if the click callback attempts to call setLimit on the same Counter, it will crash at runtime.This crash is hard to test for and doesn't add any value: why shouldn't the callback be able to adjust its limit?