Live data from Hacker News

Node-fib: Fast non-blocking fibonacci server

github.com

61–70 of 124 posts

Re: Node-fib: Fast non-blocking fibonacci server

#61
post #24

Earlier quoted context omitted.

you realize that you're just making Ted's point for him from the opposite direction, right? his point, when you look behind the trolling, is that node.js is not magical special sauce and that shitty coders who write poorly-scaling code will be shitty coders who write poorly-scaling code no matter what technology they use -- the "cancerous" properties of node arise simply because of the amount of groupthink that pitch…

Personally I've never seen node.js pitched as a solution for newbies or sub-par coders toiling away in the enterprise trenches. I've always seen it marketed as a useful tool for people who know WTF they're doing.

buzz is omnidirectional -- when people start talking about a technology, platform, or stack, people of all shapes and colors will show up and use it. and when your product pitches itself as having super amazing performance due to this programming paradigm omg!, you are responsible for making its limitations known to all and sundry who use it, rather than assuming prior knowledge.

also, the joyent node.js homepage itself claims, as a business advantage:

  "• Huge JavaScript developer pool at the ready for faster development"
implying that any Javascript developer can just dig their hands right into server code and get working.

Re: Node-fib: Fast non-blocking fibonacci server

#62
post #57

Note to Ted: next time, just use sleep().

To which the response is the same: simply don't block the event loop and use setTimeout.

The whole cancer thing is based on the premise that blocking the event loop is unavoidable. I'm attempting to say that it isn't. Jerf's points about how it can happen accidentally are perfectly valid, it's up to the developer not to do something stupid and to actually have decent tests and benchmarks in place - as it would be with any approach.

Its certainly true that significantly poor performance in code which doesn't release the loop will degrade a single-threaded event loop far more than a threaded approach.

Re: Node-fib: Fast non-blocking fibonacci server

#63
post #28

Earlier quoted context omitted.

How so? IMHO, it's an elegant demonstration of the async module.

Check out the Cilk version, which is not only concurrent but parallel as well: http://myxman.org/dp/node/182 I agree with jerf that either you shouldn't have to worry about splitting your computation at all or at least you should have syntactic sugar for it. The Node solution has much more noise than code.

http://hpaste.org/52109, in case one prefers to be more explicit.

Re: Node-fib: Fast non-blocking fibonacci server

#64
post #61

Earlier quoted context omitted.

Personally I've never seen node.js pitched as a solution for newbies or sub-par coders toiling away in the enterprise trenches. I've always seen it marketed as a useful tool for people who know WTF they're doing.

buzz is omnidirectional -- when people start talking about a technology, platform, or stack, people of all shapes and colors will show up and use it. and when your product pitches itself as having super amazing performance due to this programming paradigm omg! , you are responsible for making its limitations known to all and sundry who use it, rather than assuming prior knowledge. also, the joyent node.js homepage it…

Right, let's just stop talking about cool new technologies since some people might misuse them. Does anyone want to help me debug my webapp? It's written in C.

Re: Node-fib: Fast non-blocking fibonacci server

#65
post #61

Earlier quoted context omitted.

buzz is omnidirectional -- when people start talking about a technology, platform, or stack, people of all shapes and colors will show up and use it. and when your product pitches itself as having super amazing performance due to this programming paradigm omg! , you are responsible for making its limitations known to all and sundry who use it, rather than assuming prior knowledge. also, the joyent node.js homepage it…

Right, let's just stop talking about cool new technologies since some people might misuse them. Does anyone want to help me debug my webapp? It's written in C.

nice strawman.

my point isn't that you shouldn't build up buzz. it's that, when buzz exists around something, your job as a platform implementor includes making people aware of the things your product can't do well, and pitfalls the end-user might run into.

saying "well, it's their own fault for not being clueful enough to know what they were doing wrong, this technology is for pro hackers only!" is developer-hostile.

Re: Node-fib: Fast non-blocking fibonacci server

