Rust std study series: Interior mutability

Continuing the standard library study, it's time for Cell<T>! Rust compiler enforces multiple reads access and a single write access mutually exclusive, i.e. either multiple shared references & or one and only one mutable reference & mut. So essentially, Rust prevents the evil of aliasing and mutation between multiple threads. Cell<T> is a sharable mutable … Continue reading Rust std study series: Interior mutability

Rust std study series: LinkedList

Continuing from Rust standard library study series, it's time for LinkedList<T>. Note that implementation are taken from Rust stable v1.33.0. A doubly-linked list with owned nodes. The LinkedList allows pushing and popping elements at either end in constant time. Almost always it is better to use Vec or VecDeque instead of LinkedList. In general, array-based … Continue reading Rust std study series: LinkedList

Variance in Rust: An intuitive explanation

Recently I've made a presentation about subtyping and variance in Rust for our local Vancouver Rust meetup, but I still think intuition was rather lost in the formalism, so here's my shot at explaining it as intuitively as I can. For more succinct definitions, please checkout the presentation or the resources at the end. First, … Continue reading Variance in Rust: An intuitive explanation

NIPS, AI hype and the lost rigor

Warning: This post contains a mixture of excitements, frustrations and rants! Today, Machine Learning/Deep Learning people have been sharing their great excitements over Ali Rahimi's talk at NIPS (from min 57 onwards). Undoubtedly, it's a great talk and you should check it out if you care about fundamental issues and the lost rigor in Deep Learning … Continue reading NIPS, AI hype and the lost rigor