RSSAmplifier

Blog

A Blog (by Gui Andrade)

A blog about random programming topics, usually related to optimization or compilers.

guiand.xyzRSS feed ↗8 posts

Latest posts

Getting my CPF remotely from the US

I never figured out my Brazilian documentation until adulthood. Here's how I finally registered for my CPF.

Bootstrapping Debian onto the PolarFire SoC board

The PolarFire SoC is an affordable, useful, and widely available Linux-capable RISC-V board. Here's how you can run Debian on it.

Tamper-protecting huge amounts of data, just in time

How do you ensure the integrity of vast amounts of data all at once? How can you tell if your evil maid has corrupted your data? Merkle trees hold the answer.

The Most Dangerous Memory

Clang in -O0 can do some dangerous things. It might just overflow your stack!

Compile-time coprocessor codegen, with Rust macros

Rust macros are flexible enough to implement a sort of DSL for assembly. This is useful for building up Direct Memory Access sequences.

Implementing specialization in Rust by matching marker types

Traits are a good way to select code at the type system level. But with some hackeryyou could instead specialize based on a sort of higher-order 'type map'.

Storing unboxed trait objects in Rust

Trait objects generally need to be stored on the heap. But normal heap datastructures like Vec need an additional layer of Box to store trait objects. We can eliminate that.

Hacking around the Rust type-system to provide ergonomic bitfields

Stable Rust with classical macros generally isn't friendly to implementing bitfield structures. But there's a way.