Why is node. js so hot, while the same asynchronous Pattern Python framework Twisted has been tepid for more than 10 years?

Source: Internet
Author: User
Tags posix

Twisted is a powerful asynchronous network framework with a wide range of applications, but the node. JS fire, which has not been present for several years, is rarely a poor community or document.
I think the two are essentially the same, and Python is easier to use.

Anonymous user

Because, it gives a large part of the program ape illusion such as the front and back of unity, script can also performance very dick, do the demo search fast what, but in fact, this is just a hallucination ...

It is because of this illusion is "can see", there is a well-to-do Google, so node's exposure rate is much higher than the back-end of the conventional language is not surprising.

On speed, you have a JIT with the regular scripting language of the virtual machine than, not to the magnitude of the difference is not embarrassing? Memory of all kinds of strange occupation lost not ashamed? The web and cpython+gevent a level than pypy lose disgrace?
On stability, Python 10 years of accumulation, the experience of large companies, you a desktop system as the goal of V8 to do the project to tease me to play?
On the management of code, JS that kind of bizarre trap to play together? Callback Hell?

Frankly speaking, front-end engineers at the level of the average number of people too much, to make things can be seen, more attractive than the head of the server to cultivate the system of systems engineers to high. Technical newcomers are often seen to be attracted first, but not in depth how to know the rigor of the system? Node one out of the former feel a variety of bunker, think system Engineer is die and then propaganda, such as you look at me a day out of a real-time web, but also with a bunker of the front-end implementation, look at your system engineer, OH ah. Full stack Oh, how much memory does a socket connection cost? You're talking to me about full stack?

So, this is not impetuous propaganda what is this? Systems engineering is very rigorous, often not only deal with code, the final output is not what performance, many design many of the final service is the stability of the backend system, extensibility and other things related to money, you run to talk to me about running cycle? The loop can make a hammer?

As for the Python xxx Why not fire, callback long have twisted, the new generation also has tornado,coroutine have gevent,actor PULSAR,VM aspects to be safe CPython, to Performance PyPy, To concurrent Stackless,aio the choice of God horse too much, you like what you have, the community to operate to publicize how to make, hand too many cards have wood. Node does not have such a history of baggage, a choice, natural all the community's power and propaganda can be concentrated on this, coupled with the low threshold, you see how many books, not fire is not scientific.

But, does the project and the fire not fire have the hair relations?

Bhuztez, long-term job

The key is to do well in marketing. That's because twisted has nothing to do with the technical flaws of node. JS, which is not objective.

Like what

node solves this problem by forcing asynchronous IO operations that enable the event driven model to execute efficiently
This is too much to take for granted. Not even the author of node. JS would say so. You must not know what POSIX is. According to POSIX definition, a file descriptor if the corresponding is a normal file, regardless of any non-blocking or async options can be set, it must block. node. JS also only opens a thread pool behind the scenes. There is no difference between this and twisted, and it is worse than twisted. Twisted implements the function of the thread pool and exposes the API to you, so you can run into something else that can't be done asynchronously, and you could use the twisted thread pool. and node. JS does not plan to provide a thread pool for a long time, or the node. JS thread pool is just that you don't have C + +.

In addition, without preemptive scheduling, you will inevitably want to review the code. Some code consumes too much CPU compared to other code and becomes a bottleneck. It's a lot harder to check this than to call the block code. Python no longer moral integrity, at least the library also put the language of its own AST exposed, it is easy to write a script to check out, ready-made Python code check tool is not more difficult than JavaScript, JavaScript language design is a drag.
One of the reasons is that JS can conveniently interpolate functions in an expression, can you put a statement in a Python lambda?

It is important for a lambda to write easily if it is to be distorted into asynchronous writing. Twisted have inlinecallbacks and do not need distortion.

python This language to do nodejs asynchronous things, the language Support CPS transformation is only OK

