Tag: Programming

16 minute read

Looking for new projects to sharpen my Rust skills, I came across a Reddit post where someone mentioned CHIP-8. CHIP-8 is an interpreted low-level programming language and virtual machine specification that is very commonly used as a “Hello world!” project of sorts for people to get their feet wet with emulator programming. It is simple enough to be able to implement a fully-featured emulator in a couple of sessions, but it has all the key parts of a real machine, to the point that are many projects that implement CHIP-8 directly in hardware.

I have since implemented my own CHIP-8 emulator in Rust (see repository here) with support for sound, display scaling, configurable colors, and more. But this text is not about it (I’ll write about my implementation in a future post). Today I want to fully describe the CHIP-8 machine, because I had fun implementing it, and I like it so much that I want to have it here for my future reference. In this guide, every instruction is accompanied with a small pseudo-code block to help understand the interpreter’s intended behavior to the more technically inclined reader.

The CHIP-8 specification document I used as reference to implement my version is Cowgod’s Chip-8 technical reference1, and I also had a look at a guide by Tobias V. Langhoff.2

7 minute read

Search functionality in a small website like mine is usually arguably useless. I, for once, never even care to check whether a specific website offers it. I find a post that interests me via a search engine or aggregator, navigate to the page, read the post and then leave. However, I am not against local, serverless indexing and searching, even though most search engines provide site-specific searches. That is why I moved the search function of this website to a local, JavaScript-based implementation. How to do it? Read on.

Gaia Sky 3

Dramatic performance improvements and lots of new features in Gaia Sky 3

10 minute read

It’s been a while since I last talked about new Gaia Sky releases. Today I’m doing a recap of the last four releases, starting with 3.0.0. This very verison came out with Gaia eDR3 on Dec 3, 2020. It was a big jump for Gaia Sky, as it introduced a plethora of new features and QOL improvements along with lots of bug fixes and little tweaks. This post goes over the latest versions from 3.0.0 to 3.0.3, and reflects on what they brought to the table.

Jump to the analysis for each of the versions directly:

Memory Mapped Files in Rust

How to handle memory mapped files in Rust using the memmap crate

8 minute read

In my re-implementation of the Gaia Sky level-of-detail (LOD) catalog generation in Rust I have been able to roughly halve the processing time, and, even though I do not have concrete numbers yet, everything points towards a drastic decrease in memory usage as well. In this project, I need to read a metric ton of gzipped csv Gaia catalog files, parse and process them into a functional in-memory catalog with cartesian positions, velocity vectors, RGB colors, etc. Then I need use them to generate an octree that represents the LOD structure, and finally write another metric ton of binary files back to disk. Using memory mapped files helps a lot in avoiding copies and speeding up the reading and writing operations; that’s something I tried out in the Java version and have come to also re-implement in Rust. Here’s the thing though: working with memory mapped files in Java is super straightforward. In Rust? Not so much. And the lack of available documentation and examples does not help. I was actually unable to find any working snippets with all the parts I needed, so I’m documenting it in this post in case someone else is in the same situation I was.

Website design by myself. See the privacy policy.
Content licensed under CC-BY-NC-SA 4.0 .