Live data from Hacker News

Compiled JavaScript with NectarJS can be faster than Node.js and C

blog.seraum.com

21–30 of 30 posts

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#23
post #11
post #4

That the C code is compiled with "gcc -O7" tells me just about everything I need to know about the soundness of these experiments. "-O3" and "-Ofast" are the highest optimisation levels, where "-Ofast" includes optimisations that break some standard-compliant programs (mostly -ffast-math). Not to mention that comparing running times for a single run on an unspecified machine isn't "benchmarking".

Yeah, it's hardly a benchmark. The information what kind of CPU they are using is also missing (why no -march=native?). Despite how unbelievable it looks, I would love to see contents of the final binary to see what is really happening there. gcc code looks quite alright in this case: https://godbolt.org/g/R6iBup

My totally unsupported guess is that they detect pure functions and add implicit memoization. It is relative easy to implement, has good benchmark times if N is big enough but not too big to make the trick obvious, but under the hood it use more memory than you expected.

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#24

gcc should just add a 'remove fibonnaci' optimisation pass, that just optimises this away entirely, and stop people using this benchmark. This is one of the stupidest things I've ever heard of -- I'm going to be really mean now. They want me to use a compiler remotely, every time I want to recompile? So if their servers go down, or my internet connection goes down, I can't even run my compiler? And they have all the…

I'd be particularly curious regarding what the optimized version yields for "fibonacci(78)" - plain JS will get this one wrong, as it runs out of mantissa bits and gives 14472334024676220 instead of the correct 14472334024676221.

Doing an asm.js-style transformation to use machine integers would offer some speedup, but the behavior would differ due to 64-bit integers vs 53-bit.

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#27
post #25

Srsly fellas, do not back this shit! It is not a joke! Idea (to have a compiler that compiles JS to a "native" binary) is good, but this "give me your money" and "cloud" stuff should be annihilated. IMHO Fibonacci benchmarks are doodoo.

While I personally wouldn't buy it if I can help it, I don't see a problem with commercially offering compilers per se. The thing I'm having trouble with is potential injection of code (backdoors, etc.) and other security concerns, eg. if a customer of yours is having an imminent issue with your product, you're dependent on the third party tool provider.

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#28
post #25

Srsly fellas, do not back this shit! It is not a joke! Idea (to have a compiler that compiles JS to a "native" binary) is good, but this "give me your money" and "cloud" stuff should be annihilated. IMHO Fibonacci benchmarks are doodoo.

While I personally wouldn't buy it if I can help it, I don't see a problem with commercially offering compilers per se. The thing I'm having trouble with is potential injection of code (backdoors, etc.) and other security concerns, eg. if a customer of yours is having an imminent issue with your product, you're dependent on the third party tool provider.

I agree that "tool" (in this case compiler) as a service is OK. You're also correct about "trust" aspect (that's what I've meant by "cloud" stuff).

Also In the FAQ on Kickstarter page it says that you'll be able to have your own "Nectar" server, so you don't depend on "Nectar" cloud.

But look at it seriously... 32k USD for a thing that will be probably faced with an open-source (and possibly free) solution.

The amount of "pay me money" features and bullshit:

* ecological

* pay to vote

* Fibonacci benchmark claiming to be faster than C

* claiming to work but actually fails to compile this JS code (as mentioned by johhny in the comments to the article http://blog.seraum.com/compiled-javascript-with-nectarjs-can...):

  var hello = {foo: "Hello, world!"};
  console.log(hello["foo"]);

Re: Compiled JavaScript with NectarJS can be faster than Node.js and C

#29

Everything looks like a scam, see that one, for example, https://github.com/seraum/nectarjs/issues/1 ... and it's getting worse if you dive deep in the source code...

More importantly, that source-code isn't the compiler - it just makes calls to the server that runs the compiler: https://github.com/seraum/nectarjs/blob/master/nectar.js#L52....

We don't even get to see how the compiler works, much less use it to debug when things go wrong.

Post reply on HN