home.social

#rustbook — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #rustbook, aggregated by home.social.

fetched live
  1. HashMap в Rust: SwissTable, SIMD по 16 байт за раз и RawTable, который от вас спрятали

    Привет, Хабр! Признавайтесь: вы пользуетесь std::collections::HashMap примерно каждый день и ни разу не задумывались, что под ним. А под ним, если коротко, сидит алгоритм от Google. С Rust 1.36 (это лето 2019-го) стандартный HashMap это порт SwissTable, той самой структуры из абсейловского flat_hash_map . До этого там был Robin Hood hashing, и если вы где-то ещё видите описание std-мапы как «linear probing and Robin Hood bucket stealing», знайте: оно протухло, актуальная документация уже пишет «quadratic probing and SIMD lookup». И вот «SIMD lookup» это самое интересное. Весь фокус скорости SwissTable держится на одном байте служебных данных на элемент, который сканируется по 16 штук за одну инструкцию процессора. В статье глянем, как это устроено внутри, почему ваша мапа по умолчанию устойчива к hash DoS и платит за это скоростью, когда в проде стоит переходить на FxHash, и почему низкоуровневый RawTable существует, но в публичном HashMap его спрятали. Будет много кода и немного ассемблерной романтики .

    habr.com/ru/companies/beget/ar

    #rustm #HashMap #программирование #rustbook

  2. HashMap в Rust: SwissTable, SIMD по 16 байт за раз и RawTable, который от вас спрятали

    Привет, Хабр! Признавайтесь: вы пользуетесь std::collections::HashMap примерно каждый день и ни разу не задумывались, что под ним. А под ним, если коротко, сидит алгоритм от Google. С Rust 1.36 (это лето 2019-го) стандартный HashMap это порт SwissTable, той самой структуры из абсейловского flat_hash_map . До этого там был Robin Hood hashing, и если вы где-то ещё видите описание std-мапы как «linear probing and Robin Hood bucket stealing», знайте: оно протухло, актуальная документация уже пишет «quadratic probing and SIMD lookup». И вот «SIMD lookup» это самое интересное. Весь фокус скорости SwissTable держится на одном байте служебных данных на элемент, который сканируется по 16 штук за одну инструкцию процессора. В статье глянем, как это устроено внутри, почему ваша мапа по умолчанию устойчива к hash DoS и платит за это скоростью, когда в проде стоит переходить на FxHash, и почему низкоуровневый RawTable существует, но в публичном HashMap его спрятали. Будет много кода и немного ассемблерной романтики .

    habr.com/ru/companies/beget/ar

    #rustm #HashMap #программирование #rustbook

  3. HashMap в Rust: SwissTable, SIMD по 16 байт за раз и RawTable, который от вас спрятали

    Привет, Хабр! Признавайтесь: вы пользуетесь std::collections::HashMap примерно каждый день и ни разу не задумывались, что под ним. А под ним, если коротко, сидит алгоритм от Google. С Rust 1.36 (это лето 2019-го) стандартный HashMap это порт SwissTable, той самой структуры из абсейловского flat_hash_map . До этого там был Robin Hood hashing, и если вы где-то ещё видите описание std-мапы как «linear probing and Robin Hood bucket stealing», знайте: оно протухло, актуальная документация уже пишет «quadratic probing and SIMD lookup». И вот «SIMD lookup» это самое интересное. Весь фокус скорости SwissTable держится на одном байте служебных данных на элемент, который сканируется по 16 штук за одну инструкцию процессора. В статье глянем, как это устроено внутри, почему ваша мапа по умолчанию устойчива к hash DoS и платит за это скоростью, когда в проде стоит переходить на FxHash, и почему низкоуровневый RawTable существует, но в публичном HashMap его спрятали. Будет много кода и немного ассемблерной романтики .

    habr.com/ru/companies/beget/ar

    #rustm #HashMap #программирование #rustbook

  4. I'm still just in chapter 4 of the Rust Book but I wanted to practice what I learned so far so I made my first Rust application, a simple dice roller.

    I had to search a bit to use the Clap crate for CLI arg parsing.

    #rust #rustlang #beginner #learning #RustBook

  5. I'm still just in chapter 4 of the Rust Book but I wanted to practice what I learned so far so I made my first Rust application, a simple dice roller.

    I had to search a bit to use the Clap crate for CLI arg parsing.

    #rust #rustlang #beginner #learning #RustBook

  6. I'm still just in chapter 4 of the Rust Book but I wanted to practice what I learned so far so I made my first Rust application, a simple dice roller.

    I had to search a bit to use the Clap crate for CLI arg parsing.

    #rust #rustlang #beginner #learning #RustBook

  7. I'm still just in chapter 4 of the Rust Book but I wanted to practice what I learned so far so I made my first Rust application, a simple dice roller.

    I had to search a bit to use the Clap crate for CLI arg parsing.

    #rust #rustlang #beginner #learning #RustBook

  8. I'm still just in chapter 4 of the Rust Book but I wanted to practice what I learned so far so I made my first Rust application, a simple dice roller.

    I had to search a bit to use the Clap crate for CLI arg parsing.

  9. La version française du #rustbook est juste abandonné ou comment ça se passe ?
    Je demande pour savoir si ça vaut le coup de suivre cette version du Rust-book (ne serait-ce par comfort, par rapport au risque d'obsolescence de certains points)

  10. La version française du #rustbook est juste abandonné ou comment ça se passe ?
    Je demande pour savoir si ça vaut le coup de suivre cette version du Rust-book (ne serait-ce par comfort, par rapport au risque d'obsolescence de certains points)

  11. La version française du #rustbook est juste abandonné ou comment ça se passe ?
    Je demande pour savoir si ça vaut le coup de suivre cette version du Rust-book (ne serait-ce par comfort, par rapport au risque d'obsolescence de certains points)

  12. La version française du #rustbook est juste abandonné ou comment ça se passe ?
    Je demande pour savoir si ça vaut le coup de suivre cette version du Rust-book (ne serait-ce par comfort, par rapport au risque d'obsolescence de certains points)

  13. La version française du #rustbook est juste abandonné ou comment ça se passe ?
    Je demande pour savoir si ça vaut le coup de suivre cette version du Rust-book (ne serait-ce par comfort, par rapport au risque d'obsolescence de certains points)

  14. I wish I'd read the following two articles right after reading the #rustbook.

    They've been written in 2015 and have some outdated bits. But still bring a lot of value to an overall understanding of #rustlang

    The first article covers "two pillars of Rust's design:

    - Memory safety without garbage collection
    - Concurrency without data races"

    blog.rust-lang.org/2015/04/10/

    The second article explores "the third pillar

    - Abstraction without overhead"

    blog.rust-lang.org/2015/05/11/

    #programming

  15. I wish I'd read the following two articles right after reading the .

    They've been written in 2015 and have some outdated bits. But still bring a lot of value to an overall understanding of

    The first article covers "two pillars of Rust's design:

    - Memory safety without garbage collection
    - Concurrency without data races"

    blog.rust-lang.org/2015/04/10/

    The second article explores "the third pillar

    - Abstraction without overhead"

    blog.rust-lang.org/2015/05/11/

  16. I wish I'd read the following two articles right after reading the #rustbook.

    They've been written in 2015 and have some outdated bits. But still bring a lot of value to an overall understanding of #rustlang

    The first article covers "two pillars of Rust's design:

    - Memory safety without garbage collection
    - Concurrency without data races"

    blog.rust-lang.org/2015/04/10/

    The second article explores "the third pillar

    - Abstraction without overhead"

    blog.rust-lang.org/2015/05/11/

    #programming

  17. I wish I'd read the following two articles right after reading the #rustbook.

    They've been written in 2015 and have some outdated bits. But still bring a lot of value to an overall understanding of #rustlang

    The first article covers "two pillars of Rust's design:

    - Memory safety without garbage collection
    - Concurrency without data races"

    blog.rust-lang.org/2015/04/10/

    The second article explores "the third pillar

    - Abstraction without overhead"

    blog.rust-lang.org/2015/05/11/

    #programming

  18. I wish I'd read the following two articles right after reading the #rustbook.

    They've been written in 2015 and have some outdated bits. But still bring a lot of value to an overall understanding of #rustlang

    The first article covers "two pillars of Rust's design:

    - Memory safety without garbage collection
    - Concurrency without data races"

    blog.rust-lang.org/2015/04/10/

    The second article explores "the third pillar

    - Abstraction without overhead"

    blog.rust-lang.org/2015/05/11/

    #programming

  19. @lisyarus
    You probably already know this, but Chapter 4 of the #rustBook discusses ownership.

    doc.rust-lang.org/book/ch04-00

    Not that I'm an expert; I'm only on chapter 8.

    #rust

  20. @lisyarus
    You probably already know this, but Chapter 4 of the #rustBook discusses ownership.

    doc.rust-lang.org/book/ch04-00

    Not that I'm an expert; I'm only on chapter 8.

    #rust

  21. @lisyarus
    You probably already know this, but Chapter 4 of the #rustBook discusses ownership.

    doc.rust-lang.org/book/ch04-00

    Not that I'm an expert; I'm only on chapter 8.

    #rust

  22. @lisyarus
    You probably already know this, but Chapter 4 of the #rustBook discusses ownership.

    doc.rust-lang.org/book/ch04-00

    Not that I'm an expert; I'm only on chapter 8.

    #rust

  23. @wizzwizz4 Well spotted! That's a trivial example from the .

    doc.rust-lang.org/book/ch04-02

    I just wanted to make a joke with that Space Odyssey reference

  24. @codesections Thanks!

    The Rust Programming Language 2018 edition is now on IPFS.

    ipfs.io/ipfs/QmZSNcZ2do5Li6vzL

    (I found all files in ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/share/doc/rust/html/book/2018-edition, I think they were pre-generated)

    #2018

  25. Is there a version of the hosted on ?

    I'd like to read it offline, but the print option is broken (paragraphs don't fit page width and are cut midway) ...

  26. Rust book: What is a String?

    Me: I feel u bro