#66
post #59
post #24

Earlier quoted context omitted.

you realize that you're just making Ted's point for him from the opposite direction, right? his point, when you look behind the trolling, is that node.js is not magical special sauce and that shitty coders who write poorly-scaling code will be shitty coders who write poorly-scaling code no matter what technology they use -- the "cancerous" properties of node arise simply because of the amount of groupthink that pitch…

to expand upon this, here are some other representative Ted Dziuba posts: http://teddziuba.com/2010/10/taco-bell-programming.html http://teddziuba.com/2011/02/the-case-against-queues.html http://teddziuba.com/2011/03/osx-unsuitable-web-development.... http://teddziuba.com/2008/09/a-web-os-are-you-dense.html if I had to sum up his philosophy in three sentences, here they are: your job is software engineering. every bi…

Any decent troll needs a nugget of truth at the bottom to hook people in.

Re: Node-fib: Fast non-blocking fibonacci server

#67

The only difference in this implementation is that it uses memory-based caching (memoization) to compute given value once and then serve the cached copy. Of course this is fast for 1000 iterations, since the effective cost is zero from the second request. People really are misunderstanding the critique of fibbonacci as representing any CPU intensive task. TLDR; All the author did here was remove the CPU intensity by…

I'm actually very confused by his criticism. You can write a CPU intensive task in any language, and you'll have the same problem. Or is that the point? Some people believe Node.js will magically make all processing computations = 0? I'm all for discouraging the rumor that Node.js will solve every problem, but don't call it Cancer.

The issue is what happens when you write that CPU intensive task. If you do it in idiomatic Go, that same server will keep on responding to other requests in the meantime. With Node.js, that is not the case. You have to do things like, well, what this article does, to get it to work.

Re: Node-fib: Fast non-blocking fibonacci server

#68
post #32

Author here, didn't really expect this to get picked up anywhere but since it has I'd like to point out the idea was to demonstrate that computationally expensive algorithms can be split across multiple iterations of the event loop to avoid blocking it. In this case concurrent requests take advantage of each others' memoisation, which would be somewhat trickier to do with threads as you'd probably need to worry about…

If I try to ask for a large number (say 1 million) I run out of RAM: $ node app.js FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory Somehow you're using O(n) RAM to do the calculation. Seems bad bro. This code is the epitome of roflscale

That's a consequence of memoisation. It scales better than the original code though.

Still, the original point (node is cooperatively multitasked) was clear. Anything beyond that and I just want to reach for better Fibonacci algorithms.

Re: Node-fib: Fast non-blocking fibonacci server

#69
post #24

Earlier quoted context omitted.

you realize that you're just making Ted's point for him from the opposite direction, right? his point, when you look behind the trolling, is that node.js is not magical special sauce and that shitty coders who write poorly-scaling code will be shitty coders who write poorly-scaling code no matter what technology they use -- the "cancerous" properties of node arise simply because of the amount of groupthink that pitch…

Personally I've never seen node.js pitched as a solution for newbies or sub-par coders toiling away in the enterprise trenches. I've always seen it marketed as a useful tool for people who know WTF they're doing.

[deleted]

Re: Node-fib: Fast non-blocking fibonacci server

#70
post #24

Earlier quoted context omitted.

you realize that you're just making Ted's point for him from the opposite direction, right? his point, when you look behind the trolling, is that node.js is not magical special sauce and that shitty coders who write poorly-scaling code will be shitty coders who write poorly-scaling code no matter what technology they use -- the "cancerous" properties of node arise simply because of the amount of groupthink that pitch…

Personally I've never seen node.js pitched as a solution for newbies or sub-par coders toiling away in the enterprise trenches. I've always seen it marketed as a useful tool for people who know WTF they're doing.

You haven't read the node.js homepage, specifically the bit Ted quotes "Because nothing blocks, less-than-expert programmers are able to develop fast systems."?
Post reply on HN