Halfway into nearly every coding project I start, I begin to realize that I’ve done something wrong. Maybe the way I designed a particular system was flawed, or I realized that there was a better way of coding some method. I hope feel like this this a normal phenomenon when a project covers new ground. My point is, I feel like I’ve gone about this Node-FFI stuff all wrong. I started writing bindings for the most complex part of our code, before even testing whether Node-FFI is in a mature enough state for our needs with a more simple binding. Humph did this with ctype bindings in Python. He made more progress in a day than all of us did in two weeks… not good!

I’ve decided to start with the basics, so I created a new branch and started writing some test bindings for String.h. Unfortunately, Node-FFI’s documentation is scattered between the documentation for the Documentation for the ‘ref’ Node module and its own GitHub Wiki. I’ve also been using the Python REPL to replicate Humph’s String.h binding code so I can get a better sense of what works, and what doesn’t. It’s definitely been helping me but I am now stuck on trying to get webvtt_string_append_utf8() to work. I either get an infinite loop or a segmentation fault, so it looks like I’m going to have to suit up and get into debug mode. If I can get that method working tonight or tomorrow, I figure I’ll know enough to hopefully get Node-FFI working with the parser.h methods by Monday. If I can’t, then maybe Node-FFI isn’t a great fit for us.

Release 0.3 Stuff: