当前位置:网站首页>[dart] a programming language for cross end development
[dart] a programming language for cross end development
2022-07-27 20:51:00 【Candy fan】

Catalog
Web Platform Dart ( Use JavaScript Development and deployment ):
Two 、 To configure Dart development environment :
obtain Dart SDK stay Windows In the environment :
obtain Dart SDK stay Linux In the environment :
OK, As a technical engineer , I want to know everything , So this is Google's programming language for cross end development Dart A record of learning !
free And Open source ???
Let‘s do it !
One 、Dart Language Overview :
Dart It is a language optimized for customers , Fast applications can be developed on any platform . Its goal is to provide the most efficient programming language for multi platform development , It also matches the application framework with a flexible runtime execution platform .
Generally speaking , The programming language will contain some technology barrier , That is, the choice of language in design determines its function and advantages . Dart The language is designed for client development , It gives priority to multi platform (Web, Mobile and desktop ) On the development of ( Sub second state thermal overload ) And high-quality production environment experience .
Dart It's also Flutter The basis of . Dart As Flutter The programming language of the application , It provides an environment for driving application running , meanwhile Dart It also supports many core development tasks , For example, format , Analysis and code testing .
The overview comes from official documents , Maybe this is a very nice A programming language for , It can carry out cross end development (PS: What is cross end development ? Is to write a set of code , The implementation can run on different platforms ! It's kind of similar Java Of JVM, In fact, it is a similar implementation , Because it provides Runtime execution platform )
Dart Language features :
Dart Languages are type safe ; It uses static type checking to ensure the value of variables Throughout Match the static type of the variable . This is also called sound type . Although the type is mandatory , But because of Dart Support type inference , Type annotations are still optional . Dart The type system of is also very flexible , Allow the combination of dynamic Type and runtime checks , During test development , Or when encountering code that needs to be specially specified as dynamic type , This feature is very helpful .
Unlike many other empty security languages , Dart Provide Sound null safety , This means that only if you declare that the value can be empty , Value can be empty ; When Dart When determining that the variable cannot be empty , The variable forever Do not empty . With sound null safety ,Dart Static code analysis can protect you from null exceptions at run time . If you review running code in the debugger , You will see that non nullability is still preserved at runtime ( So it is completely null safe ).
OK, Here we mentioned a bearish value safety , Be similar to Rust Variable variability , It's probably that a so-called variable declared is actually immutable unless it shows that it is declared to be a variable .Dart It can be null only when a reference is declared null , Otherwise, he can never be empty !
Dart library :
Dart Have Rich core library , It provides necessary tools for many daily programming tasks :
For each Dart Built in types provided by the program , Collections and other core functions (
dart:core)Richer collection types , Such as queues 、 Link list 、 Hash graph and binary tree (
dart:collection)It is used to convert encoder and decoder between different data representations , Include JSON and UTF-8 (
dart:convert)Mathematical constants and functions , And random number generation (
dart:math)For the wrong Web Files provided by the application 、 Socket 、HTTP And others I/O Support (
dart:io)Asynchronous programming support , such as
FutureandStreamclass (dart:async)It can effectively handle fixed size data ( for example , Unsigned 8 Byte integer ) and SIMD List of numeric types (
dart:typed_data)For providing C External function interface supported by language style code interoperability (
dart:ffi)Use isolates Concurrent programming — These independent working programs are similar to threads, but they do not share memory and communicate only through messages (
dart:isolate)be based on Web The application needs to work with browser and document object models (DOM) The interaction of HTML Elements and other resources (
dart:html)
In addition to the core library ,Dart Many are also provided through a complete set of software packages API. Dart The team released many useful supplemental packages , for example :
Besides , Third party publishers and the wider community have also released thousands of software packages , Support such functions :
You can visit Library overview , View about Dart A series of examples of the core library . If you want to find something else API, Please see the Common package pages .
Dart platform :
Dart Compiler technology allows you to run code in different ways :
Native platform : For mobile and desktop applications , Dart Have real-time (JIT) Compilation function Dart VM And advance for generating machine code (AOT) compiler .
Web platform : For Web Applications for , Dart Have a development time compiler (dartdevc) And production time compilers (dart2js). Both compilers can convert Dart Convert to JavaScript.

Flutter frame It is a popular multi platform UI tool kit , from Dart Language is strongly driven , Provide a set of tools and UI library , Help developers in iOS、Android、macOS、Windows、Linux and Web Platform construction is excellent UI Experience .
Native platform Dart (JIT and AOT Machine code )
In the development process , A fast development cycle is critical for iterations . Dart VM Provides a real-time compiler (JIT), The compiler has incremental recompile function ( Support for hot overload )、 Run data collection ( For driving DevTools) And rich development and debugging support .
When an application can be deployed to a production environment ( Whether it's publishing to the app store or deploying to the production backend ), Dart AOT The compiler provides native ARM or x64 Machine coded AOT compile . after AOT The compiled application will start stably and quickly .
after AOT The compiled code will be efficient Dart Run in the running environment , The operating environment has a sound Dart Type system , And use fast object allocation and Generational garbage collector To manage memory .
More information :
Web Platform Dart ( Use JavaScript Development and deployment ):
Dart Of Web Support allows you to JavaScript Driven web platform Dart Code . Use Web In the environment Dart when , You can take Dart Compiled to run in the browser JavaScript Code , for example : Chrome Medium V8.
Dart Web It includes an incremental development compiler that can realize a rapid development cycle , There are also compilers optimized for production environments dart2js. The latter uses techniques similar to removing inaccessible code , take Dart Code compiled as fast 、 compact 、 Deployable anytime, anywhere JavaScript.
More information :
Dart Runtime environment :
No matter which platform you use 、 Choose how to build your code , When executing code, you need a Dart Runtime environment . This runtime environment is responsible for the following key tasks :
memory management : Dart Use a managed memory model , Unused memory is collected by the garbage collector (GC) Recycling .
perform Dart The type system of language : Dart Most type checking in languages is static ( Compile time ), But there are still some checks that are dynamic ( Runtime ). such as ,Dart The runtime environment will encounter Type judgment operator Perform dynamic check when .
management isolates: Dart The runtime environment is responsible for controlling the master isolate( Code usually runs here ) And other applications isolate.
On native platforms ,Dart The runtime environment is automatically included in a separate executable , yes dart run Command provided Dart VM Part of .
OK, Indeed, there is not much to say behind , Just copy the official website directly , Links are as follows :
Dart overview | DartDart A brief introduction
https://dart.cn/overview
Two 、 To configure Dart development environment :
obtain Dart SDK stay Windows In the environment :
The installation method provided on the official website :

open Windows Of CMD Command line window :
choco install dart-sdkEnter the above command , Start installation Dart SDK!
SDK By default, it will be installed in C:\tools\dart-sdk. You can change ChocolateyToolsLocation Environment variables to select the installation directory .
If you cannot use it after installation Dart SDK The executable of , Please put SDK Add path to PATH:
open Windows Search for , Input
env.Click on Edit system environment variables .
Click on environment variable (N)….
In the user variables section , choice Path And click the edit (E)….
Click on newly build (N), Input
dart-sdkThe path of .Click... In each open window application (A) or determine , Close the pop-up window and apply the path modification .
obtain Dart SDK stay Linux In the environment :

1. Update source information :
sudo apt-get update2. install apt-transport-https
sudo apt-get install apt-transport-https3. Load profile :
wget -qO- https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/dart.gpgecho 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.flutter-io.cn/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list4. Start installation Dart:
sudo apt-get update
sudo apt-get install dart
The above is the official download method , I tried ......Linux It seems not so good ......
SO, I downloaded. ,ZIP Compressed package :

download ZIP After the package , Select a SDK File path , Configure it profile file , Then casually source Here's the configuration file

The installation is probably completed Dart SDK Is that right ......
If you have any questions, please send a private letter or comment , Reply as soon as you see it ! come on. , With all of you , Mutual encouragement !!!
边栏推荐
- 创新案例 | 本地生活服务数字化,高德品牌升级的增长战略
- MySQL 日志错误日志
- 软件测试面试题:已知一个字符串为“hello_world_yoyo”, 如何得到一个队列 [“hello“,“world“,“yoyo“]
- 【效率】弃用 Notepad++,这款开源替代品更牛逼!
- 2022-07-19 advanced network engineering (XX) BGP route optimization, route optimization analysis one by one
- Ten year test old bird talk about mobile terminal compatibility test
- Management of user organization structure
- Understand the wonderful use of dowanward API, and easily grasp kubernetes environment variables
- Understand │ what is cross domain? How to solve cross domain problems?
- Why are TS slice files generated when easycvr platform turns off video recording?
猜你喜欢

Best practices for Oracle kingbasees migration of Jincang database (4. Oracle database migration practice)

One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress

品牌列表案例

如何监控NVIDIA Jetson的的运行状态和使用情况

Kingbasees heterogeneous database migration guide (4. Application migration process)

Scrollintoview realizes simple anchor location (example: select city list)
![[design tutorial] yolov7 target detection network interpretation](/img/dc/a795dcbd1163df6d8f33704a129d30.png)
[design tutorial] yolov7 target detection network interpretation

程序放在哪儿?

Oracle Xe installation and user operation

JVS基础介绍
随机推荐
如何解决tp6控制器不存在:app\controller\Index
金仓数据库 KingbaseES异构数据库移植指南 (3. KingbaseES移植能力支撑体系)
Advanced SQL skills CTE and recursive query
品牌列表案例
Onion group joined hands with oceanbase to realize distributed upgrading, and global data has achieved cross cloud integration for the first time
Laboratory management system implemented by SSM framework +jsp [source code + database + system paper]
RK3399平台开发系列讲解(进程篇)15.36、理解进程和协程
leetcode:1498. 满足条件的子序列数目【排序 + 二分 + 幂次哈希表】
vi工作模式(3种)以及模式切换(转换)
JVs official account login configuration
【毕设教程】YOLOv7 目标检测网络解读
软件测试面试题:统计在一个队列中的数字,有多少个正数,多少个负数,如[1, 3, 5, 7, 0, -1, -9, -4, -5, 8]
DJI内推码(一码一用,2022年7月26日更新)
[benefit activity] stack a buff for your code! Click "tea" to receive the gift
LabVIEW学习笔记九:捕捉由程序修改控件值产生的“值改变”事件
【数据集显示标注】VOC文件结构+数据集标注可视化+代码实现
Scrollintoview realizes simple anchor location (example: select city list)
Ie11 method of downloading doc PDF and other files
Interviewer: what is the abstract factory model?
[efficiency] abandon notepad++, this open source substitute is more awesome!
https://dart.cn/overview