The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
September 19, 2018

Every couple of years I'll read through a favorite book of mine, Code: The Hidden Language of Computer Hardware and Software. I originally bought it in 2003, and the first time I read Code I couldn't get through it. A bunch of the concepts were over my head and I just didn't grasp certain ideas. Which made me feel a bit stupid because supposedly I was a professional computer programmer. A self-taught professional programmer, but still a programmer.

But if I'm anything, it's stubborn and determined. So I read it again after having more experience and I got farther this time, understood more, and even had a bunch of aha! moments. Things that I sort of knew and kind of understood at the lower levels of the computer clicked into place.

And then later on I read it again and understood more.

Lately I've been having the itch to read it again, but then I thought maybe I'd try something else. Why not do some real coding around some lower level stuff that I kind of understood, but don't completely get? What about libffi?

I've run across libffi before when working with Mocha, which is a JavaScript to Cocoa bridge that my project Cocoa Script uses. libffi is not as low level as you can get, but it is interesting because you get to deal with things like making room on the stack for returning values from functions. You also get handle a bunch of pointers and deal with memory alignment and other fun things that the compiler usually just handles for you. So as a side project, this might be a fun learning experience.

Plus, JavaScript is an important feature of both Acorn and Retrobatch, and probably even more so in future versions of Retrobatch. If it's going to play a big part of Retrobatch I really want to know it through and through and I want things structured the way my particular brain works.

So that's how FMJS was born. It's very incomplete, but it's a start. In fact, just yesterday it could finally load up Core Image and use a filter.

It's also been educational and interesting. And it helps that it's useful too.