This looks amazing. Can the author explain the implementation choices? * Why WASM? * Why Canvas? From what I could see, it seems to repaint the whole canvas every frame, so I'm guessing this uses a custom implementation of immediate mode GUI.
Hi, thanks :) Why WASM: One of the primary goal of NoteCalc is to be easily accessible (e.g. it was mainly born because Soulver is MacOS only). So the browser-based client was obvious choice, and I chosed WASM for - performance reasons - to be able to use rust - to avoid as much JS (and related technologies) as possible Why Canvas: I answered here: https://github.com/bbodi/notecalc3/issues/6#issuecomment-749... In a…
Any advice / learnings on using canvas from wasm for this kind of GUI stuff? If I get it right, you just implemented the editor yourself, not using any sort of widget system.
People often recommend not trying to implement editors on top of canvas because of ... reasons [1] [2], but it seems your implementation ended up being pretty simple? (at least in terms of lines of code...).
1: https://www.w3.org/TR/2dcontext/#best-practices
2: https://stackoverflow.com/questions/12425111/creating-canvas...