I believe that there could be quite a few different ways in which this could get solved. The potential solution space is huge, so you might just stumble upon something interesting if you wander places where no one else is looking..
Good luck!!
677 karma · joined August 31, 2012
I believe that there could be quite a few different ways in which this could get solved. The potential solution space is huge, so you might just stumble upon something interesting if you wander places where no one else is looking..
Good luck!!
And totally — especially if there is indeed a larger library still waiting to be excavated. Who knows how many completely unique texts are waiting to be read, if we just have the right method to do so?!
I might write a blog post about this, since it's pretty fun / tricky stuff!
There are even some libraries that try to mimic React directly from Rust, such as https://yew.rs/ (though in my experience they can be a bit harder to use than Zaplib, since they require you to learn about traits, closures, etc, and tend to also run into borrow checker issues more often -- all of those are things we try to avoid having to learn in Zaplib!)
We also support building compiling to native though, and we've found that the typical difference between Wasm and native apps is about 2x (on most metrics).
For debugging we support full Rust source maps in the browser (using DWARF). :D (This is something that wasm-bindgen doesn't support, for example!) See https://zaplib.com/docs/developer_environment.html#chrome-de... for how to set it up.
Since we also support running the Rust code natively (even when doing rendering!) you can also use that and attach whatever native debugger you like. That same page also has info on how to set up native debugging with VSCode.
It's definitely bleeding-edge stuff; we should add some backwards compatibility for (slightly) older browsers though.
Very curious to hear stories from other folks building intensive stuff in the browser. How are you dealing with performance issues in Javascript? Have you tried using Rust or C++ with WebAssembly for parts of your apps? How did you make 2d/3d rendering faster? Would you want to use something like Zaplib?
(You may have seen my blog yesterday about the subtleties about Wasm vs JS/TS: https://zaplib.com/docs/blog_ts++.html)
> Another idea to make Typescript–– a bit less restrictive and more ergonomic, would be to use reference-counting of objects, and then try to optimize most away using compile-time reference counting as pioneered by Lobster. This gives most of the advantages of manually managed memory, but makes the ownership model much easier to reason about. It is however slightly less performant, and more importantly, makes performance less predictable, since it becomes more reliant on compiler cleverness.
Even Rust can hide actual performance behind abstractions, and I've already been bitten by that a few times.. Not sure what the right solution is here, but I agree that it's super important to think about this when designing a language like this.