5 ms·
I haven't done a serious Rust project, but it appeared to me that this kind of thing was exactly the "why" of Rust. The expectations I had gathered was that man
by tel 12y ago
I haven't done a serious Rust project, but it appeared to me that this kind of thing was exactly the "why" of Rust. The expectations I had gathered was that many obvious pointer algorithms would not (and should not?) translate to Rust.
I definitely asked for a Rust review from the C POV, but I feel like they do a good job marketing the idea that it's not supposed to express 100% of what other languages do.
Or perhaps it's just further from reasonably expressive than I had believed.
- pcwalton 12y ago> I definitely asked for a Rust review from the C POV, but I feel like they do a good job marketing the idea that it's not supposed to express 100% of what other languages do. You can express everything that other languages can do—we've written a compiler and a Web browser in it, remember. Of course there is a learning curve, but once you've learned the rules I've found that, by and large, people don't have too many problems, and the time saved by not having to track down segfaults in a debugger is a huge productivity booster.
- tel 12y agoTo be clear, I meant "low level 100%" in the sense of outlawed bad programs. I'm quite confident that it'd still be sufficiently expressive for application level concerns—perhaps with a change of style!
- Ygg2 12y ago> "low level 100%" in the sense of outlawed bad programs There is unsafe in Rust. There you can go low level as your heart desires.
- Bougainville 12y ago> and a Web browser in it "Web browser" is an exaggeration for an experimental render engine in an early stage.
- Ygg2 12y agoCalling it a render engine at an early stage is disingenuous. It's a prototype browser engine. By that notion WebKit or Blink are just text renderers.
- mackwic 12y agoWe are far, far from 100%. You can only take mutability lifetimes if you are alone. That mean for example that you can't insert in a tree without going mad. Yeah, you have to search (non-mut operation), insert (mut operation), and balance your tree (mut operation). Not possible. How do you do it in the official B-Tree implementation ? You clone all the branch at each insertion[1] so that the insertion don't compete with the search. Oh well. Hopefully it's a B-Tree so it won't be too deep. But for a performance oriented language, it's make me cry a little. [1]: a) https://github.com/rust-lang/rust/blob/master/src/libcollections/btree.rs#L68 https://github.com/rust-lang/rust/blob/master/src/libcollect... b) https://github.com/rust-lang/rust/blob/master/src/libcollections/btree.rs#L358 https://github.com/rust-lang/rust/blob/master/src/libcollect...
- pcwalton 12y agoThe btree is very immature. TreeMap is better. It demonstrates that these operations can be done fairly naturally with swaps: https://github.com/rust-lang/rust/blob/master/src/libcollections/treemap.rs https://github.com/rust-lang/rust/blob/master/src/libcollect...
- mackwic 12y agoYes, I can see that. And there is also a bunch of interesting patterns to learn from. Please understand that by no mean I want to discredit your work. Rust is a great thing, and will be amazing. However, a random programmer alone in the jungle with only the rustc and the doc will had a hard time to express whatever he likes. It will get better, I trust you. Just don't let the hype grow too fast as Rust is not ready yet, not only in features but also in accessibility.