如题:
typescript与nodejs什么关系? 是没有半毛钱关系,还是亲子关系?
大家讲道理2017-04-17 13:11:51
There is no half-money relationship, one is the language and the other is the operating environment. If I have to say there is a relationship, it’s all related to javascript
. typescript
is a superset of javascript
and can be compiled into javascript
; node.js
is the running environment of javascript
黄舟2017-04-17 13:11:51
Say there is a relationship, they are all connected by js.
It doesn’t matter, they are completely different fields. I haven't used typescript before, so it's hard to say. It should be a sugar-packaging language for js, similar to coffeescript, right? Nodejs takes another path. Nodejs uses chrome's v8 to implement an asynchronous framework or platform. Nodejs is a language, a way of thinking, and a platform. But without js, nodejs can also be implemented in another language (or write an interpreter yourself), but the author considers that the cost is very high. If it is implemented with js, the popularity of js will be relatively high. Also, js itself does not support io (the browser itself). This will give you more motivation to complete asynchronous io... and so on for a series of reasons.