Live data from Hacker News

An Absolute Beginner's Guide to Node.js

blog.modulus.io

11–20 of 71 posts

Re: An Absolute Beginner's Guide to Node.js

#12
post #2

> Basically you're telling it to do something and when it's done it will call your function (callback). This is because Node is single-threaded . Do you mean multi-threaded?

No, Javascript has no notion of threads. Rather than true concurrency and a synchronization mechanism, it has callbacks (upon callbacks upon callbacks).

Technically speaking, HTML 5 introduced web-workers which allows javascript to have multiple threads (see 1). However, it's still useful to think about them as being single threaded since workers are sandboxed, meaning they don't have access to the global namespace. This avoids issues commonly found in concurrent programming. E.g., separate threads cannot read and write to the same variable since they don't have access to each other's namespaces.

[1] https://developer.mozilla.org/en-US/docs/Web/Guide/Performan...

Re: An Absolute Beginner's Guide to Node.js

#13
post #8

Great post. Looks like you guys have a cool platform too. Any specifics about how it's better than what's out there?

I'd love to chat about the platform. I'm not sure if this is the correct forum for pimping it. I just don's to turn this comment area into a discussion of the platform. Hit us up on twitter @OnModulus or send an email to feedback@modulus.io.

so modest http://www.enjoy-your-style.com/images/amish-women-swimwear....

Re: An Absolute Beginner's Guide to Node.js

#15
post #9
post #2

> Basically you're telling it to do something and when it's done it will call your function (callback). This is because Node is single-threaded . Do you mean multi-threaded?

The main application runs in a single thread and then I/O activities happen in an event loop running with a small thread pool. Once one of those activities completes the event loop will give a signal to the main thread of the Node app and the callback will be executed. Not sure if that helped or just confused everyone.

So basically if you have an infinite loop in your app's one and only thread, none of the callbacks will happen because they have to run on that one thread?

Re: An Absolute Beginner's Guide to Node.js

#16
Not trying to be flamy, but, once again... why people insist on pushing on projects based on a... renownedly flawed programming language?

..Yea JS.

Today it's clear that the "only" reason for it being used is its widespread availability in browser, but that started in a time when you needed a way to change the mouse pointer from default to a rainbow colored one.

But still js it's the programming language we build frameworks for today, and the kind of industry standard we are proud of.. today.

We are we still stuck at this point? [rhetorical question]

I am not even close to being capable of fixing this by myself so obviously the reason for this comment is just to create my own little tiny wave of resonance, hoping that it could hurt the next bigger wave, hoping this could go on forever.. till the point that js is replaced by something better and wiped forever from planet earth..

Re: An Absolute Beginner's Guide to Node.js

#17
post #16

Not trying to be flamy, but, once again... why people insist on pushing on projects based on a... renownedly flawed programming language? ..Yea JS. Today it's clear that the "only" reason for it being used is its widespread availability in browser, but that started in a time when you needed a way to change the mouse pointer from default to a rainbow colored one. But still js it's the programming language we build fra…

In what way is it flawed?

Re: An Absolute Beginner's Guide to Node.js

#19
post #9

Earlier quoted context omitted.

The main application runs in a single thread and then I/O activities happen in an event loop running with a small thread pool. Once one of those activities completes the event loop will give a signal to the main thread of the Node app and the callback will be executed. Not sure if that helped or just confused everyone.

So basically if you have an infinite loop in your app's one and only thread, none of the callbacks will happen because they have to run on that one thread?

Basically, yes.

Re: An Absolute Beginner's Guide to Node.js

#20
post #17
post #16

Not trying to be flamy, but, once again... why people insist on pushing on projects based on a... renownedly flawed programming language? ..Yea JS. Today it's clear that the "only" reason for it being used is its widespread availability in browser, but that started in a time when you needed a way to change the mouse pointer from default to a rainbow colored one. But still js it's the programming language we build fra…

In what way is it flawed?

http://lmgtfy.com/?q=javascript+design+flaws
Post reply on HN