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

Поділитися
Вставка
  • Опубліковано 28 лип 2024
  • 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!
    Article: towardsdatascience.com/nine-r...
  • Наука та технологія

КОМЕНТАРІ • 7

  • @mrpocock
    @mrpocock 6 місяців тому +10

    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.

  • @HyperFocusMarshmallow
    @HyperFocusMarshmallow 6 місяців тому +2

    Great presentation and nice data structure!

  • @budiardjo6610
    @budiardjo6610 6 місяців тому +1

    really nice talk

  • @r2k0ai
    @r2k0ai 6 місяців тому +3

    ♥🦀

  • @HyperFocusMarshmallow
    @HyperFocusMarshmallow 6 місяців тому +3

    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.)

    • @gamekiller0123
      @gamekiller0123 6 місяців тому

      The range expressions aren't operators, so it doesn't make sense to "implement them", they are special syntax for RangeInclusive etc. They also have no bounds. You could probably use something like the nightly Step trait, but it provides very little beyond what he has already and would require nightly.

    • @Turalcar
      @Turalcar 5 місяців тому

      Yes, it's in the docs for the range-set-blaze crate