News for hackers. Stuff that matters.
Re:Ncc: Node.js Compiler Collection by Sir_Cmpwn on Monday November 26, 2018 @04:19PM (#18536887)
This just looks like a bundler. The thing about gcc, the name you're aping here, is that it's a collection of compilers. This looks like neither a compiler nor a collection of them.

As far as I can tell this seems to be approximately 2,000 lines of JavaScript (half of which is tests) that wires together existing tools in an rather un-novel way. Or, in other words: an ad for "zeit".

Re:Ncc: Node.js Compiler Collection by SOLAR_FIELDS on Monday November 26, 2018 @04:27PM (#18536943)
I thought the same when I read the article. It sounds like it’s just a wrapper around webpack. Why wouldn’t I just use webpack aside from this tool being marginally faster? Is there something I’m missing here? Couldn’t we just take their improvements and implement them in webpack?
Re:Ncc: Node.js Compiler Collection by Rauchg on Monday November 26, 2018 @04:33PM (#18536991)
The goal is to provide the experience that many other languages have, where you don’t configure anything. You just run “$tool build”
Re:Ncc: Node.js Compiler Collection by idle_zealot on Monday November 26, 2018 @06:16PM (#18537733)
Generally $tool has a config file in the root of the project or similar. Webpack and other js compilers/bundlers are the same.
Re:Ncc: Node.js Compiler Collection by Sir_Cmpwn on Monday November 26, 2018 @05:21PM (#18537374)
Webpack works with no configuration as of version 4.
Re:Ncc: Node.js Compiler Collection by Rauchg on Monday November 26, 2018 @04:32PM (#18536984)
The goal is precisely to not just bundle, but incorporate important optimizations like the V8 Compile Cache (https://github.com/zeit/ncc/issues/51), which is what inspired the project and name to begin with.
Re:Ncc: Node.js Compiler Collection by Sir_Cmpwn on Monday November 26, 2018 @04:36PM (#18537020)
Seems like it'd be better as a webpack plugin. It's still not a compiler, by the way, nor a compiler collection, even with this feature included.
Re:Ncc: Node.js Compiler Collection by peter-m80 on Monday November 26, 2018 @04:44PM (#18537081)
It is a compiler. Literally
Re:Ncc: Node.js Compiler Collection by Sir_Cmpwn on Monday November 26, 2018 @05:18PM (#18537355)
It seems to me that the compiler here is V8.
Re:Ncc: Node.js Compiler Collection by jdc on Monday November 26, 2018 @08:59PM (#18538675)
One of these things is not like the other.
Re:Ncc: Node.js Compiler Collection by Rauchg on Monday November 26, 2018 @04:46PM (#18537110)
It’s definitely possible to extract some internals as plugins, but not all currently.

It would make more sense as a collection of plugins, and perhaps exposed as a preset.

But the intent is to precisely remove the extra setup, when all you need to do is publish your Node.js codebase as a single file.

Re:Ncc: Node.js Compiler Collection by iforgotpassword on Monday November 26, 2018 @04:46PM (#18537098)

    cat **.js > myprog.js
Re:Ncc: Node.js Compiler Collection by Rauchg on Monday November 26, 2018 @04:52PM (#18537161)
Ncc handles bundling `node_modules`. Your suggestion also introduces problems by not respecting commonjs module boundaries. (They’re akin to function scopes)
Re:Ncc: Node.js Compiler Collection by oso2k on Monday November 26, 2018 @05:05PM (#18537252)
This should be a `Show HN:`. OP is an author of the linked article.
Re:Ncc: Node.js Compiler Collection by randiantech on Monday November 26, 2018 @04:52PM (#18537160)
I will definitely give ncc a try. Our published npm artifacts on Artifactory are big, mainly because we are forced due to company policies to bundle node_modules into them. Npm installing them on our on premise instances are the main bottleneck of the deployment process.
Re:Ncc: Node.js Compiler Collection by tracker1 on Monday November 26, 2018 @06:07PM (#18537687)
if you can use `npm ci` closer to the release pipeline that can help. As will running SSD/NVME on the build/release server and zipping for transfer to/from artifact servers.
Re:Ncc: Node.js Compiler Collection by rafaelgarrido on Tuesday November 27, 2018 @12:53PM (#18544696)
As other people mentioned before, the name is misleading. This project's analogy is closer to a linker than a compiler collection. Is this emitting any compiled code at all or just bundling functions? What is the roadmap for this project?
Re:Ncc: Node.js Compiler Collection by regularfry on Tuesday November 27, 2018 @02:57AM (#18540384)
This looks really interesting to me.

One of the things we're going through on our app right now is react-loadable style per-component bundling. The analogy would be to building .so files with GCC. Do you have any plans for ncc to address that use case?

Re:Ncc: Node.js Compiler Collection by stcredzero on Monday November 26, 2018 @07:19PM (#18538102)
How about a fork that adds the suffix "-1701"? Subsequent versions could add letters, like a, b, c, d...
Re:Ncc: Node.js Compiler Collection by tuananh on Monday November 26, 2018 @11:19PM (#18539326)
i don't get how is this a compiler?
Re:Ncc: Node.js Compiler Collection by sick_of_web_dev on Monday November 26, 2018 @05:29PM (#18537442)
Where's the compiler or even the collection of compilers in this? See this is why I'm sick of web dev, another project by "developers" who don't even know what a compiler is and on top of this name it ncc just to make it sound more important, lol.
Re:Ncc: Node.js Compiler Collection by sctb on Tuesday November 27, 2018 @05:14PM (#18547352)
Could you please not post unless you have something civil and substantive to say? We eventually ban accounts that only post snark.

https://news.ycombinator.com/newsguidelines.html