News for hackers. Stuff that matters.
Re:Node v9.4.0 by rf15 on Wednesday January 10, 2018 @11:42AM (#16116428)
I'm always impressed by some of the optimisations they find: 0aa403b649 improves readDouble/readFloat in buffers by 200-800% simply by...moving the code to plain javascript binary operations instead of the C++ runtime.
Re:Node v9.4.0 by coolspot on Wednesday January 10, 2018 @12:10PM (#16116686)
My understanding is that transitions between C++ runtime and JS context are relatively expensive.
Re:Node v9.4.0 by Something1234 on Wednesday January 10, 2018 @01:57PM (#16117760)
What generates that improvement percent confidences that was included in that commit?
Re:Node v9.4.0 by dingdingdang on Wednesday January 10, 2018 @02:18PM (#16117981)
Yeah, could be that you see 200% improvement on first call and then proceed to suffer 2000% slowdown unless this is benchmarked properly.
Re:Node v9.4.0 by __s on Wednesday January 10, 2018 @05:07PM (#16119590)
Given the context it's likely the other way around

Nobody really cares if your 1 call is 20x slower though. Much better to make it 2x faster when there's 100 calls

Re:Node v9.4.0 by Something1234 on Wednesday January 10, 2018 @06:58PM (#16120272)
I was talkiing about the tooling that generated the output, but this is a valid point too. Still want to know what the tooling is.
Re:Node v9.4.0 by rf15 on Sunday January 14, 2018 @12:28AM (#16142948)
They probably just timed execution with a few thousand samples and compared results. Nothing too fancy either way, I think.
Re:Node v9.4.0 by appdrag on Wednesday January 10, 2018 @11:58AM (#16116571)
AWS Lambda is still only supporting Node.js 6.10, they need to move faster...
Re:Node v9.4.0 by tejohnso on Wednesday January 10, 2018 @12:33PM (#16116953)
And Google Cloud Functions are running v6.11.5 [1]. Not much better. Ancient LTS release, and three months behind on patch release.

[1] https://cloud.google.com/functions/docs/concepts/exec

Re:Node v9.4.0 by koolba on Wednesday January 10, 2018 @12:11PM (#16116691)
You can run any Linux binary you'd like if you bundle it yourself. Just use the built-in node runtime as a shim to run your process. It doesn't have to be newer node version Node either ... you can use it to run any standalone executable.
Re:Node v9.4.0 by appdrag on Wednesday January 10, 2018 @12:22PM (#16116829)
So this mean having a multi megabytes zip for the function instead of 1kb with a native runtime, this also affect cold start loading time of the lambda function ...
Re:Node v9.4.0 by Shoothe on Wednesday January 10, 2018 @01:39PM (#16117603)
Does this really affect the cold start? Even if you use the native runtime it still is running in a separate container and you need to start the node process anyway. (Honest question, didn't measure it).

The size would definitely be affected.

Re:Node v9.4.0 by k__ on Wednesday January 10, 2018 @04:02PM (#16119038)
True.

I read that someone builds a Reason/OCaml library with Node.js like API that compiles to native binaries, but uses OCaml standard libary functions in the background, which could probably get much smaller than Node.js.

Re:Node v9.4.0 by Osiris on Wednesday January 10, 2018 @01:32PM (#16117542)
Azure App Services / Functions support up to 8.9.3. They move pretty quick to add new node releases.
Re:Node v9.4.0 by nfriedly on Wednesday January 10, 2018 @03:21PM (#16118664)
Bluemix's OpenWhisk has been much better about keeping up with Node.js releases FWIW. (I used to work for IBM.)
Re:Node v9.4.0 by bdcravens on Wednesday January 10, 2018 @05:58PM (#16119945)
For the longest time they were still on 0.10. (deprecated 11/16, fully removed 4/17)
Re:Node v9.4.0 by johnsonjo on Wednesday January 10, 2018 @02:19PM (#16117985)
I'm still awaiting async iterables [1] in Node.js. It's not part of ECMAScript yet, but I'm still excited for it. Chrome 63 and v8 6.3 enables async iterables, but this Node.js version (v9.4) uses v8 6.2 so no async iterables yet. Does anyone know whether a version of Node sticks with the same version of v8 throughout? So, is there any chance that a node version 9 will have v8 greater than 6.2?

[1]: https://github.com/tc39/proposal-async-iteration

Re:Node v9.4.0 by WorldMaker on Wednesday January 10, 2018 @03:40PM (#16118850)
I believe that Node has been treating v8 upgrades as semver major breaking changes as it changes the ABI for native extensions, even though there are enough mitigating tools these days that most native extensions don't break on v8 upgrades.
Re:Node v9.4.0 by vijaybritto on Wednesday January 10, 2018 @12:24PM (#16116854)
I hope they release a cross platform installation script or binary that can manage multiple versions like nvm(doesn't work on windows). Hmm, since I'm learning Go now this might be a good exercise.
Re:Node v9.4.0 by neilcarpenter on Wednesday January 10, 2018 @01:02PM (#16117225)
Depending on what you're doing, you could try npx: https://medium.com/@maybekatz/introducing-npx-an-npm-package...
Re:Node v9.4.0 by vijaybritto on Wednesday January 10, 2018 @02:47PM (#16118300)
Im talking about installation in a new system or a docker container.
Re:Node v9.4.0 by altano on Wednesday January 10, 2018 @12:40PM (#16117029)
nvm works on Windows for me?
Re:Node v9.4.0 by dvlsg on Wednesday January 10, 2018 @12:48PM (#16117100)
Same here. It's a separate application from the non windows versions though. I seem to remember having to search explicitly for the windows version.
Re:Node v9.4.0 by tootie on Wednesday January 10, 2018 @01:07PM (#16117279)
Do you use Chocolatey? I just did `choco install nvm`.

https://chocolatey.org/

Re:Node v9.4.0 by atomicfiredoll on Wednesday January 10, 2018 @01:17PM (#16117372)
You may be running nvm-windows, which is a separate project run by different developers.
Re:Node v9.4.0 by steveklabnik on Wednesday January 10, 2018 @01:21PM (#16117416)
I use 'nodist', which happens to be written in Go, if you need some inspiration!
Re:Node v9.4.0 by vijaybritto on Wednesday January 10, 2018 @01:31PM (#16117527)
oh yeah great one. Thanks.
Re:Node v9.4.0 by cridenour on Wednesday January 10, 2018 @12:11PM (#16116692)
It's a shame that updating node via homebrew is such a pain that I probably will skip this version.

Maybe it's just me, but every upgrade corrupts the global node_modules.

Re:Node v9.4.0 by vmware513 on Wednesday January 10, 2018 @01:40PM (#16117609)
Re:Node v9.4.0 by beart on Wednesday January 10, 2018 @12:17PM (#16116757)
I'm not sure how homebrew works but most of the node version managers will keep independent global installation folders for a version of node.

You could try using something like nvm which has a command to migrate your old global modules.

nvm install node --reinstall-packages-from=node

Re:Node v9.4.0 by code-e on Wednesday January 10, 2018 @12:27PM (#16116897)
Are you talking about native modules that need to be rebuilt when the V8 version used by node is also upgraded?
Re:Node v9.4.0 by minxomat on Wednesday January 10, 2018 @12:16PM (#16116755)
Shouldn't nvm (node version manager) work? I rarely install node via any package manger, nvm provides some nice management features.
Re:Node v9.4.0 by apazzolini on Wednesday January 10, 2018 @12:23PM (#16116835)
https://github.com/tj/n is also a good version manager for node.
Re:Node v9.4.0 by miduil on Wednesday January 10, 2018 @12:39PM (#16117013)
--no-check-certificate for something that is intended to install software is unacceptable.

https://github.com/tj/n/pull/475/files

I guess nvm is better, needs some polishing, though (error prone for scripted usage, because of unpredictable exit > 0 behavior.

https://github.com/creationix/nvm

Re:Node v9.4.0 by coding123 on Wednesday January 10, 2018 @12:44PM (#16117062)
I tried nvm and it didn't even install correctly. I tried n just now and it works beautifully! thanks for the ref. Nice that it is from tj.
Re:Node v9.4.0 by zumu on Thursday January 11, 2018 @03:26AM (#16122246)
Why not use a version manager like n or nvm?
Re:Node v9.4.0 by cdetrio on Wednesday January 10, 2018 @01:13PM (#16117332)
any signs yet of support for Web Workers?
Re:Node v9.4.0 by caffed on Wednesday January 10, 2018 @01:21PM (#16117417)
Web Workers are a browser only framework. You can use child_process.fork: https://nodejs.org/api/child_process.html#child_process_chil...

or maybe WebWorker Threads for API compatible framework: https://www.npmjs.com/package/webworker-threads

Re:Node v9.4.0 by kapv89 on Thursday January 11, 2018 @04:08AM (#16122426)
Take a look at microsoft's napajs: https://github.com/Microsoft/napajs