Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only sure cure for the JavaScript blues is WebAssembly.

Use something like Leptos and be happy:

https://www.leptos.dev/



Leptos is even worse than React in memory consumption and startup metrics.

https://krausest.github.io/js-framework-benchmark/current.ht...


But faster overall, one code base front and back, and it will only improve as new WebAssembly features roll out (js-string-builtins, Memory64, eventually component model DOM access).

And any high performance functions you need on the front end will be higher performance than JavaScript. Like bloom filters for example: https://nuenki.app/blog/bloom_filters_optimisation


> But faster overall

Only in further updates to the DOM. There are very few use cases where you need to continually update thousands of DOM elements.

For most use cases, start up time and memory usage are really the most important metric.


WebAssembly can't do anything without Javascript. You're still using the same annoying Web APIs with another layer of indirection between. Plus, now you're using the slow Rust compiler so your iteration times are going to suffer. We already have type-safety in Typescript. We don't have to care about lifetimes, either.


> WebAssembly can't do anything without Javascript.

But it's JavaScript glue code generated by Rust's wasm-bindgen that you don't need to care about. And eventually the glue code will be unnecessary with wasm component model DOM access.


Agree that WASM cannot yet directly manipulate the DOM. But are build times in JS/TS framework world any slower than Rust compile times? I'm not convinced on this point.

As a disclaimer, I still prefer vanilla JS and progressive enhancement.


TS is very fast with esbuild and the likes, it's basically just stripping off the type annotations. Your setup may vary, of course.

The other point isn't so much that there's a wrapper around the DOM, but that the DOM API itself is bad and slow. There's only so much pain a better language can take away here, and Rust isn't even a better language for that domain.


The treadmill continues.


Well, it's more like graduating from a kid's tricycle to a mountain bike.

Sure the tricycle had streamers on the handlebars and the little basket on the front was cute, but you can get more places with a mountain bike.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: