Top all-time · #910
Andrew Beinges
Personal blog · cglab.caprogrammingsystems
Andrew Beinges writes Computational Geometry Lab - Index, a personal blog at cglab.ca about programming and systems. Since 2014, 75 different Hacker News readers have linked it 102 times, most often “Learning Rust with Entirely Too Many Linked Lists”. No feed was found, so read it on the site itself.
Most-linked posts?
- Learning Rust with Entirely Too Many Linked Lists25 people · 36 mentions · first linked 2015-07-25
- Pre-Pooping Your Pants with Rust (2015)7 people · 7 mentions · first linked 2022-12-01
- Rust Collections Case Study: BTreeMap (2015)6 people · 6 mentions · first linked 2015-01-06
- Learning Rust with Entirely Too Many Linked Lists5 people · 6 mentions · first linked 2015-07-25
- Pre-Pooping Your Pants with Rust3 people · 5 mentions · first linked 2015-04-27
- Building a HashMap in Rust – Part 1: What's a HashMap?3 people · 3 mentions · first linked 2015-01-15
- Rust Collections Case Study: BTreeMap3 people · 3 mentions · first linked 2021-01-28
- /~abeinges/blah/hash-rs/3 people · 3 mentions · first linked 2015-11-21
- The Many Kinds of Code Reuse in Rust2 people · 2 mentions · first linked 2016-02-15
- Memory Layouts for Binary Search2 people · 2 mentions · first linked 2015-05-08
What Hacker News says?
Yes, you can read a bit about collections and how phantom types are used in them http://cglab.ca/~abeinges/blah/rust-btree-case/
Comment linking /~abeinges/blah/rust-btree-case/
on “Announcing Rust 1.0 Alpha”Submitted Rust, Generics, and Collections as a story · 187 points
HN discussionI have heard this is a really good resource for understanding this exact aspect of Rust http://cglab.ca/~abeinges/blah/too-many-lists/book/
Comment linking /~abeinges/blah/too-many-lists/book/
on “Go 2, here we come”Submitted Pre-Pooping Your Pants with Rust as a story · 129 points
HN discussionRust implements affine types, which means every object must be used at most once. You cannot use them twice, but you can discard them and not do anything with them. Linear types means exactly once . but I don't think you can easily move from affine types to linear types in the case of Rust, see leakpocalypse[1] [1]: https://cglab.ca/~abeinges/blah/everyone-poops/#leakpocalyps...
Comment linking /~abeinges/blah/everyone-poops/
on “Why asynchronous Rust doesn't work”Submitted Memory Layouts for Binary Search as a story · 113 points
HN discussionLinked data structures in Rust get complicated, though. See the "Too many lists" book.[1] Doubly linked lists, or trees with backlinks, are especially difficult. Either you have to use refcounts, or the forward pointer and backward pointer need to be updated as an unsafe unit operation. There might be an elegant way to do this with swapping, but I'm not sure yet. [1] http://cglab.ca/~abeinges/blah/too-many-lists/boo…
Comment linking /~abeinges/blah/too-many-lists/book/
on “Rust and the Future of Systems Programming [video]”Submitted Rust, Lifetimes, and Collections as a story · 99 points
HN discussionIf I can't code some data stuctures in a language I don't feel like I know it, so I would like something like this too. The closest I found was the 'too many linked lists' book, which I learned a lot from. http://cglab.ca/~abeinges/blah/too-many-lists/book/
Comment linking /~abeinges/blah/too-many-lists/book/
on “Announcing Rust 1.20”Submitted Unsafe Rust: An Intro and Open Questions as a story · 86 points
HN discussionHave you read "Learning Rust With Entirely Too Many Linked Lists"[1]? I think it will be quite helpful for these kind of situations. It walks you through all the possible tools in the language that is available to you, and at the end, if you just want to write it how you would in C, you could always do it "unsafely" with raw pointers (which is no worse than C). --- [1] http://cglab.ca/~abeinges/blah/too-many-lists/b…
Comment linking /~abeinges/blah/too-many-lists/book/
on “Announcing Rust 1.20”Submitted Memory Layouts for Binary Search – V2 as a story · 83 points
HN discussionLooking over the second part of the MIT course, I see that a lot of the same material is covered in this free textbook. http://cglab.ca/~michiel/DiscreteStructures/
Comment linking /~michiel/DiscreteStructures/
on “Mathematics for Computer Science”Submitted Rust Collections Case Study: BTreeMap (2015) as a story · 62 points
HN discussionNot sure if there was nothing post-1.0, but this[0] particular mess was just before the 1.0 release and, at the time, caused a fair bit of chaos. 0. http://cglab.ca/~abeinges/blah/everyone-poops/
Comment linking /~abeinges/blah/everyone-poops/
on “Rust 1.34.0”Submitted Learning Rust with Entirely Too Many Linked Lists as a story · 56 points
HN discussionHave you read this one yet? http://cglab.ca/~abeinges/blah/too-many-lists/book/ It touches on the issues you are implying.
Comment linking /~abeinges/blah/too-many-lists/book/
on “Next Iteration of “The Rust Programming Language” Book”Submitted Learning Rust with Entirely Too Many Linked Lists as a story · 25 points
HN discussionI came across this last night ( http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performa... ) and went down the rabbit hole of Rust and its BTreeSet ( http://cglab.ca/~abeinges/blah/rust-btree-case/ ). They came to a very similar conclusion. It all makes me wonder if there's low hanging fruit in a lot of languages/libraries to simply swap out red black trees for B-trees (though I'm guessing the higher constant t…
Comment linking /~abeinges/blah/rust-btree-case/
on “Use perfect hashing, instead of binary search, for keyword lookup”Submitted Learning Rust with Entirely Too Many Linked Lists as a story · 13 points
HN discussionFurther to the parent, though it moves away from C++, Pat also teaches an advanced data structures course for which the notes and assignments are available: http://cglab.ca/~morin/teaching/5408/ https://github.com/patmorin/tds
Comment linking /~morin/teaching/5408/
on “Master C++ Programming with Open-Source Books”Submitted Rust Collections Case Study: BTreeMap as a story · 9 points
HN discussionThe borrow checker tracks two kinds of borrows (in addition to ownership), &T for a constant reference and &mut T for a mutable reference. But it's not really about constant/mutable, it's really about shared/unique or, if you prefer, reader/writer. Essentially the borrow checker is a compile-time reader-writer lock: multiple threads or multiple structures can have a read borrow at once, but only one can have a write…
Comment linking /~abeinges/blah/too-many-lists/book/README.html
on “Lock-Free Rust: Crossbeam in 2019”Submitted Learning Rust with Entirely Too Many Linked Lists as a story · 6 points
HN discussionThank you. But it seems not finished? I am trying to implement some basic data structures and algorithms in Rust, but the compiler nearly kills me. Is there any data structure & algorithms implementation tutorials for Rust newbies, like Learning_ Rust_With_Entirely_Too_Many_Linked_Lists[1]? [1]: http://cglab.ca/~abeinges/blah/too-many-lists/book/README.ht...
Comment linking /~abeinges/blah/too-many-lists/book/README.html
on “Show HN: Algorithm Cookbook in Rust”Submitted Discrete Structures for Computer Science: Counting, Recursion, and Probability as a story · 6 points
HN discussionI've literally never heard of Vhash, and I see no references to it outside of the 2007 paper. As far as I know, the state of the art for "fast and secure" is still SipHash 2-4 or 2-3. While SipHash perf is generally quite good, it's still not as fast as Fnv on small inputs or XxHash on large inputs. As in, 4x slower [0]. FarmHash has great perf if you can invoke it in the way it wants, but doesn't do well in a strea…
Comment linking /~abeinges/blah/hash-rs/
on “Math.random in V8 is broken”Submitted Building a HashMap in Rust – Part 1: What's a HashMap? as a story · 6 points
HN discussionSee "Learning Rust with Entirely Too Many Linked Lists" http://cglab.ca/~abeinges/blah/too-many-lists/book/
Comment linking /~abeinges/blah/too-many-lists/book/
on “What Rust Can Do That Other Languages Can't”Submitted Learning Rust with Entirely Too Many Linked Lists as a story · 5 points
HN discussion