📅  最后修改于: 2021-01-11 13:03:28             🧑  作者: Mango
Dart是具有C样式语法的开放源代码,通用,基于类的面向对象语言,可以选择将其编译为JavaScript。它用于构建移动,桌面和Web应用程序。它支持各种编程概念,例如接口,类,集合,泛型,mixin和可选类型。它由Google开发,后来被ECMA集团批准为标准。 Dart的原始版本是2013年11月。
Dart可用于创建仅适用于网站和Web应用程序的单页应用程序。单页应用程序允许在网站的屏幕之间进行导航,而无需在浏览器中加载其他网页。一个经典的例子是Gmail。在Gmail中,当您单击收件箱中的邮件时,浏览器会停留在同一网页上,但是JavaScript代码会隐藏收件箱并将邮件正文显示在屏幕上。
Dart的优势
TypeScript是一种开源的纯面向对象编程语言。它是JavaScript的强类型超集,可编译为纯JavaScript。 TypeScript由Microsoft根据Apache 2许可开发和维护。它不是直接在浏览器上运行。它需要编译器才能在JavaScript文件中进行编译和生成。 TypeScript源文件的扩展名为“ .ts”。
我们可以将Typescript用于服务器端和客户端Web应用程序。它也用于开发大型Web应用程序。它增加了对ECMAScript中存在的各种功能的支持,该功能由ECMA组的TC39委员会维护。
Anders Hejlsberg开发了TypeScript。其第一个版本于2012年10月向公众发布。经过Microsoft两年的内部开发, TypeScript 0.9的新版本于2013年发布。 TypeScript的当前版本是TypeScript 3.4.5 ,该版本于2019年4月24日发布。
TypeScript的优点
从下表我们可以了解TypeScript和Dart之间的主要区别。
TypeScript | Dart | |
---|---|---|
Introduction | TypeScript is an open-source pure object-oriented programing language. It is a strongly typed superset of JavaScript which compiles to plain JavaScript. | Dart is an open-source, general-purpose, class-based, object-oriented language with C-style syntax which can optionally transcompile into JavaScript. |
Owned by | Microsoft | |
Created by | Anders Hejlsberg | Lars Bak and Kasper Lund |
First release | The first release of TypeScript is in October 2012. | The first release of Dart is in November 2013. |
License | Apache 2.0. | Barkley Software Distribution (BSD). |
Current version | The current version of TypeScript is 3.5.3 in July 2019. | The current version of Dart is 2.4 in June 2019. |
Design | It is a typed superset of JavaSript. | It is a full scripting language, not a superset of JavaSript. |
Operator overloading | It does not support operator overloading. | It supports operator overloading. |
Libraries | There is a moderate number of libraries available. | There is a higher number of libraries available as compare to TypeScript. |
Tooling Support | TypeScript supports the following tools:
|
Dart supports the following tools:
|
Build tools | It has its own build tool. | It supports all major JavaScript build tools (Browserify, Gulp, Grunt, Webpack, etc.) |