Jump to content

Ark Compiler

From Wikipedia, the free encyclopedia

Ark Compiler
Developer(s)Huawei
Initial releaseAugust 9, 2019; 5 years ago (2019-08-09)
Written inArkTS, Cangjie, JS, C, C++
Operating systemEMUI (HMS Apk apps), HarmonyOS, OpenHarmony, Oniro OS
PlatformARM, RISC-V, x86, x64, LoongArch, Lingxi[1]
TypeCompiler, Runtime environment, Compiler front end, Toolchain
LicenseMixed: Proprietary (HarmonyOS), Apache License (OpenHarmony, Oniro OS, Android ArkCompiler)

Ark Compiler, also known as ArkCompiler, is a unified compilation and runtime platform that supports joint compilation and running across programming languages and chip platforms, also operating systems of open-source OpenHarmony, Oniro OS, alongside proprietary HarmonyOS with single core system HarmonyOS NEXT included on native APP in Event-driven programming in a unified development environment and formerly built for Android-based EMUI for Huawei smartphones and tablets with HMS-enabled apk apps on AppGallery that improves app performance.[2] It supports a variety of dynamic and static programming languages such as JS, TS, and ArkTS. 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.[3]

Huawei initially open sourced Ark Compiler for Android platform on GitHub, on September 9, 2019, as they were transitioning away from the operating system via US sanctions.[4] Then the company, open sourced Ark Compiler with OpenArkCompiler as part of the Huawei Ark Compiler open source project (HACOSP) in early February 2022 [5] and ArkJS_runtime, in the previous year in September 2021 after two years of inception in August 2019.[6]

Overview

[edit]

ArkCompiler has a built-in componentized and configurable multi-language compilation and runtime platform of OpenHarmony and HarmonyOS with HarmonyOS 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.[7]

ArkCompiler Runtime Core

[edit]
HarmonyOS Runtime
Developer(s)Huawei
Written inArkTS, Cangjie, C, C++, JS
Operating systemHarmonyOS
PlatformARM, RISC-V, x86, x64, LoongArch, Lingxi[8]
TypeRuntime environment
LicenseProprietary
Ark Runtime
Developer(s)Huawei
Written inArkTS
Operating systemHarmonyOS (HarmonyOS NEXT), OpenHarmony, Oniro OS
PlatformARM, RISC-V, x86, x64, LoongArch, Lingxi[9]
TypeRuntime environment, Compiler front end, Toolchain
LicenseProprietary, Apache License (OpenHarmony ArkCompiler Runtime Core), Eclipse Public License (Oniro OS)

The common module of language runtime in OpenHarmony 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-based HarmonyOS 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.[10]

ArkCompiler JS Runtime

[edit]

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 for C++ and JS interaction and a variety of garbage collectors that features high performance.[11]

ArkCompiler eTS Runtime

[edit]

ArkCompiler eTS Runtime is a runtime used in ArkTS applications derived from former HarmonyOS 3.0/OpenHarmony 3.1 API 8 eTS (extendedTypeScript) on OpenHarmony as well as HarmonyOS apps taking advantage of custom OpenHarmony-based HarmonyOS 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 in Ahead-of-time compilation via DevEco Studio since version 3.1.1 on both HarmonyOS 3.1 SDK and OpenHarmony 3.2 SDK API 9.[12]

ets_frontend

[edit]

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.[13]

ArkCompiler Toolchain

[edit]

The ArkCompiler Toolchain provides developers with debugging tools for ArkTS application development, such as the Debugger, CPUProfiler, and HeapProfiler. The debugging and tuning capabilities provided by the Ark Toolchain is used through DevEco Studio IDE that relies on the ArkCompiler Runtime to provide runtime-related information to developers.[14]

References

[edit]
  1. ^ "OpenHarmony 3.0 successfully adapted Loongson 1C300B chip". Huawei Update. December 15, 2021. Retrieved December 15, 2021.
  2. ^ Siddiqui, Aamir (June 22, 2019). "Ark Compiler Explained: How Huawei's App Compiler May Improve Android App Performance". XDA Developers. Retrieved February 12, 2024.
  3. ^ "ArkCompiler Runtime". OpenAtom Gitee. Retrieved February 12, 2024.
  4. ^ Amit (September 9, 2019). "Huawei Ark compiler officially open source from GitHub for self-hosting". Huawei Update. Retrieved February 12, 2024.
  5. ^ Sarkar, Amy (February 9, 2022). "OpenArkCompiler 1.0 launched, Huawei Ark Compiler open source project (HACOSP)". HC Newsroom. Retrieved February 12, 2024.
  6. ^ Mishra, Yash (September 7, 2021). "Ark Compiler JS runtime became open source in Huawei HarmonyOS". HC Newsroom. Retrieved February 12, 2024.
  7. ^ "Overview". OpenAtom Gitee. Retrieved February 12, 2024.
  8. ^ "OpenHarmony 3.0 successfully adapted Loongson 1C300B chip". Huawei Update. December 15, 2021. Retrieved December 15, 2021.
  9. ^ "OpenHarmony 3.0 successfully adapted Loongson 1C300B chip". Huawei Update. December 15, 2021. Retrieved December 15, 2021.
  10. ^ "Runtime Core". OpenAtom Gitee. Retrieved February 12, 2024.
  11. ^ "ArkCompiler JS Runtime". OpenAtom Gitee. Retrieved February 12, 2024.
  12. ^ "ArkCompiler JS Runtime - ets Runtime". OpenAtom Gitee. Retrieved February 12, 2024.
  13. ^ "ets_frontend". OpenAtom Gitee. Retrieved February 12, 2024.
  14. ^ "Ark toolchain components". OpenAtom Gitee. Retrieved February 12, 2024.