This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
| Ark Compiler | |
|---|---|
| Developer | Huawei |
| Initial release | August 9, 2019; 6 years ago (2019-08-09) |
| Written in | ArkTS,Cangjie,JS,C,C++ |
| Operating system | EMUI (HMSApk apps),HarmonyOS,OpenHarmony,Oniro |
| Platform | ARM,RISC-V,x86,x64, LoongArch, Lingxi[1] |
| Type | Compiler,Runtime environment,Compiler front end,Toolchain |
| License | Mixed:Proprietary (HarmonyOS),Apache License (OpenHarmony,Oniro (OpenArkCompiler),Android (ArkCompiler) |
Ark Compiler, also known asArkCompiler, is a unified compilation and runtime platform byHuawei that supports joint compilation and running across programming languages and chip platforms, also operating systems ofopen-sourceOpenHarmony,Oniro, alongside proprietaryHarmonyOS with single core systemHarmonyOS NEXT included on nativeAPP inEvent-driven programming in a unified development environment and formerly built forAndroid-basedEMUI for Huawei smartphones and tablets withHMS-enabledapk apps onAppGallery that improves app performance.[2] It supports a variety of dynamic and static programming languages including Java, C++,[3]JavaScript,TypeScript, andArkTS. It is the compilation and runtime base that enables OpenHarmony, Oniro OS alongside HarmonyOS NEXT to run on multiple device forms such as smart devices, mobile phones, PCs, tablets, TVs, automobiles, and wearables. ArkCompiler consists of two parts, compiler toolchain and runtime.[4]
Huawei initially open sourced Ark Compiler forAndroid platform onGitHub, on September 9, 2019, as they were transitioning away from the operating system viaUS sanctions.[5] Then the company, open sourced Ark Compiler with OpenArkCompiler as part of the Huawei Ark Compiler open source project (HACOSP) in early February 2022[6] and ArkJS_runtime, in the previous year in September 2021 after two years of inception in August 2019.[7]
ArkCompiler has a built-in componentized and configurable multi-language compilation and runtime platform ofOpenHarmony and HarmonyOS withHarmonyOS NEXT. It contains the core components such as the compiler, toolchain, and runtime. It supports compilation and running of high-level programming languages on the multi-chip platform. ArkCompiler JS Runtime provides the capability of compiling and running the JavaScript (JS) language on the OpenHarmony operating system side.
ArkCompiler JS Runtime consists of two parts such as the JS compiler toolchain and JS runtime. The JS compiler toolchain compiles JS source code into ArkCompiler bytecodes. The JS runtime executes the generated ArkCompiler bytecodes.[8]
| HarmonyOS Runtime | |
|---|---|
| Developer | Huawei |
| Written in | ArkTS,Cangjie,C,C++,JS |
| Operating system | HarmonyOS |
| Platform | ARM,RISC-V,x86,x64, LoongArch, Lingxi[9] |
| Type | Runtime environment |
| License | Proprietary |
| Ark Runtime | |
|---|---|
| Developer | Huawei |
| Written in | ArkTS |
| Operating system | HarmonyOS (HarmonyOS NEXT),OpenHarmony,Oniro |
| Platform | ARM,RISC-V,x86,x64, LoongArch, Lingxi[10] |
| Type | Runtime environment,Compiler front end,Toolchain |
| License | Proprietary,Apache License (OpenHarmony ArkCompiler Runtime Core),Eclipse Public License (Oniro) |
The common module of language runtime inOpenHarmony operating system called ArkCompiler Runtime Core also created as Ark Runtime on top of HarmonyOS Runtime base on current dual-framework, alongside single framework OpenHarmony-basedHarmonyOS NEXT which consists of language-independent basic runtime libraries, including ArkCompiler File, Tooling, Base and ISA. The ArkCompiler File provides bytecodes and information required for executing the bytecodes. Tooling supports the runtime debugger. The Base is responsible for implementing platform related utilities. ISA function provides common instruction set architecture that is language-independent that allows to run HarmonyOS applications regardless of different instruction set and chipsets in hardware with great compatibility of diverse set of hardware and interoperability between HarmonyOS, Oniro and OpenHarmony software and hardware ecosystems.[11]
ArkCompiler JS Runtime is the default JS runtime on OpenHarmony. It supports ECMAScript libraries and efficient container libraries. It also provides a set of native APIs forC++ andJS interaction and a variety of garbage collectors that features high performance.[12]
ArkCompiler eTS Runtime is a runtime used inArkTS applications derived from former HarmonyOS 3.0/OpenHarmony 3.1 API 8 eTS (extendedTypeScript) on OpenHarmony as well asHarmonyOS apps taking advantage of custom OpenHarmony-basedHarmonyOS NEXT core operating system. It contains an allocator and garbage collector (GC) for ArkTS/JS objects, a standard library that conforms to the ECMAScript specification, an interpreter for running the ARK Bytecode (abc) generated by ARK front-end components, an inline cache for acceleration, a statically typed compiler, a C++/C function interface for Native API (NAPI) application development at runtime, and other modules inAhead-of-time compilation viaDevEco Studio since version 3.1.1 on both HarmonyOS 3.1 SDK and OpenHarmony 3.2 SDK API 9.[13]
The ets_frontend is a front-end tool in the ARK Runtime Subsystem which combines the ace-ets2bundle component that supports converting ETS programming language files into ARK bytecode files. They correspond with ArkTS app development in OpenHarmony and HarmonyOS development under HarmonyOS NEXT system.[14]
The ArkCompiler Toolchain provides developers with debugging tools forArkTS application development, such as the Debugger, CPUProfiler, and HeapProfiler. The debugging and tuning capabilities provided by the Ark Toolchain is used throughDevEco Studio IDE that relies on the ArkCompiler Runtime to provide runtime-related information to developers.[15]