Avatar for dzhu

dzhu

Member since Mar 2023 • Last active Apr 2023
  • 1 conversations
  • 3 comments

Most recent activity

    • 5 comments
    • 410 views
  • in Bangle.js
    Avatar for dzhu

    Oh, that's neat, I didn't know the JS version was used that way. I suppose that should be fixable (maybe not function names in stack traces), seeing how Node can run WebAssembly too, and I wouldn't consider the job done until such things were addressed, but I can certainly agree we're into not-worth-it territory.

    Anyway, web emulator and underlying technology aside, I hope someone will get some use out of this emulator in its own right! To expand on the benefits a bit more, I've found that the firmware for the real device takes about 40 seconds to build (even for an incremental build -- the final link step is most of it) and over 30 seconds to upload, while rebuilding for this takes 3 seconds and the emulator can be restarted instantly. Plus I don't have to squint at the rather small watch screen or wait for files to transfer over Bluetooth all the time.

  • in Bangle.js
    Avatar for dzhu

    That would be conceivable, but I don't think I would want to go in that direction from a technical perspective. Performance isn't really part of it (after all, anything running on a PC will far outstrip the real device anyway); it's more that I think WebAssembly is a better fit for this scenario -- this is basically exactly the kind of thing it was made for, by my understanding -- and asm.js has been considered pretty much made obsolete by it for a few years now, so I'd prefer not to use asm.js in a new project. And using the JS output would require writing everything in JS or embedding a JS interpreter, which didn't appeal to me personally as much. (Yes, I realize I'm saying that in the forum for a compact JS interpreter :P. I would certainly be delighted if someone did run Espruino on top of Espruino, though!)

    Actually, if anything, I was considering proposing that the web emulator switch to WebAssembly. I'll hold off from formally making that a feature request, since it would take some work while having, admittedly, not much immediate practical impact, but would you accept a PR making that change?

  • in Bangle.js
    Avatar for dzhu

    Hi all, I'd like to let you know about a standalone (i.e., not browser-based) Bangle.js 2 emulator that I've been working on: https://github.com/dzhu/banglejs-emu.

    While I really do love how Espruino provides in-browser tooling to make the barrier to entry as low as possible, and the emulator in the Espruino IDE in particular is a neat bit of tech, I find it a bit clumsy for everything to have to go through a browser (or a physical device). With this emulator, you can develop and test both firmware and apps in a way that's easier to integrate with typical coding workflows. I've already used it to help me fix a bug (https://github.com/espruino/Espruino/pul­l/2343) and do a variety of other tinkering besides. The emulator shows the screen and the console output right in the terminal window; the screen can be used for touch input, and you can connect via TCP to provide console input. Not all functionality is supported, but I think there's enough to be useful in a lot of cases.

    The emulator is written in Rust; you can either set up Rust and build it yourself or download pre-built binaries for Linux, macOS, and Windows at https://github.com/dzhu/banglejs-emu/act­ions.

Actions