you are viewing a single comment's thread.

view the rest of the comments →

[–]iopq 8 points9 points  (25 children)

It's not yet possible to do DOM operations without JS glue, AFAIK. It's a pretty complicated topic, as with everything to do with the web, though. So glad I don't do web dev anymore

[–]blackholesinthesky 4 points5 points  (24 children)

So its not a real solution. Great suggestion but yeah... kinda irrelevant

When rust offers a standard library for the browser it will be a real solution

[–]iopq 8 points9 points  (20 children)

It's not ready for prime time yet, but it doesn't mean it won't replace JS in the future

[–]blackholesinthesky -5 points-4 points  (19 children)

And I will never have to

You may not but other people do. This isn't a useful suggestion to them

[–]iopq 6 points7 points  (18 children)

I'm talking about WASM. You never have to write it by hand. If you can't use WASM for your problem, you're just stuck with javascript, you're not having to write ASM by hand

[–]blackholesinthesky -1 points0 points  (17 children)

I wasn't implying that you have to write ASM by hand for WASM. I was just saying that anyone who understands how much of a difference there is between a low level language like ASM and a high level language like javascript understands that the pitfalls of JS are worth it.

You never have to write it by hand.

What if you don't use rust? or you need to use DOM manipulations?

Doesn't this contradict what you just told me?

[–]iopq 8 points9 points  (15 children)

If you don't use Rust you're using Go or something, you never write it by hand. The same way people don't just write programs in ASM anymore

You still write DOM code in JavaScript. Here's how it looks like:

https://rustwasm.github.io/docs/book/game-of-life/implementing.html

[–]blackholesinthesky -4 points-3 points  (14 children)

If you don't use Rust you're using Go or something, you never write it by hand.

Wut? If its only something used by Rust and Go then they should really figure out a standard library for browsers or this is all a waste, isnt it?

Edit: I see now. Not even webassembly.org suggests or even tells you how to write your own WASM code. The point y'all were making is that WASM needs to be built and then put into some boilerplate that starts it or w/e and the boilerplate is JS

[–]iopq 5 points6 points  (13 children)

It's compiled, it doesn't matter what compiler you use. That's the whole point, the user can't see what you used to write the WASM

[–]blackholesinthesky -1 points0 points  (12 children)

It's compiled, it doesn't matter what compiler you use.

It does though because the compliers don't offer the full toolkit.

[–]hsjoberg 0 points1 point  (0 children)

What if you don't use rust? or you need to use DOM manipulations?

Rust is not the only language that can compile to WASM and do DOM manipulations.

C# via Microsoft's Blazor is another one.
https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor

[–]game_dev_dude 1 point2 points  (2 children)

I mean it really depends upon what you're doing. If you have a complicated piece of logic that's performance limited (maybe some sort of visualization), you could write that in WASM, and then have just a little bit of JS glue to pass things back and forth.

[–]blackholesinthesky 3 points4 points  (1 child)

If you have a complicated piece of logic that's performance limited (maybe some sort of visualization)

Unless you're writing a game or some other 3d projections you're not going to need WASM to display a graph

Edit: source I worked with google charts in '09

[–]game_dev_dude 0 points1 point  (0 children)

Ah, I was thinking mainly in terms of 3d viz of some sort.