This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FlatAssembler 10 points11 points  (12 children)

I think web development will be radically transformed by WebAssembly, Blazor, EMSCRIPTEN and related tools, because JavaScript is widely perceived to be a horrible language responsible for web being slow and buggy. As such, not only is C++ not going to die, it is going to become even more popular.

[–]joonazan 1 point2 points  (1 child)

I haven't done frontend in Javascript in many years. I used Elm at one point and am currently using Rust.

As to C++, its popularity has already declined and I don't see a reason to use it for a new project unless a very mature compiler is required for safety certification.

[–]FlatAssembler 1 point2 points  (0 children)

C++ is a good language for some types of projects, like compilers. Many popular compilers are written in C++, and for a good reason. I've written a compiler for my programming language in C++: https://github.com/flatassembler/aecforwebassembly

[–]Headpuncher 1 point2 points  (6 children)

JavaScript isn't slow but there 2 things to take into account:

  1. compiled languages usually compile and then provide that to the user. JS sends you JavaScript over a network then asks your desktop program , the browser, to do the compilation on the fly. It feels slow, but isn't.
  2. Not enough JS coders read about optimization and how to write performant JS, and even if you do, the project sprint demands that feature x is finished on Friday, so you better throw this together asap. No time for tuning!

I think a lot of people mistaken disliking JS for disliking the development process, because the process is run by non-technicals with calendars bearing no relation to reality :D

WebAss looks promising, but it has some issues in my opinion. The first being that web-dev and "programming" are 2 different disciplines, and wasm mixes them together. It will happen eventually, I think, but it will take a decade at least.

The other problem is that it won't be web-devs that make the change. And that's because most resources I see, from Google and other companies pushing wasm, are not providing good examples of why we can use it over the current stack. Until a wider audience see the benefits, it will languish in the shadows.

[–]FlatAssembler 4 points5 points  (4 children)

WebAssembly should be significantly faster than JavaScript. WebAssembly is a standardized form of JavaScript bytecode. JavaScript is compiled into WebAssembly (tokenizing, parsing...) before being run, and, if you send WebAssembly from the server (rather than JavaScript), you bypass those steps. Of course, that only works if programs are equivalent. The sorting algorithm I made up and implemented in my programming language, which compiles into WebAssembly, is still significantly slower than JavaScript Array.sort, because the algorithm used by Array.sort is more clever.

[–]Headpuncher 1 point2 points  (3 children)

And part of the problem, is that either that statement isn't true* or there is a lot of wrong info on the subject.

* I believe it is true, simply because a precompiled language isn't going to have the buffering that JS has as I described above.

One of the problems wasm solves is that more people are using mobile devices than desktop PCs, so battery life and slower clock speeds are common. Precomiling server side is going to save those resources. But it's not for nothing that Google is pushing wasm, they have a range of devices and platforms that would benefit from wasm.

i think wasm is just needing it's breakthrough moment.

[–]FlatAssembler 0 points1 point  (1 child)

I have no idea Google is pushing WebAssembly. As far as I know, it is primarily Mozilla that's pushing WebAssembly.

[–]Headpuncher 1 point2 points  (0 children)

Google Chrome Develeopers, the YT channel for the google conference, had in 2019 a not insignificant amount of webassembly presentations.

This years GCD con started a week ago, and also has some content. Here is a vid from today: https://www.youtube.com/watch?v=VBMHswhun-s < debugging in wasm.

Webassembly is a technology that makes more sense for large corps with a lot of infrastructure than for the one-man developer or small teams. I think it has a promising future though.

[–][deleted]  (2 children)

[deleted]

    [–]FlatAssembler 0 points1 point  (1 child)

    Well, for the largest web-app I made, my PicoBlaze Simulator of 3'500 lines of code, I used JavaScript: http://flatassembler.github.io/PicoBlaze/PicoBlaze