Tinkering
Come for the Foo, stay for the Bar
-
Polsim - a case study for small-scale scientific computing in Rust
As part of my research I found an excuse to use Rust.
polsim
is a commandn line utility for simulating the polarization of a laser beam as it interacts with a sequence of optical elements. In this post I'll describepolsim
itself and my experience using Rust to write it rather than Python. -
Bringing macros to Python by abusing type annotations
By playing with the Python AST we can add functionality with making the user write any extra code. You may use this power for good or evil.
-
Using Python's asyncio with serial devices
After learning about async/await in Python I wondered how I could apply it to software in my lab. Much of that involves talking to equipment via serial ports. Libraries for talking to serial ports exist, but I found the documentation for doing so via async/await sparse. Here's an example of how to use PySerial asynchronously.
-
Introduction to Procedural Macros in Rust
One of the really nice things about Rust is its macro system. It makes it really easy to generate boilerplate code that would otherwise be really tedious to write by hand. In this post you'll learn how to write your own macros that will put Nicolas Cage quotes in the error messages generated by your IDE.