1# ArkCompiler Development 2 3## Introduction 4ArkCompiler is a unified programming platform. Its key components include a compiler, toolchain, and runtime. ArkCompiler supports compilation and running of high-level programming languages on the multi-chip platform and accelerates the running of applications and services on mobile phones, PCs, tablets, TVs, automobiles, and smart wearables. 5 6## Environment Setup 7Ubuntu 18.04 or later is recommended. 8 91. Install dependent tools. 10 ```shell 11 sudo apt-get update && sudo apt-get install python ruby python3-pip git-lfs gcc-multilib g++-multilib zlib1g-dev libc++1 curl nodejs 12 ``` 132. Install the **repo** tool. 14 ```shell 15 mkdir ~/bin/ 16 curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > ~/bin/repo 17 chmod a+x ~/bin/repo 18 export PATH=~/bin:$PATH 19 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests 20 ``` 213. Download source code. 22 ```shell 23 repo init -u https://gitee.com/ark-standalone-build/manifest.git -b master 24 repo sync -c -j8 25 repo forall -c 'git lfs pull' 26 ``` 27 284. Install the compiler and binary tool. 29 ```shell 30 ./prebuilts_download.sh 31 ``` 32 33## How to Develop 34 351. Create the build products **ark_js_vm** and **es2panda**. 36 ```shell 37 python ark.py x64.release 38 ``` 39 - **ark_js_vm**: executable program for running .abc files. 40 - **es2panda**: tool that converts ArkTS files into ArkCompiler bytecode files. 41 422. Use **es2panda** to convert a TypeScript file to an .abc file. 43 ```shell 44 out/x64.release/arkcompiler/ets_frontend/es2abc helloworld.ts 45 ``` 46 Code snippet of the TypeScript case file **helloworld.ts**: 47 ```JavaScript 48 declare function print(arg:string):string; 49 print('Hello world!'); 50 ``` 51 523. Run the generated .abc file. 53 ```shell 54 out/x64.release/arkcompiler/ets_runtime/ark_js_vm helloworld.abc 55 ``` 56 .abc file: ArkCompiler bytecode file. 57 58 The execution output is as follows: 59 ``` 60 Hello world! 61 ``` 62 63## Running the Test262 Test Suite 64``` 65python ark.py x64.release test262 66``` 67 68## Build Options 69 70Select a build mode, for example, mode for building a debug version on an x64 platform. 71``` 72python ark.py x64.debug 73``` 74Obtain help information. 75``` 76python ark.py --help 77``` 78