12 votes

Bangle.js 2 is a hackable, open source smartwatch that runs JavaScript

10 comments

  1. [6]
    babypuncher
    (edited )
    Link
    All this makes me wonder is how much better the performance or battery life would be if they used a compiled language instead. JavaScript makes sense when you want to target many platforms with...

    All this makes me wonder is how much better the performance or battery life would be if they used a compiled language instead.

    JavaScript makes sense when you want to target many platforms with one codebase. I don't understand the appeal in a niche embedded device like this, where your code is unlikely to have any utility anywhere else.

    I bet we will see some really cool stuff made with this though, so I'm interested to see what the community comes up with.

    10 votes
    1. [5]
      burkaman
      Link Parent
      https://www.kickstarter.com/projects/gfw/banglejs-2-the-open-smart-watch Don't totally buy it, I don't think any of this is unique to Javascript. However the Espruino site is more convincing:...

      Why JavaScript?

      Developing software for embedded devices can be a real pain. Code can take a minute or more to compile and upload to the chip, which has to happen for every change you make. Many tools don’t even allow for debugging, and on a device that stays on for weeks, even a tiny memory leak can make it unusable.

      Bangle.js doesn’t have those problems. The Espruino JavaScript interpreter allows you to upload code and debug wirelessly out of the box using just a Web Browser, with no need to install software on your computer. You can even try it out in an emulator!

      https://www.kickstarter.com/projects/gfw/banglejs-2-the-open-smart-watch

      Don't totally buy it, I don't think any of this is unique to Javascript. However the Espruino site is more convincing:

      Why JavaScript?

      We wanted to use a language that:

      • Has the same basic form as C, so simple code appears similar to Arduino code
      • Encourages event-based programming (for lower power consumption)
      • Is widely used, with lots of learning material online
      • Is interpreted, and allows functions to be modified while the interpreter is running (unlike some other languages, JavaScript treats functions as variables)

      How power efficient is Espruino?

      Very. Because it is event based, the Espruino interpreter can put itself to sleep when it knows no action is required.

      This means that code written for Espruino will be substantially more power efficient than the same code written in C, unless the C programmer has explicitly added code to enter low power sleep modes.

      Power Consumption depends on the board you're using, but for a device like Puck.js power consumption when idle can be as little as 3uA (0.000003 Amps).

      https://www.espruino.com/FAQ

      I hate Javascript but this seems like a pretty mature and well-thought-out project.

      11 votes
      1. teaearlgraycold
        Link Parent
        I actually like Javascript these days because you can use it as a compilation target for better languages.

        I actually like Javascript these days because you can use it as a compilation target for better languages.

        3 votes
      2. [3]
        arghdos
        Link Parent
        How good is JS about memory leaks though? Does it run a GC?

        How good is JS about memory leaks though? Does it run a GC?

        2 votes
        1. [2]
          burkaman
          Link Parent
          I mean any language without explicit memory management has to be run in an environment with garbage collection. Espruino has a GC, but I don't know enough to say what algorithm it uses or how safe...

          I mean any language without explicit memory management has to be run in an environment with garbage collection. Espruino has a GC, but I don't know enough to say what algorithm it uses or how safe and efficient it is.

          4 votes
          1. arghdos
            Link Parent
            It just seems to me, a dummy who’s run Python/C bindings thru Valgrind on occasion, that a high level scripting language like JS might not meet that requirement. But maybe I just didn’t have the...

            on a device that stays on for weeks, even a tiny memory leak can make it unusable.

            It just seems to me, a dummy who’s run Python/C bindings thru Valgrind on occasion, that a high level scripting language like JS might not meet that requirement. But maybe I just didn’t have the right Valgrind filters…

            2 votes
  2. [3]
    zonk
    Link
    Anyone able to explain how they can claim 4 weeks of battery life and hundreds of meters range for the Bluetooth? I'm not familiar with Bangle and their hardware, but those values sound a bit too...

    Anyone able to explain how they can claim 4 weeks of battery life and hundreds of meters range for the Bluetooth? I'm not familiar with Bangle and their hardware, but those values sound a bit too optimistic. Anyone who's deeper into this ecosystem or even has some of their hardware who cares to explain?

    4 votes
    1. GoingMerry
      Link Parent
      It’s doable with the Nordic SoC, the main battery draw is the display and you can certainly optimize for low power. 4 weeks is a lot tho, that’s likely a theoretical maximum

      It’s doable with the Nordic SoC, the main battery draw is the display and you can certainly optimize for low power. 4 weeks is a lot tho, that’s likely a theoretical maximum

      2 votes