My First Contribution to an Open Source Project: A story

Although I have been programming for a while (~10 years since I first learn programming), I have not yet made any (significant) contributions to existing works. I have done many projects, but all of them are either myself only or me and another designer. This changed last October, when I start contributing to AviSynth+, a modern fork of original AviSynth project, seriously. For a note, AviSynth is a script-based, non-linear video editing program/library.

Some side project: Brainfuck-JIT

I actually have wondered how JIT (Just-In-Time compiling) works for quite a long time, because it is basic knowledge that code segment in memory is write-protected, and you cannot move CPU instruction pointer to stack frame or heap for to security reason. But to do JIT you need to generate new machine code in memory and instantly execute it. How?

I stumbled upon this article titled “The Joy of Simple JITs”, which get me started. Apparently, you can do mmap (POSIX) or VirtualAlloc (Win32) to allocate virtual file in memory. And you can write to this section. And you can execute it. Looking great?

On Assembly Language Syntax

In case you do not know assembly, let me introduce it briefly. x86 Assembly, which is mnemonic version of underlying x86 machine code, has two main syntax: AT&T syntax (or GAS syntax) and Intel syntax.

On Low-Level Programming and Assembly

“I write Assembly”

When I say that, people usually think: “Hey, you are pro as f**k programmer”. Yes, I am not kidding; I have too many people saying that to me, and it is completely opposite of what I am.

I am beginner programmer. In everything. Yes, I have freaking 8 years experience, but that doesn’t really make me good programmer, isn’t it? I don’t have enough experience working in teams for large project, working under pressure and such. And knowledge will only get you so far.

Okay, to be honest I am not really writing Assembly nor is an assembly programmer, because I don’t know how to write .asm file. But that isn’t really matter (I have always been using intrinsics function, but more on that later). [Edit: 26/6/2014: I know how to now]