Approximating sin(2πx)

Tue, Nov 05 2024
22 minutes read

I use trigonometric functions extremely often, ever since I started doing programming. They show up everywhere, especially in graphics, and while they’re not the most efficient operation, they are widely available in programming languages. This is not the case if you’re programming in embedded systems or WebAssembly, so I tried to compute them myself.

Read more

Introduction to freestanding WebAssembly

Mon, Oct 21 2024
12 minutes read

I’ve been using WebAssembly (WASM) for quite a while, and the learning resources are sparse and incomplete. This is especially true for freestanding WASM, or using WASM directly without using tools that make interacting with the web easier. This is an attempt for me to reflect on what I discovered and hopefully introduce more people to this weird intersection of system programming and web development.

Read more

I switched to Fish as my interactive shell

Tue, Oct 01 2024
4 minutes read

ZSH has been my shell of choice since I started my command-line-centric workflow. It’s a popular shell with a large community and an unprecedented level of customizability. ZSH is also POSIX-compliant, which was very important to me for some reason. However, after some reconsideration, I decided to port my config to the Fish shell, and this is why.

Read more

My personal strategies for arena allocation

Thu, Jun 20 2024
8 minutes read

A drawback that people often mention when programming in C is the lack of RAII. This is sometimes good as it causes me to avoid small, random allocations and incentivize grouping data into large, contiguous memory regions to make them faster and more manageable. However, small, random allocations are sometimes unavoidable, and there should still be a way to manage them. Instead of grouping data into arrays, we can instead group data by their lifetime, and this is where the “arena” allocator comes in.

Read more

A game I made as a course project

Tue, May 28 2024
10 minutes read

I recently programmed a large chunk of the game from scratch for a university course project. This is one of a few projects that I delivered with enough quality and presentability. So I wanted to document my process of making it, what I learned, and how I applied my knowledge from and outside the course.

Read more

Easy, efficient, and practical queue implementation

Sat, Feb 24 2024
8 minutes read

From breadth-first search to task scheduling, queues are extremely useful in computer programming. Although many programming languages support them, I think that it’s important to understand and know how to implement them. I like to implement data structures on-the-fly and customize them for the problem I’m trying to solve. A more practical reason to understand queues is that JavaScript doesn’t have an efficient queue implementation.

Read more

A faster, more flexible alternative to run-time polymorphism in C++ feat. Rust

Sun, Feb 11 2024
12 minutes read

When I first heard about run-time polymorphism in C++ using virtual methods, my first thoughts were like, “This is cool and all, but why would I ever use this?” Then I continued to ignore it because I could always just work around it instead of using it. Until recently, my college lecturer told me that using virtual methods is great for designing and maintaining applications with thousands of objects. I figured that I should write about what run-time polymorphism is, and why I still think that I don’t need it.

Read more

Rewriting my website and starting a blog

Fri, Feb 09 2024
6 minutes read

I already have a website hosted on GitHub pages. It was built around 2 years ago as a way to quickly browse and access my web projects. Basically, it was just a grid of project thumbnails, which is pretty boring. During the last 2 years, I changed bits and pieces of it, but it’s still the same boring layout with only a list of projects and some basic information.

Read more