-
• #2
Wow, that's awesome!
Personally I'm totally happy with including binary blobs. What some others have done is include
app.js
and thenapp.min.js
which is the one that actually gets uploaded?What would be great is if you could let me know exactly what was changed in your compiler service so I could add it back into the one everyone has? Then at least it'd be easy for others to try your code.
-
• #3
Compiler flags are here you can perhaps make it conditional based on board name, those with nrf52832 can have cortex M4/FPU enabled. Also I enabled C preprocessor by removing
-fpreprocessed
which you have turned off for some reason (security because of #include running on server ?)and with the FPU errata fix you added recently this is even more painless since you don't need to clear that in inline C code now
-
• #4
Ok, thanks! Yes, I should be able to just check based on the board name.
I enabled C preprocessor by removing -fpreprocessed which you have turned off for some reason
Yes, it's because I don't want anyone doing
#include "/etc/passwd"
and then getting bits of it quoted back to them in an error message :) -
• #6
Ok, it's now live! So you should be able to compile for Bangle.js with floating point support using the normal compiler service.
Yes, there are ways around pretokenisation (I bet
#include
isn't the only thing that includes files) - but to be honest it was just a matter of trying to provide a useful tool without a massive security hole or complicating it so much it never got released.IMO the best would be to just emscripten compile ARM GCC and run it in the browser if needed. I'd love to get as little as possible dependent on the server
-
• #7
Thanks for adding the compiler flags, it works beautifully. I put in a pull request for the app to be added to the app loader.
-
• #8
Thanks - just merged!
-
• #9
absolutely cool...
Questions:
- what is the (max, average) size of the .stl file the watch can handle?
- could you change the viewers point into the object space?
- what is the average fps per edge?
- what is the (max, average) size of the .stl file the watch can handle?
Hi,
This is a bit of an app-store policy question:
I wrote an STL viewer app (STL is a relatively simple file format for representing 3d models and is often used in the hobbyist 3d printing realm). The app can read ASCII formatted STL files and displays a shaded 3d view of its contents that can be rotated around on the watch screen (see attached image).
I concede this is probably not the most useful app for a smartwatch, but perhaps it is still worth adding to the app store.
However, to get even marginally useful framerates for all but the very simplest models, I ended up doing a lot of the linear algebra and data manipulations in inline C using 32 bit floats and the processor's FPU (thanks to @fanoush for figuring out how to do that). For the FPU code to compile I had to host my own local Espruino compiler.
Therefore, in order for others to install the app on their watch the app store version would have to contain a binary blob of the compiled routines (encapsulated in a base64 string). Obviously I would provide the C code as well, but it would be much harder for the casual user to play around with the code than with a strictly JS-only app.
Any thoughts on this?
Thanks,
Marko
1 Attachment