4 ms·
And what about server developers using Node.js?
by stupidcar 9y ago
And what about server developers using Node.js?
- pizlonator 9y agoRight! It can't be the all of the cool features are done in wasm, which doesn't even have a GC yet.
- vlunkr 9y agoWASM is farther along than concurrent JS though...
- pizlonator 9y agoThat's true. But most of the web is written in JS, not wasm.
- fermuch 9y agoIs there any limitation or reason for not implementing WASM on nodejs?
- pizlonator 9y agoIs there any limitation of reason for forcing people to rewrite their Node.js apps in something else just to get modern features?
- gcb0 9y agoin this case, yes, a feature that breaks backward compatibility. So someone suggested rewriting in another language, since the new feature will not fit the only advantage nodejs have: same language as browser. The alternative is to rewrite in a type of JS that will not run on the browser either.
- pizlonator 9y agoTe proposal for concurrency in the post does not break backward compatibility.
- stupidcar 9y agoOf course not, and hopefully it will come to V8, but its mere existence does not preclude enhancing JavaScript, any more than the existence of PInvoke or JNI precludes enhancing .NET and Java. When people say "JS shouldn't support feature X", when feature X is supported in every other serious language, I can't help but guess that their real problem is with JS itself, and they just don't think people should be using it at all. Fine, if that's their opinion, but they should come right out and say it.
- pizlonator 9y agoSo true! Lots of people actually like using JS. I think it makes sense to understand what features can be added to this language.
- chrisco255 9y agoWell for me it adds complexity to JS. One nice thing about JS is that it is single threaded and you don't have to deal with locks or inconsistencies there. An entire class of problems goes away, and since JS event loop is reasonably fast as it is, it's pretty nice not having to worry about concurrency.
- threatofrain 9y agoI would think that it's owing to the frequently single-threaded context of JS that concurrency becomes even more vital for maintaining the liveliness of your app. I also think that identifying aspects of concurrency often means free parallelism speedups, and the user doesn't even have to be aware -- no extra mental price.
- Ajedi32 9y agoNo. In fact, AFAIK it's already implemented on Node, behind the --expose-wasm flag: http://thecodebarbarian.com/getting-started-with-webassembly-in-node.js.html http://thecodebarbarian.com/getting-started-with-webassembly...
- thehardsphere 9y agoThere may or may not be, but that doesn't address that Node.js was created to specifically avoid a threaded concurrency model in the first place.
- jensvdh 9y agoWhat's the point? Why not write your server directly in say Python or Java then? I thought WASM is meant to get around the restriction that the browser only understands JS right now.
- pitaj 9y ago> why not use X Because X doesn't run in a browser
- kornakiewicz 9y agoDo you need to run your server in a browser?
- geldan 9y agoNo, but it's very nice to be able to share code for things like view rendering or form validation between the server and client without jumping through hoops.
- rmrfrmrf 9y agoDepends on what you're doing, but if you just want to take advantage of multiple cores you can already accomplish that with `cluster`.
- pizlonator 9y agoI remember when people used to say "you don't need threads, just use fork"!
- rmrfrmrf 9y agoWhat do they say now, out of curiosity?
- pizlonator 9y agoNow they say use fork-join. ;-) Point is, some people don’t like threads and probably never will. Other people like threads and probably always will. Some languages have threads and many other programming models and then everyone is happy. I want the people who like threads to be happy in JS.
- thehardsphere 9y agoI thought the point of Node.js was that threads were too complicated and rendered unnecessary by asynchronous event loops that do message passing between processes. Are the Node people finally giving up on this trope?
- api 9y agoIf you have crazy high performance stuff you can do it in native modules.