Blogs
  • Oct, 2019
  • The builder pattern, and a macro that keeps FFI code DRY

    Our ping API is simple, but it’s also very limited:

    pub fn ping(dest: ipv4::Addr) -> Result<(), String>
    
    // called as:
    ping(ipv4::Addr([8, 8, 8, 8])).unwrap();
    

    It doesn’t allow specifying the TTL (time to live) of packets, it doesn’t allow...

    Read more
  • A simple ping library, parsing strings into IPv4 address

    We’ve just spent a lot of time abstracting over LoadLibrary, but we still have all the gory details of the Win32 ICMP API straight in our main.rs file! That won’t do.

    This time will be much quicker, since we already learned about carefully designing an API, hiding...

    Read more
  • Designing and implementing a safer API on top of LoadLibrary

    It’s refactor time!

    Our complete program is now about a hundred lines, counting blank lines (see the end of part 3 for a complete listing).

    While this is pretty good for a zero-dependency project (save for pretty-hex), we can do better.

    First off, concerns are mixed...

    Read more
  • Sep, 2019
  • FFI-safe types in Rust, newtypes, MaybeUninit, and references vs pointers

    It’s time to make sup, our own take on ping, use the Win32 APIs to send an ICMP echo. Earlier we discovered that Windows’s ping.exe used IcmpSendEcho2Ex. But for our purposes, the simpler IcmpSendEcho will do just fine.

    As we mentioned earlier, it’s provided...

    Read more
  • Windows dynamic libraries, calling conventions, and transmute

    So, how does ping.exe actually send a ping? It seems unrealistic that ping.exe itself implements all the protocols involved in sending a ping. So it must be calling some sort of library. Also, since it ends up talking to the outside world via a NIC (network interface...

    Read more
  • A short (and mostly wrong) history of computer networking

    When I launched my Patreon, I vowed to explain how computers work. But in 2019, computers rarely work in isolation. So let’s take the time to write a few articles about how computers talk to each other.

    The history of network protocols and standards is long and...

    Read more
  • Declarative memory management

    It feels like an eternity since I’ve started using Rust, and yet I remember vividly what it felt like to bang my head against the borrow checker for the first few times.

    I’m definitely not alone in that, and there’s been quite a few articles on the subject!...

    Read more
  • Aug, 2019
  • Reading files the hard way - Part 3 (ftrace, disk layouts, ext4)

    So far, we’ve seen many ways to read a file from different programming languages, we’ve learned about syscalls, how to make those from assembly, then we’ve learned about memory mapping, virtual address spaces, and generally some of the mechanisms in which...

    Read more
  • Reading files the hard way - Part 2 (x86 asm, linux kernel)

    Looking at that latest mental model, it’s.. a bit suspicious that every program ends up calling the same set of functions. It’s almost like something different happens when calling those.

    Are those even regular functions? Can we step through them with a debugger?...

    Read more
  • Reading files the hard way - Part 1 (node.js, C, rust, strace)

    Everybody knows how to use files. You just open up File Explorer, the Finder, or a File Manager, and bam - it’s chock-full of files. There’s folders and files as far as the eye can see. It’s a genuine filapalooza. I have never once heard someone complain there...

    Read more
  • Huffman 101

    Let’s play a game: your objective is to guess a word, but you can only ask yes or no questions. You should also aim to ask as few questions as possible.

    You might have played a variant of this game before, guessing famous actors or musicians. You’d usually ask...

    Read more
  • And now for a bit of an announcement

    Hey all, thanks for checking in!

    After much soul searching, I have arrived to the following conclusion:

    • Teaching folks about stuff is my jam.

    I’ve been writing multiple articles that sort of read like course material, if there was no dress code, maybe?

    In 2013, I...

    Read more
  • Jul, 2019
  • Rust modules vs files

    A while back, I asked on Twitter what people found confusing in Rust, and one of the top topics was “how the module system maps to files”.

    I remember struggling with that a lot when I first started Rust, so I’ll try to explain it in a way that makes sense to...

    Read more
  • May, 2019
  • Celebrating Mario Maker

    I’ve been watching a lot of Super Mario Maker videos this past month. Probably a hundred hours! This game is like a world onto itself, and it was fascinating to learn its design language and patterns.

    With Super Mario Maker 2 coming out soon, I thought I’d show off...

    Read more
  • Rust generics vs Java generics

    In my previous article, I said I needed to stop thinking of Rust generics as Java generics, because in Rust, generic types are erased.

    Someone gently pointed out that they are also erased in Java, the difference was elsewhere. And so, let’s learn the difference together....

    Read more
  • Recursive iterators in Rust

    I’ve been looking for this blog post everywhere, but it doesn’t exist, so I guess it’s my turn to write about Some Fun with Rust.

    The task at hand

    Let’s say you have a recursive, acyclic data structure, like so:

    struct Node {
        values:...
    Read more
  • Apr, 2019
  • Ludum Dare 44 post-mortem

    So, I tried doing Ludum Dare 44, and I gave up on it, and I feel like absolute crap so I’m going to attempt to write these feelings away in a celebratory post-mortem “I failed!” post.

    In typical me fashion, this post is going to be a jolly mix of a lot of...

    Read more
  • Dec, 2018
  • 2018 Retrospective

    The year is drawing to a close, and I’m going off on a much-needed holiday next week. This seems like a good time to look back at the past twelve months!

    I can’t believe that shipped

    2018 was the year of foundational work. As far as “work work” is...

    Read more
  • Sep, 2018
  • Testing — itch v25 postmortem, part 3

    We’ve just taken a look at the development for v25 of the itch app, so it’s time to take a look at some testing infrastructure.

    Unit tests

    When I started working on the app, I was happy to get anything running at all. But it became clear pretty quickly that...

    Read more
  • Development environment — itch v25 postmortem, part 2

    One of my goals with the v25 release was to make it much easier to develop, test, and distribute the app.

    Base tools

    I typically develop the itch app under Windows 10 or a Debian-based Linux.

    The set-up is mostly the same for both OSes. You’ve got your standard unix...

    Read more
  • A bit of perspective — itch v25 postmortem, part 1

    It’s a bit daunting to write a postmortem for the v25 release of the itch.io desktop app.

    In part because, it being mostly a reliability/performance update, it’s not press-friendly. But also, because there’s so much to share!

    Before I jump into specific...

    Read more
  • Prelude — itch v25 postmortem, part 0

    Back in August of 2017, I started writing an article about my work on the itch.io app. I quickly realized one article would not cut it.

    So I wrote a second. And a third. And a fourth. In August of 2017, I was pretty sure I was nearly done with the work. It looked “pretty...

    Read more
  • Jul, 2018
  • Remembering the departed

    In April of 2012, I wrote a few paragraphs about suicide.

    I still get regular e-mails about it, from folks who are currently struggling. They often ask if I’ve written anything else about the subject. They often thank me for writing it, or say it helped them in some way....

    Read more
  • Jan, 2017
  • Efficient game updates

    A little while ago, I wrote an article on things that can go wrong when downloading, it listed a series of reasons, from network problems to invalid content to imperfect hardware that may occur when initially installing a game.

    This article discusses what methods we can use to...

    Read more
  • Things that can go wrong when downloading

    When I get a little bit too emotional about my current baby, the itch.io app, there’s always a timely support ticket reminding me that it is currently, still a glorified game downloader.

    However true that is, that doesn’t mean it’s easy! In the past year,...

    Read more
  • Oct, 2016
  • itch.io app timeline 2016

    I’ve been working on the itch.io desktop app for about a year now, so I thought I’d make a quick recap:

    At the time of this writing, the app has been downloaded about 460K times (including updates). Not counting the back-end, the app and its various components are...

    Read more
  • Aug, 2015
  • *andfall

    Welp, I did it again - I released an album: it’s named *andfall, a play on the word “landfall”, and I wrote it in one week-end, for @McFunkyPants’ entry in the Ludum Dare 33 game jam.

    It’s my first solo album, the previous...

    Read more
  • Jan, 2015
  • ooc generics and flawed designs

    ooc is perhaps one of my proudest achievements, but at the same time it’s one of the most annoying thorns in my side.

    The main reason is that its design is flawed, and some things can’t be easily fixed at this point. Now don’t get me wrong: every design is...

    Read more
  • Nov, 2014
  • S-exps in your browser

    The front end of the pool

    I’ve been interested in reactive JavaScript for a while. At memoways, we strive to build snappy user interfaces for clients who like to interact with their data with as little latency as possible.

    In the past two years, I learned front-end...

    Read more
  • Sep, 2014
  • Happy stay with us day

    I didn’t really know what to do for “World Suicide Prevention Day 2014”.

    First off, I didn’t know it existed at all. Like, c’mon, know your audience, if you have a party like that, I want in!

    Second, it’s a terrible name: I hereby propose...

    Read more
  • Aug, 2014
  • Cross-compilation notes

    I’ll keep updating this article as I go, just to put stuff in all the same place.

    Platforms

    Cross-compiling for Linux

    I’m pretty sure it’s possible to cross-compile for Linux on other OSes, seeing as everything is open-source, but I have never done it - and...

    Read more
  • Feb, 2014
  • On the subject of time

    It’s a fine Wednesday of February, and I’m sitting in my living room at four in the morning, typing these words. Just a few minutes ago, I poured myself a half glass of wine and smoked a cigarette, celebrating the end of “my first week”, as a matter of...

    Read more
  • Three gamedev surprises

    Despite their peaceful appearance, game developers actually lead thrilling lives! Here are three things I learned (or re-learned) about yesterday that I’d like to share with you, in the form of assumptions that revealed false.

    VSync is relatively straightforward. Right?...

    Read more
  • Fast font packing for fun and profit

    Being creative is hard work, let’s go optimizing instead! My graphics engine dye was pretty naive about displaying text, and it was wasteful. Let’s see how I made it all better with this one weird tip.

    Disclaimer: Even after a few years I’m still very much an...

    Read more
  • Dec, 2013
  • Lestac: The Making Of

    Update: Lestac is now available in Early Access on itch.io! Read more on the official page

    So, Lestac is out! Ain’t that something? For those who don’t know, it’s Sylvain and I’s entry for Ludum Dare 28, a video game jam that happens every four months....

    Read more
  • The quest for ooc.vim

    I’ve spent the past few weeks after rock 0.9.8’s release working on some of the neglected aspects of ooc, namely tooling support and performance.

    My kingdom for a vim plug-in!

    Well, technically, ooc.vim is a few years old, and it was even updated a few times to...

    Read more
  • Nov, 2013
  • rock 0.9.8 is out

    A little less than two months after the previous release, I’m happy to announce that the ooc compiler rock 0.9.8, codename columbia is now out.

    The impatients can readily skip to the release notes, but for those who prefer a narrative, let me tell you why I’m...

    Read more
  • Oct, 2013
  • And then there were fewer bugs

    Intro

    This deals with rock internals, so fasten your seatbelts and expect many weird things along the way. I’m not necessarily proud of the state of the implementation, I’m just rolling with it and trying to improve it gradually rather than throw everything away....

    Read more
  • rock 0.9.7 + new website

    This is going to be a short one.

    Basically, since February, both shamanas, fredreichbier and I have putting way too much work into the latest iteration of rock, an ooc compiler written in ooc.

    I have the pleasure to announce that version 0.9.7, codename pacino is now out, as...

    Read more
  • Jun, 2013
  • Game Design: The Binding of Isaac

    In hours, I have played more of The Binding of Isaac than any other game in my Steam library. Edmund McMillen said he wasn’t expecting it to be a hit, and has since proceeded to be proven thoroughly wrong.

    It is kind of a big deal among a certain crowd: as I’m...

    Read more
  • May, 2013
  • The Choice Ep. 1: Debriefing

    To the programmers

    It’s too easy! Where’s the documentation for the API? I found an injection vulnerability! Global functions from ‘window’ leak! I tried to attack your server then realized nginx was ignoring me!

    Keep struggling, my pretties. The game...

    Read more
  • Damian Sommer on The Yawhg

    Damian Sommer did a casual AMA on Reddit recently, about his upcoming game, The Yawhg. I got to ask him a few questions. Here’s what he had to say.

    What brought you out of your usual “let’s make fucked up platformers” style?

    “I was just kind of...

    Read more
  • The iterative nature of art

    “Some people don’t understand the iterative nature of art, design and game design.”

    “Instead, they try to reach the final version on the first try and get frustrated when it’s not as good as they thought.”

    “Aim for the best you can, but...

    Read more
  • The best way to learn

    “The best way to learn is to just go out and make stuff, collaborate with people who are better than you at different things, and experiment.”

    “That’s what I’ve found, at least. Just be around people who are awesome and learn off them. Trade ideas...

    Read more
  • sam 0.2.0 released

    Today I decided to release sam 0.2.0. There are only a handful of new features in there but it’s still releaseworthy! See the previous sam announcement for more information on the tool itself.

    Source path and lib folders

    Let’s take a look at what sam tells us when...

    Read more
  • oocdoc, Part 4 — sourcepath

    In the previous article, We’ve built a nagaqueen-based tool that can parse one ooc file, detect class declarations and print its doc strings. Today, we’re making a bit of infrastructure for our app to support more sizable projects.

    Source path and lib folders...

    Read more
  • The shortest ooc quine

    A few days ago I posted an ooc quine. But while browing HackerNews, I found an even shorter one. The shortest!

    Here it is, in its full glory

    Can’t see anything? That’s an empty file. It will compile and run just fine. ooc doesn’t require a main function -...

    Read more
  • oocdoc, Part 3 — parsing

    In the previous article, I gave brummi a go. However, we’ve seen that it still doesn’t fit our requirements: we need a tool that’s fast, easy to install and configure, produces beautiful and usable docs.

    Yesterday I started building my own documentation...

    Read more
  • oocdoc, Part 2 — brummi

    In the previous article, we saw how to use NaturalDocs, a language-agnostic documentation generator. Today we’ll see how to use brummi, a tool specific to ooc, written by Friedrich Weber.

    Generating .json files

    The first step to generate docs using brummi is to use rock...

    Read more
  • An ooc quine

    While preparing my next post about ooc documentation yet again, I stumbled upon an old ooc quine of mine. Here it is in integrality for your pleasure:

    q := 34 as Char
    l := [
    "q := 34 as Char"
    "l := ["
    "]"
    "for (i in 0..2) {"
    "    l[i]...
    Read more
  • oocdoc, Part 1 — NaturalDocs

    Documentation in ooc land has sucked for quite some time. The standard response is pretty much: “use the code, Luke!” — which is fine when doing small projects that don’t matter much, but not so when you want to get serious.

    So when a newcomer, beoran, asked...

    Read more
  • Experiments in happiness

    If you’re a regular, you might’ve noticed the place has changed around a little. Thing is, I’ve been spending time playing around with a radical new concept: happiness.

    The year and a few months that I’ve spent working for a start-up were actually a...

    Read more
  • Mar, 2013
  • Isaac rubs his back on non-existent doors

    Haven’t blogged in a while. Life’s fine, project are a-plenty, but I just wanted to make a more lasting post about one particular issue that struck me as funny when programming Paper Isaac.

    Bugs, bugs, bugs

    What’s infuriating when letting others play an...

    Read more
  • Feb, 2013
  • Things I struggle with

    Putting thoughts in bits

    I think about lots of things but when it comes down to writing them, drawing them, implementing them, it’s not that easy. Even with years of practice in each of these trades, it’s still an uphill battle.

    Which is why I am not going to read...

    Read more
  • Next power of two

    While looking to write a pure ooc version of ftgl, I was reading the source of ftgl-gl3 and I stumbled upon this piece of code:

    static inline GLuint NextPowerOf2(GLuint in)
    {
         in -= 1;
    
         in |= in >> 16;
         in |= in >> 8;
         in |= in >> 4;
         in...
    Read more
  • rock 0.9.6 is on the loose!

    Just 8 days after the last release, rock 0.9.6 is out.

    To update, run git pull && make rescue as usual. To install from scratch, clone the repo, cd into it, and run make rescue from there - it’ll download the latest bootstrap, compile itself from C, then...

    Read more
  • Android development with rock 0.9.5

    rock 0.9.5 is out! It’s the meanest, slimmest, baddest rock release yet.

    To update, run git pull && make rescue as usual. To install from scratch, clone the repo, cd into it, and run make rescue from there - it’ll download the latest bootstrap, compile...

    Read more
  • Jan, 2013
  • NeverJam: the game jam jam game

    Our January project was ambitious: a 2D puzzle game, a-la lemmings with a twist, with big and numerous levels. And of course, all using our homegrown tools, from the compiler to the level editor to the UI system and game framework.

    However, January ended too soon, and,...

    Read more
  • sam, homebrew-mingw, etc.

    I want to write blog posts, but right now I have too much to do.

    So instead, here are bullet points:

    • I wrote an ooc tool named sam, which helps you keep your git repos up-to-date, and helps to remind you what to push when switching workstations. It’s pretty neat, and...

    Read more
  • Dec, 2012
  • The perils of ooc arguments

    The ooc language is known to be friendly to C libraries, and we have a slew of them covered on GitHub, but one common hurdle is how to correctly declare extern functions.

    Argument types

    For an ooc function prototype, there are many types of arguments. You can go with regular...

    Read more
  • Having fun with ooc

    Unfortunately, the ooc language could have better documentation. In the meantime, I’d like to blog about about some features that might not be very well-known.

    Nested functions

    Here’s a program that prints 1, 3, 5, 7, 9:

    import structs/ArrayList
    
    main: func {...
    Read more
  • Cross-platform game distribution

    ooc makes it easy to compile your application on all major platforms (Windows, OSX, Linux) - the compiler itself runs there, and the SDK supports all these platforms with basic functionality: data structures, file handling, time handling, networking, etc.

    But between getting...

    Read more
  • Ludum Dare #25 Post-mortem

    Last week-end, I participated to Ludum Dare for the fourth time in a row!

    Downloads: Linux (64) | OS/X | Windows

    Story

    So here is our entry: Legithief. The backstory is simple, yet cunning: you are an ordinary thief practicing ordinary acts of thievery in the houses of...

    Read more
  • AOT vs JIT: Why don't we do both?

    I wanted to take some time to write about a piece of software I’ve been working on lately, just so you know how I’ve been spending the last few weeks.

    Rationale

    A few years ago, I designed a programming language: ooc. Even though I’ve done my fair share of...

    Read more
  • Apr, 2012
  • In the mind of a suicidal person

    Switzerland

    In a recent popular vote, the Swiss people decided against passing from four mandatory weeks of holidays per year to six. Everywhere in the world, the white cross on a red background is a symbol of hard work, reliability, efficiency, and professionalism....

    Read more