Experimenting with and Abandoning a Terminal UI Library

2025-09-04
Experimenting with and Abandoning a Terminal UI Library

While developing the game Kartoffels, the author attempted to create a high-performance terminal UI library, Kruci, to replace the existing Ratatui library. Kruci uses a declarative UI design and attempts to improve performance by avoiding pixel-by-pixel diffing calculations. However, Kruci encountered many challenges in handling events, state management, and Z-stacking. Ultimately, the author decided to abandon the project, concluding that optimizing Ratatui or focusing on game development would be more efficient.

Read more
(pwy.io)
Development

Taming iCalendar Recurring Events with Distance Functions

2025-04-17
Taming iCalendar Recurring Events with Distance Functions

The author encountered a challenge in handling recurring events while implementing a library for processing iCalendar files. iCalendar uses complex rules to define recurring events, and traditional implementations typically involve writing a lot of specific logic for different frequencies and parameters. The author took a different approach, viewing recurrence rules as SQL queries and borrowing ideas from signed distance functions (SDFs) in computer graphics, representing event occurrences using distance functions. This method decomposes complex rules into simple distance functions, iteratively calculating event occurrence times to avoid numerous conditional judgments, resulting in cleaner and easier-to-maintain code. Although the initial implementation wasn't very efficient, the author optimized it to handle complex recurrence rules in milliseconds.

Read more
(pwy.io)

Kartoffels v0.7 Released: Cave Generation Overhaul and RISC-V Switch

2025-02-17
Kartoffels v0.7 Released: Cave Generation Overhaul and RISC-V Switch

Kartoffels is a game where you program firmware for a virtual potato. Version 0.7, boasting 122 commits, introduces significant improvements. Cave generation now uses cellular automata and white noise for more realistic results, solving previous issues with overly isolated caves. The game engine's CPU architecture has shifted from 64-bit RISC-V to 32-bit for better memory management. A new feature tracks each bot's history, paving the way for leaderboards. UI improvements and game mechanic tweaks are also included. Note that this update reset the server, clearing all uploaded bot programs.

Read more
(pwy.io)
Game