2021s

Perfecting GLFW for Zig, and finding lurking undefined behavior that went unnoticed for 6+ years

Today, I am announcing mach-glfw: Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more. Building Mach for everyone If Mach engine only benefits people interested in using that engine, and not the broader Zig (and even gamedev) community I would consider that a total failure. Whether you’re interested in using all of Mach, just some of it with your own engine / project, or just the tools/ideas we develop in the future (with Unity, Unreal, etc.

Mach Engine: The future of graphics (with Zig)

In the coming months, we’ll begin to have truly cross-platform low-level graphics, with the ability to cross compile GPU-accelerated applications written in Zig from any OS and deploy to desktop, mobile, and (in the future) web. Mach engine I’ve been working on Mach Engine for about 4 months now, although it as a project is many years in the making, and I believe in the next 4-6 months we’ll have completion of the first key milestone: truly cross platform graphics and seamless cross compilation.

Unicode data file compression: achieving 40-70% reduction over gzip alone

A little story about how writing a domain-specific compression algorithm in a few days can sometimes yield big benefits, why it’s sometimes worth giving it a shot, and how to tell when you should try. Note: this is about Unicode spec data files, not general purpose text compression. Background Problem Investigation Binary encoding? Differential encoding/compression? Go implementation Zig implementation Differential encoding state machine A stream of op codes Iteratively finding the most lucrative opcodes A stream of opcodes for a state machine: a natural progression from a binary format?

Unicode sorting is hard & why browsers added special emoji matching to regexp

As I work on Zorex, an omnipotent regexp engine I have stumbled into a world of tales about why Unicode text sorting is so annoying in the modern day. Let’s talk about that. Why ASCII sorting is not enough Twitter’s emoji problem - or when Unicode locale-aware sorting Really Matters™ Browsers added special emoji matching to regexp Language comparison JavaScript Collator sorting is not guaranteed across browsers Go sort.

My game development journey & why I'm increasing my contribution to Zig to $200/mo

Today, I increased my monthly donation to Zig to $200 a month. Before Zig, I have not contributed financially to any open source project. Before I can explain why I am so extremely excited about the Zig programming language and its community, I need to explain where I come from. I grew up playing Linux games like Mania Drive It wasn’t long before I found that the Mania Drive game engine was open-source.

Zig, Parser Combinators - and Why They're Awesome

In this article we will be exploring what parser combinators are, what runtime parser generation is - why they’re useful, and then walking through a Zig implementation of them. What are parser combinators? Why are parser combinators useful? Going deeper: runtime parser generation A note about traditional regex engines Implementing the Parser interface Compile-time vs. run-time The parser interface Zig generics are provided via type parameters Zig runtime interfaces Type parameters Errors the Parser interface can produce Our first Parser What actually is a “Reader”?

Postgres regex search over 10,000 GitHub repositories (using only a Macbook)

In this article, we share empirical measurements from our experiments in using Postgres to index and search over 10,000 top GitHub repositories using pg_trgm on only a Macbook. This is a follow up to “Postgres Trigram search learnings”, in which we shared several learnings and beliefs about trying to use Postgres Trigram indexes as an alterative to Google’s Zoekt (“Fast trigram based code search”). We share our results, as well as the exact steps we performed, scripts, and lists of the top 20,000 repositories by stars/language on GitHub so you can reproduce the results yourself should you desire.

Postgres Trigram search learnings

In this article I talk about learnings I have from trying to use pg_trgm as the backend for a search engine, Tridex, which aims to be a competitor to Google’s Zoekt (“Fast trigram based code search”) Background I work @ Sourcegraph, which provides code search, code intelligence, and other developer tooling. (If you’re one of my Sourcegraph co-workers, hey! Hexops is the name of my GitHub organization for after-hours experiments and what I hope will one day in the distant future become a successful game development company.