It's over, guys. NodeJS won.
*Add threads*
Other urls found in this thread:
nodejs.org
github.com
twitter.com
There's no purpose of threads when async await exists. If you need to scale horizontally then just run multiple processes.
I wonder why no one just makes a nodejS equivalent in java or C# considering they're both 5-10x faster than node's runtime. Node's only advantage is that it has a nice, easy to use library. Why can't we have that in another language?
> what is shared memory
I searched but couldn't find any source about nodejs doing multithreading now. desu I dont even think you want nodejs ""developers"" to try to write multithreaded code
meant to
For nodejs's use case there's no point
Because Java is shit and C# builds on that shit. These older-school languages also carry the harmful mindset that things shouldn't be convenient for programmers and they should waste their time on triviliaties. JS does things better and has huge adoption, but it's still not a performant general programming language and never will be.
>use Java
>computation taking too long
>throw in a parallelStream(), all cores in use, code is 32x faster
>use Node
>JS is already slow dynamic language
>who needs threads lol I can use 1/32 of the cpu that's all I need
I've actually been thinking about making just such a thing in C++
>use Node
>computation takes too long
>call a C++ library
>NodeJS won
Meanwhile in the enterprise world Java is king and will continue to be for reliability sack.
They do it's called Go.
You already can. It's called Spring, IBM WebShere, Tomcat, etc.
You could do that in Java and C# as well.
I suppose that would be more original than creating the 9000th event-driven oh-so-ergonomic-for-my-trivial-examples framework in Python, Ruby or Rust.
> Being a corporate cuck.
Enjoy selling your butt to oracle.
You can literally do this with any language but there's always an overhead involved. For a language like java or C#, which are highly performant, it's not a big hit but for a slow as shit language like JS on the node runtime it's awful. When did 3-5 seconds become acceptable load times?
>no source
ok. SharedArrayBuffer and Atomics primordial objects aren't even enabled in chromium or firefox right now and Workers are basically browser only with no shared memory. as far as I know Workers still exist in their own process.
>You already can. It's called Spring, IBM WebShere, Tomcat, etc.
What does IBM websphere do? Make spring actually usable as a development tool in 2018? Because spring is nothing like node last time I checked. The age of monolithic frameworks is dead
>this bait
Java's binary downloads for shitty operating systems without oppressive EULA, now links to the alternative OpenJDK builds by oracle.
Equivalent of what? There is nothing good in Nodejs that Core doesn't already have.
>use Node
>computation taking too long
>throw in a require("worker_threads"), all cores in use, code is 32x faster
ftfy
That's fucking nothing. You should try Spring Data sometime.
(103 common frames omitted from this post)
What did they win? Gayest server? Or shittiest language driving it?
Why is node so slow?
> technology is gay
Some technology is gay zoomer. Enjoy your programmable socks
>Enterprise Java
Sounds like the deepest circle of hell.
>this thread again
JavaScript sucks ass as usual, but I at least hope github.com
>reliability sack
A Freudian slip?
Reading this thread makes me happy I program network shit in Elixir.
> Rust
> Python 2
NOPE
>worker threads
So it's garbage.
You can already do the same in the browser and nobody uses that either.
2018/10/7 5: 18, Magnum? Despair? Christianity? Atomic attraction? Hako rice
4:32, is the bad guy the cat reviving? The left ear? Uroboros? My brother Prana? Next time? Blue
22: 36, October 6, 2018, defecation? needle? Astral field? Hellabhana? 23: 19 Headache with Empire Gun?
21: 45, Murakoshi? cerebral infarction? 22: 25 Dogeza? Morocco? bald?
21: 03, Separation? Ogre? Muraisaki 21:29 Will this be OK? Hiding? Mirrors? Invincible?
20: 55, Cash dispenser? vagina? Muraisaki Gagambo Monkey? beard? Krikan?
20: 31, marking? Ebenki? Odor smell (damn father's mind) Murder? Are you sure? Cash dispenser?
19: 10, gay? Contamination (contaminated)? 19: 13 All-bacillary bacteria? Invincible? 19: 56, Homo? Krikan?
CONTAMINATION
= 30 DAYS IN THE HOLE
= BLESSEDBLOATER
= CAUSE OF TRUTH
= COMMUNICATIVE
= DOUBT THYSELF
= FREEDOM-FIGHTER
= HOOK OPERATOR
= INTRANSIGEANCE
= IT WAS ALL A DREAM
= JOY BEFORE DEATH
= MAGICKAL PORTAL
= MAX HORKHEIMER
= ONLINE EXODUS
= PULL REQUEST
= SOLAR SYSTEM
= SPIROGNOMICS
= THE CLANDESTINE
= THE COCK OF VINCE
= THE WAY OF LOVE
= UNITED STATES
= WELCOME TO HELL
...
The fuck is ?
async await helps with creating non-blocking action sequences, but that's not threading, if anything that's the opposite. Lately I see people confusing this a lot, I see code like this pretty often:
const a = await something1()
const b = await something2()
const c = await something3()
await somethingElse(a,b,c)
An something1, something2 and something3 don't depend on each other, yet they are blocking the execution of something2() and something3(), instead of doing the proper:
Promise.all([something1, something2, something3]).then(somethingElse)
Which unlocks the main thread and lets libuv do it's magic launching each on it's on thread (if necessary).
Await's only purpose was to solve the callback hell that used to exist when working with a lot of asynchronous calls.
You can alleviate it by utilizing the synchronous I/O functions for example, but you can't with remote http requests, which are needed client side.
Promise.all definitely is another solution, but the other solution allows you to contain each individual result in a variable, as for Promise.all, you having to keep track of the order of operations.
example; const a = result[0]
Deno is also Javascript, you rtrd, lol.
>they should waste their time on trivialities
this is how we arrived at gmail alone, on a single tab, consuming 500mb of ram
no link? no citation? no nothing?
fuck off retard
fuck javascript
fuck you
when
tomorrow at my place
Yes, but it's better than Node. Did you not understand a one-line post?
Yes deno is way better than node because it doesn't need a package manager, but part of that is because it also have no package to speak of.