The reason is that V8 was far from yield. It is not necessary to look at node. js for the V8 without yield and without the spidermonkey of yield already. This choice is purely for marketing. Python has yield, there is no need to engage in a CPS transformation.

Tornado

It was tornado that made twisted better. Before twisted in the web aspect did not spend too much energy, cause twisted.web also just can use, far not to be good. But tornado in addition to Web Parts do better, other places are not as good as twisted. As long as the Tornado Web Part of the transplant to twisted, twisted web is not rotten. There was a project called Cyclone that did this. I'm not going to tell you that running is better than the original tornado.

-----------------------------------------------------

When node. JS is not up yet, the twisted developers have long known that only async is bad, and when they know that the language is Erlang, they start to recommend using Erlang. When node. js just came out, it wasn't, obviously, a comparison with Erlang.

Marketing done well is the key to node. JS fire up.

If you remember the number of lines that wrote an IRC slides. In general, the author of node. js, when comparing Event-driven and Apache with the fork process, is well-reasoned to point out the merits of event-driven. But in contrast to other models, he was talking about feelings. He said it would be an illusion to distinguish between the invocation of an operation that cannot be returned immediately and the general function call. In this way, only the asynchronous callback can be written into an advantage immediately. The most deadly shortcomings of node. js are packaged into advantages, and no moral integrity to motivate a group of people to engage in meaningless benchmark, immediately avoiding the unfavorable situation. Shouting slogans is always the easiest, event-driven is high performance, library is a burden, asynchronous callback hell is good is good is good. The fire got up.

That's it

Liu Yan, System Programming

Before python increases yield with the return value, the twisted code is all callbacks, and the program structure is quite twisted. In Python, the code-focused language, twisted is really out of tune. Most python programmers are afraid to run away without reading the deferred.

And the callback to JS programmer is not a thing at all.

Anonymous user

First of all, the ranking of the first big talk Nodejs weak explosion, System Engine is hanging people do a cynical-really do nodejs if not familiar with V8 engine and LIBUV actually can only be artificial periphery it? And who is familiar with V8 and LIBUV not a solid System Engine base (not a seven or eight-year C/S Project Foundation can play V8 and libuv that is rare)? And then say what the Nodejs people don't know how much memory websocket consumes. Are you sure the hit face is not too big? Do you have some beginner Nodejs developers who give you the illusion and then you're superior to the edge?

At this point in the discussion of technology, the discussion is not technology at all, but their own preferences, their own circles and likes and dislikes. Ridicule can, but really is a little nutrition is not. And those who agree with him, I just want to ask you really have studied Nodejs?

Split line Below is the previous answer.

-----------------------------------------------

Said Nodejs just rely on marketing is too naïve? When the Nodejs came out of the various bugs, I simply test its large file transfer will appear a variety of problems. Other camps in the same period had already dumped several streets. But why do you keep growing? Just by the so-called marketing and flicker?

If only isolated to consider the Nodejs of the asynchronous library in the end, it is too one-sided, is it NODEJS only provide asynchronous network IO?

In fact,Nodejs provides a common set of asynchronous infrastructures that allow you to build various asynchronous APIs based on this. Asynchronous Network IO is only a specific application on it. And now the twisted mentioned in the question actually does not have the comparability with Nodejs at this point at all!

The reason I chose Nodejs is largely because it is JavaScript, so that I can complete the project in the same language in the front and back, which is a great advantage! In addition, although Nodejs is not unique, it is not the first JavaScript-based service-side scenario. But it's the best in the same time performance JavaScript camp.

Plus the LIBUV design at the bottom of the Nodejs is simple, very easy to expand, and NPM is so useful. As a result, development efficiency has risen rapidly.

Choose Nodejs in the end why, in fact, now, many people have their own reasons. But many people are because he is a low-cost solution based on JavaScript .

Why is node. js so hot, while the same asynchronous Pattern Python framework Twisted has been tepid for more than 10 years?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.