Carl Kadie - 9 Rules for Creating (...) Data Structures - Rust Linz

preview_player
Показать описание
Data structures lie at the heart of robust software. Happily, with its speed and safety, Rust is great for creating new data structures. But where to get started and what to watch out for?

In this talk, we’ll cover nine rules that I learned while creating range-set-blaze, a crate for manipulating sets of “clumpy” integers. The rules include “plagiarize your design and documentation” and “create more Rust iterators than you expect”.

Whether you are an experienced Rustacean looking for a few tips or a beginner wanting to better understand how Rust features work together, this talk is for you!

Рекомендации по теме
Комментарии
Автор

Great talk. I would add that for data structures like this that have contracts and invariants, that it is absolutely essential to use something like quickcheck or proptest to both document and enforce these. This is different from tests or performance tests on representative data. This kind of contract testing is often not appropriate or outright useless for your application domain models, but is non-negotiable for the containers and processors.

mrpocock
Автор

Great presentation and nice data structure!

HyperFocusMarshmallow
Автор

12:35 You mention here that your RangeSetBlaze only contains integers. Couldn’t it be trivially extended to any ordered type that implement the range operators?
(Integers is probably the main use case, but still.)

HyperFocusMarshmallow