I got the new Fitbit Ionic a few weeks ago, and I'm generally pretty happy with the device. I'm in the process of writing a full review of the Ionic, but I realized partway through that I had written quite a lot about the SDK, which many people probably won't be interested in. Hence, I decided to make that into its own post. In the meantime, if you're looking for a review, I would recommend reading DC Rainmaker's. He's a much more serious athlete than I am, and he reviews fitness gear semi-professionally, so he's able to put the devices through much more rigorous tests and go into detail about things like heart rate and GPS accuracy, which I won't be doing.





Anyway, the Ionic being Fitbit's first real smartwatch, I was eager to check out the SDK and dive into app development. And, well, I've tried to do so, but so far the results haven't been great. I think this is partly just because the platform is very new, and partly because of some questionable technology decisions that Fitbit made. Although it's too early to really evaluate the success or failure of the Ionic, or of FitOS an app platform, I think it can still be instructive to look at some of the choices that Fitbit made in designing the device and the OS, what effects they're having on developers now, and why I think they may prove to have been suboptimal choices.

Battery life was clearly the foremost concern for Fitbit when they designed the Ionic, and the technology decisions reflect that. Whereas the Apple Watch series 3 has a dual core CPU with a maximum clock speed of at least 780 Mhz, 3D graphics acceleration, and a rumored 768MB of RAM, the Ionic contains the humble Toshiba TZ1201XBG, with a meager maximum clock speed of 120Mhz. The battery life of the two devices reflects these hardware differences: the Ionic lasts 4-5 days on a charge, whereas the Apple Watch lasts a maximum of 2 days. Personally, I think this was a great choice by Fitbit. Although the Apple Watch is inarguably a more capable "smartwatch," its two-day maximum battery life is an absolute deal-breaker for me, which is one of the primary reasons I bought the Ionic instead.

With the hardware itself being so thoughtfully designed to maximize battery life, it strikes me as a bit odd that Fitbit chose JavaScript as the sole language for app development on their platform. JavaScript is not known for being a high-performance, memory-efficient programming language; historically, it has been quite the opposite. Of course, it's not the language itself that matters so much as the interpreter, and modern JavaScript engines like V8 and Chakra have made extremely significant performance improvements compared to how slow JavaScript interpreters used to be. The Ionic, for its part, uses an engine called "JerryScript", which is designed specifically for IoT devices and allows JavaScript to be precompiled to bytecode; it boasts that it can run in environments with less than 64KB of RAM and less than 200KB of ROM. I'm not sure where the name comes from; contrary to what you might expect, the project's main contributor does not appear to be named Jerry. For me, the name just conjures images of Jerry from Rick and Morty:

Uh, anyway, JavaScript is still orders of magnitude slower than C and C++ for most workloads, and when you're concerned about energy efficiency and performance on a device with a 120Mhz single-core CPU, that difference matters. I freely admit that I am biased in favor of languages like C and C++, which are as close to the metal as you can get in a high-level language. Some would consider this preference anachronistic, but it's undeniable that there are still many places where maximizing performance really does matter. Embedded applications are one of those places, and I'm fairly confident that on the Ionic, using native code could have offered even better battery life, or perhaps improved performance, which is sometimes suboptimal even in the built-in apps.

Similarly, all UI on the Ionic is done using Scalable Vector Graphics (SVG). SVG is a lot easier to use than requiring developers to render their own UI, but it's also a lot less flexible than just blitting pixels to the screen. The minimum benchmark that any modern computing device should be able to pass is whether or not it can run DOOM, but between the poor performance of JavaScript and the inflexibility of SVG, I don't see that happening on the Ionic any time soon.