Processing 3GiB of JSON in the browser in 2 seconds via WebAssembly
2024-06-24 ⋅There was a bit of a buzz recently about Discord analyzing your data to guess your age and gender (an unfortunately rather common practice). You can "easily" view the resulting predictions in your data dump’s analytics files:
{
"user_id": "000000000000000000",
"predicted_gender": "male",
"probability": 0.85245013236999512,
"prob_male": 0.85245013236999512,
"prob_female": 0.066451840102672577,
"prob_non_binary_gender_expansive": 0.081098064780235291,
"model_version": "2023-03-22T00:00:00.000000Z",
"day_pt": "2023-03-29 00:00:00 UTC"
}
Well, okay, "easily" might be a bit of a lie: these analytics files clock in at multiple GiBs large (mine is 3.2GiB) and have millions of events, which can make trying to examine them a bit tricky. This left me thinking about the prospects of a tool that could digest these into pretty charts and lines for your amusement, ideally without taking too long or using too many resources.
After all, how hard can it be to parse 3GiB of JSON anyway?
Introducing Grex: Reactive GTK4 UIs
2022-04-17 ⋅I’ve long been a fan of the GTK GUI library, using it on various personal projects. Despite this, I’ve started to find myself missing a more reactive UI development approach, as seen in modern web frameworks. In these libraries, you don’t mutate your UI; instead, you mutate the state that’s used to build the UI, and the framework updates the UI to match.
A few years ago, I started analyzing the way these frameworks work internally, trying to determine the best way of bringing it to GTK. After various failed ideas, I finally settled on one that I think has the potential to be fully usable: Grex.
Oh, did I mention it has hot reload?
When a glibc update accidentally breaks Chromium's audio
2021-11-15 ⋅A few weeks ago, I merged in a pull request to update the Chromium Flatpak to use runtime version 21.08. I had given it some testing without running into any issues, plus the binary-compiled Chromium variants like Chrome, Brave, and Edge were all already on runtime 21.08, thus it seemed like an easy merge. What could go wrong?
Then, the next morning, I woke up to see a PR filed to revert the change, due to a newly filed issue detailing that the update broke video playback, with some errors about the "audio renderer".
So, it turns out, a lot could go wrong.
How Do Computers Store Audio?
2021-07-25 ⋅Lately I’ve been working with audio formats quite a bit, and the concepts behind the digitizing of sound itself are incredibly fascinating. In this post, we’ll take a whirlwind run through how audio data is saved onto computers and the terminology behind it, as well as a brief overview of various audio codecs.
We Don't Need to Boycott Wayland
2020-10-31 ⋅If you couldn’t tell by the title, this is a response to this gist, stating that we should boycott Wayland because something something Red Hat evil and breakage and…global menus? Well, there were quite a few exaggerations and misrepresentations in the gist, which will be shown and explained here.
VueDart 0.4 released!
2018-10-08 ⋅After almost a year, I'm happy to finally be able to announce VueDart 0.4! It's got Dart 2.0 support, a ton of great changes, a new website , and more. This is definitely a much bigger release than even 0.3 was!
Getting rid of version warnings: an experiment at hacking the Linux/glibc dynamic linker to shut up
2018-01-02 ⋅If you use a non-Debian/Ubuntu distro (I recently switched to Arch), you've probably had a moment where you downloaded some binaries and tried running them, only to get an error like this:
$ lldb-argdumper -h
usr/bin/lldb-argdumper: /usr/lib/libtinfo.so.5: no version information available (required by usr/bin/lldb-argdumper)
usr/bin/lldb-argdumper: /usr/lib/libtinfo.so.5: no version information available (required by /tmp/tmp.8oiyW382Pu/usr/bin/../lib/liblldb.so.4)
usr/bin/lldb-argdumper: /usr/lib/libtinfo.so.5: no version information available (required by /tmp/tmp.8oiyW382Pu/usr/bin/../lib/liblldb.so.4)
usr/bin/lldb-argdumper: /usr/lib/libpanel.so.5: no version information available (required by /tmp/tmp.8oiyW382Pu/usr/bin/../lib/liblldb.so.4)
Ugh. Normally these warnings are nothing more than an annoyance. However, recently I started trying to get Swift working on my new Arch install. With Swift, the warnings suddenly turned much more lethal: some part of swift package build
assumes that, if one of the commands outputs anything (including these warnings), it has failed, and the build will be aborted.
Obviously, I couldn't stand for this. I mean, how hard could this be to fix?
(Spoiler alert: if you want to cut to the chase, I created a tool called qldv that does everything listed below already.)
VueDart 0.3 released! Featuring scoped styles, mixins, a CLI, and more!
2017-11-19 ⋅After a few months of quiet, I'm super proud to announce VueDart 0.3! Unlike 0.2 (which should've been a minor release, except I wasn't thinking clearly), 0.3 brings an enormous amount of new features, bugfixes, and more.
Going from Polymer to Vue, from JavaScript to Dart
2017-10-10 ⋅Remember the post a while back where I rewrote my website in Polymer? Yeah?
Well, I rewrote it. Again.
When replacing a hard drive turns into a fried motherboard, a VM mess, and a slow USB stick
2017-05-26 ⋅Have you ever tried to do something simple, like changing a lightbulb, but in the end you end up rewiring your house, the neighbor's house, and the governer's ice box? Yeah, that's how I felt. It all started with...
Moving from Nikola to...Polymer!?
2016-05-29 ⋅EDIT: Yup, I rewrote it again. More info here.
We've all done those things before. You know it's a horrible idea, but it just sounds so cool that you can't resist.
Well, that's why I decided to move away from Nikola (which is awesome BTW) and roll a home-made website using Polymer and the paper components.
An idea for concise, checked error handling in imperative languages
2016-03-20 ⋅Yes, the post title sucks. However, I can't think of anything better...
This is an idea I've had for a while on an error handling model that tries to combine safe, checked code with the conciseness of unchecked exceptions. It's somewhat of a "rough draft", so to speak, and the syntax I'm using is just an example.
A tour of the Howl programming text editor
2016-03-20 ⋅Check it out on YouTube or right here:
Implementing a (sort of) generic, (sort of) type-safe array in C
2015-11-28 ⋅I've been using C for a project I've been working on, and one thing I find annoying are manually-managed arrays. Ever since watching Bjarne Stroustrup's talk on linked lists , I try to avoid using those as much as possible. Therefore, I prefer using a container roughly equivalent to C++'s vector.
The obvious thing to do here would be to use something like glib's GArray type or qlibc's qvector type . However, both APIs require using sizeof
and are completely not-type-safe; it's easy to add a char to an array/vector of ints. This made me wonder: is it possible to implement a type-safe, generic array type in C?
Now, I mean the C version of type-safe, which basically means that your compiler has to show either a warning or an error (probably if compiling with -Werror
) when you try to append the wrong type to an array.
Programming Decisions
2015-06-19 ⋅DISCLAIMER: This is a satirical post. If your name is mentioned in a diminishing way, don't be insulted; I insult myself a few times throughout the post. Also, I like some of the projects I made fun of, including C++, JavaScript, Kotlin, Nim, Fbuild, and plenty of others. Again, this is satirical.
A farmer couldn't figure out how to maintain his web servers, so he gave it to his animals. However, they simply couldn't agree on what tools to use.
The Magic of RPython
2015-05-29 ⋅RPython is a really nice translation framework that converts a (very) restricted subset of Python 2 to C code. Better yet, RPython will generate JITs for your interpreters. Although there are very good articles on how to write interpreters with RPython, I don't often find anything that describes the language itself. My goal with this post is to do just that: describe RPython itself. I'm going to leave out the things about the JITs; the RPython FAQ links to a good tutorial about that.
The top 5 programming languages you've never heard of (part 2)
2015-03-08 ⋅Yesterday, I wrote a post about the top 5 programming languages you've never heard of . Well, since it was kind of short (I didn't have too much time to write), I'm going to put a little more info here.
The top 5 programming languages you've never heard of
2015-03-07 ⋅Lately, there's been a large surge in new programming languages as projects such as Rust have been taking the spotlight and showing lots of promise. However, there are some programming languages few have heard of that deserve to be more popular. Here's a brief listing of some of my favorite languages that aren't common sights.
Using AppVeyor to distribute Python wheels
2014-09-21 ⋅Wheels are the future of distribution. No more messy broken setup.py scripts or need for a compiler to build C extensions! Of course, this has a glaring issue: a Linux user can't build Wheels of their C extension for Windows. Unless, of course, you use Travis CI , install the MinGW compilers, define the compiler variables, etc. However, there is an easier way: AppVeyor .
Overloading functions with the C preprocessor
2014-09-15 ⋅Let's have an imaginary scenario: you're trying to make a library that has a special function, myfunc
. Now, this functions needs to have two possible ways to invoke it. One way takes one int parameter, the other takes two. Here's how you might do that in C++:
Welcome!
2014-09-10 ⋅First post!
This website is my first ever web page. It's written using the excellent Nikola and reStructuredText. ( EDIT: Well now it's completely different. It uses Polymer; see this post .) ( EDIT 2: Aaaand I changed it again. It's now written using Vue.) The majority of its content is going to revolve around programming: tutorials, experiments, and lots and lots of rants. :)
Have fun browsing!