Would Garmin devices be able to run Javascript or NodeJS

Hi,

Not sure about which part of the forum I had to post it but if you think about a better category, please let me know.

So I was wondering why Garmin uses MonkeyC, apart from pure choice. I understand it would require to rebuild most of the softwares and firmwares but hypothetically ?

Would the devices be able to run JS or Node ? With some restrictions in the language maybe ? Like MonkeyC has restrictions as well.

Would it be too heavy ? Any other issues ? Pros and cons ?

What are your thoughts ?

(Would be so easy to build apps, data fields or watchfaces)

Cheers

Top Replies

All Replies

  • It's not only the age of the device, but the device itself.  The va5 and venu3 came out close to each other, but no vector fonts on the va5. while the venu3 has them.

  • Would it be too heavy ?

    Yes I think it would be too heavy. Garmin devices have extremely limited resources (e.g. processor, memory) compared to modern devices (such as literally any smartphone, including the first iPhone, or any model of Apple Watch.) I think the main reasons for this are to optimize battery life and (possibly) to save money on parts.

    For example, Vivoactive 4 was released in 2019 and still only has 32 KB available for each Connect IQ data field (only 2 can be used in a single activity, such as Run). For comparison, 8 years ago an Apple Watch dev complained that their app ran out of memory after using roughly 34 MB of memory (over 1000 times as much as 32 KB): https://stackoverflow.com/questions/34798771/max-memory-usage-on-watchos-2

    Vivoactive 5 was released in 2023 and has a whopping 262 KB available for CIQ data fields. 34 MB is still roughly 129 times as much as 262 KB.

    Furthermore, Garmin devices don't run a general purpose OS like Windows, Linux, macOS or iOS, so it would be tough to port over something like node.js even if there was sufficient resources. (Of course, surely one of the reasons Garmins don't run a general purpose OS is due to lack of resources.)

    For more information, see the following post and the linked podcast: forums.garmin.com/.../interesting-podcast-on-garmin-ciq-internals-with-garmin-employee

    If you follow the tech stack stuff at all, it becomes amazing that these watches do so much and franks work at all. Garmin has a drastically simplified architecture relative to Apple. It’s not really based on a operating system or barely an operating system — nothing like the Unix model in Apple WatchOS or Google WearOS.

    – no memory protection at all
    – no processes
    – no kernel protection or kernel vs user concept
    – everything is a single process with threads
    – everything is C and C++
    – The connectIQ interpreter is a thread running in this stuff (and an interpreter is expensive in terms or compute which means battery overhead)
    – basically any programming error can hang or crash the watch

    So I think Garmin uses Monkey C because:

    - they have complete control over the language design

    - they designed Monkey C / CIQ so it runs in a sandbox (which gives them control over what apps can actually do)

    I think the use of their own language allows them to control everything and save resources (memory and CPU). Of course the downside is they had to create everything from scratch, so there's a learning curve, as well as design decisions that not everyone may agree with.