Bennett Hardwick

3 pages tagged with "rust"

Don't use boxed trait objects for struct internals

December 24, 2019 - 1279 words - 7 mins
When writing a struct with the intention of it being reused, it’s important not to use boxed trait objects to represent interior data. Namely, this is because turning an object into a Box<dyn Trait> loses a lot of type information about the object which is difficult to get back should the developer consuming your struct need it. Read More…

Writing safe, efficient and parallel Node.js extensions with Rust, Neon and Rayon

November 26, 2019 - 1197 words - 6 mins
When writing server applications with Node.js, sometimes JavaScript just doesn’t cut it and you need to employ native code. This could be because of a few different reasons: You need to complete a CPU-bound task Because JavaScript runs inside a VM, every operation will take longer than the native equivalent. Read More…

How to complete the Advent of Code 2018 challenges with Rust

December 07, 2018 - 1011 words - 5 mins
Over the past month or so I’ve been learning the Rust programming language. When I heard that Advent of Code was starting up again, I figured it would be a great opportunity to put some of the skills I’d learned to the test. Read More…