I've suffered from perfectionism throughout my life. It's been mostly negative. I've learned to embrace imperfections. Setting perfection as a theoretical bound and not more, could be a good thing but should be aware of many of its sharp edges. With infinite time everything will be perfect Everyone is capable of producing perfection if given … Continue reading Dunking Thoughts: Perfection and Time
Category: Rust
Announcement 📢 Releasing dlpackrs
DLPack is the standard in-memory data format that facilitates zero-cost tensor transfer across major Deep Learning frameworks (PyTorch, TensorFlow and TVM) and the supported Python Array processing frameworks such as Numpy, CuPy. The dlpackrs provides a safe idiomatic Rust binding where Rust ndarray and tensor frameworks can use it to gain the same kind of … Continue reading Announcement 📢 Releasing dlpackrs
Announcement 📢 Releasing smartalloc
If you happen to write unsafe code in Rust where normal static checks are not available and want better UX for detecting memory issues along side using various sanitizers, checkout my new crate smartalloc which provides idiomatic Rust binding for the original C version here. Beside the reason in README, note that MIRI can't be … Continue reading Announcement 📢 Releasing smartalloc
Collaboration era: C/C++ “+” Rust
Previously, I wrote a post about C/C++ vs. Rust. Despite all the goodies and features in Rust, when it comes to my line of work and interest i.e. ML/DL and Systems, Rust hasn't been able to deliver what I hoped it would. There's just too much work being done at the language level itself and … Continue reading Collaboration era: C/C++ “+” Rust
Announcement 📢 Create your own programming language with Rust
After almost a year from my last blog post, in this short post I'm very happy to announce that I'm writing a free online book where early chapters are available now. I've explained my motivations and goals in the introduction. The accompanying codes are also available on my GitHub. Feedbacks are welcome and happy learning. … Continue reading Announcement 📢 Create your own programming language with Rust
Rust std study series: Pin
This time we dive into std::pin which has a dense documentation. Types that pin data to its location in memory. It is sometimes useful to have objects that are guaranteed to not move, in the sense that their placement in memory does not change, and can thus be relied upon. A prime example of such … Continue reading Rust std study series: Pin
C/C++ vs. Rust
The previous write up seemed to be not sufficient, so I decided to only make this post about resource gathering of articles/talks about C/C++ fundamental issue and Rust and make it easier to follow. Microsoft Security Response Center.C/C++ are impossible to get right.Undefined Behavior pits falls in C abstract machine by John Regehr series of … Continue reading C/C++ vs. Rust
Rust std study series: alloc
Let's get deep into std::alloc! Memory allocator 101 The very basic need for any program to compile and execute is having access to either physical memory or virtual memory. An allocator is responsible for providing such an access. You can think of an allocator as a service, taking some sort of requests and either giving … Continue reading Rust std study series: alloc
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
The State of Machine Learning in Rust
Every once in a while this topic comes up on a social media or Rust user channel. I'd like to describe briefly the way I see where things are going by a little bit of history as well as some information about existing flux of Machine Learning/Deep Learning frameworks and major recent trends. Brief history … Continue reading The State of Machine Learning in Rust
Rust std study series: VecDeque
Continuing from Rust standard library study series, it's time for VecDeque<T>. Because of its similarity to Vec, there isn't much to say. A double-ended queue implemented with a growable ring buffer. The "default" usage of this type as a queue is to use push_back to add to the queue, and pop_front to remove from the … Continue reading Rust std study series: VecDeque
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
Rust std study series: Vec
The upcoming series of blog posts will contain my study of Rust standard library. I've partially written some parts of the series in scattered places and want to gather them in one place for better and easier access. I intend to update whenever I discover something interesting/important to remember. I'm referring to implementations in Rust … Continue reading Rust std study series: Vec
Learn Rust through linalg
This series of posts is going to be a non-traditional intro to Rustlang, so buckle up! I will give more details when necessary. Codes are available in my github. Basic linear algebra such as vector inner product and General Matrix-Matrix (GEMM) product are at the heart of computer science so why not learning Rust by … Continue reading Learn Rust through linalg