Ark Compiler

Last updated

Ark Compiler
Developer(s) Huawei
Initial releaseAugust 9, 2019;4 years ago (2019-08-09)
Written in ArkTS, Cangjie, JS, C, C++
Operating system Android (Android apps), HarmonyOS, OpenHarmony, Oniro OS
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 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]

Contents

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

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

HarmonyOS Runtime
Developer(s) Huawei
Written in ArkTS, Cangjie, C, C++, JS
Operating system HarmonyOS
Platform ARM, RISC-V, x86, x64, LoongArch, Lingxi [8]
Type Runtime environment
License Proprietary
Ark Runtime
Developer(s) Huawei
Written in ArkTS, Cangjie, C, C++, JS
Operating system HarmonyOS NEXT, OpenHarmony, Oniro OS
Platform ARM, RISC-V, x86, x64, LoongArch, Lingxi [9]
Type Runtime environment, Compiler front end, Toolchain
License Proprietary, 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

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]

Ark TypeScript Runtime

ARK TypeScript 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

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

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]

Related Research Articles

A computing platform, digital platform, or software platform is an environment in which software is executed. It may be the hardware or the operating system (OS), a web browser and associated application programming interfaces, or other underlying software, as long as the program code is executed using the services provided by the platform. Computing platforms have different abstraction levels, including a computer architecture, an OS, or runtime libraries. A computing platform is the stage on which computer programs can run.

V8 is a JavaScript and WebAssembly engine developed by Google for its Chrome browser. V8 is free and open-source software that is part of the Chromium project and also used separately in non-browser contexts, notably the Node.js runtime system.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK) written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead of time. This allows for faster initialization, greater runtime performance, and decreased resource consumption, but the resulting executable can only run on the platform it was compiled for. It provides additional programming languages and execution modes. The first production-ready release, GraalVM 19.0, was distributed in May 2019. The most recent release is GraalVM for JDK 22, made available in March 2024.

Android Runtime (ART) is an application runtime environment used by the Android operating system. Replacing Dalvik, the process virtual machine originally used by Android, ART performs the translation of the application's bytecode into native instructions that are later executed by the device's runtime environment.

<span class="mw-page-title-main">HarmonyOS</span> Distributed operating system by Huawei

HarmonyOS (HMOS) is a distributed operating system developed by Huawei for smartphones, tablets, smart TVs, smart watches, personal computers and other smart devices. It has a multikernel design with dual frameworks: the operating system selects suitable kernels from the abstraction layer in the case of devices that use diverse resources. The operating system was officially launched by Huawei in August 2019.

<span class="mw-page-title-main">Huawei Mobile Services</span> Proprietary software service

Huawei Mobile Services (HMS) is a collection of proprietary services and high level application programming interfaces (APIs) developed by Huawei Technologies Co., Ltd. Its hub known as HMS Core serves as a toolkit for app development on Huawei devices. HMS is typically installed on Huawei devices on top of running dual-framework HarmonyOS operating system, and on its earlier devices running the Android operating system with EMUI including devices already distributed with Google Mobile Services. Alongside, HMS Core Wear Engine for Android phones with lightweight based LiteOS wearable middleware app framework integration connectivity like notifications, status etc.

<span class="mw-page-title-main">DevEco Studio</span> Integrated development environment for the HarmonyOS platform

DevEco Studio is the official integrated development environment (IDE) for Huawei's HarmonyOS operating system, built on JetBrains' IntelliJ IDEA software and Huawei's SmartAssist designed specifically for HarmonyOS development. It is available for download on Microsoft Windows and macOS based operating systems.

The version history of the HarmonyOS distributed operating system began with the public release of the HarmonyOS 1.0 for Honor Vision smart TVs on August 9, 2019. The first expanded commercial version of the Embedded, IoT AI, Edge computing based operating system, HarmonyOS 2.0, was released on June 2, 2021 for phones, tablets, smartwatches, smart speakers, routers, and internet of things. Beforehand, DevEco Studio, the HarmonyOS app development IDE, was released in September 2020 together with the HarmonyOS 2.0 Beta. HarmonyOS is developed by Huawei. New major releases are announced at the Huawei Developers Conference (HDC) in the fourth quarter of each year together with the first public beta version of the operating system's next major version. The next major stable version is then released in the third to fourth quarter of the following year.

<span class="mw-page-title-main">OpenHarmony</span> Family of open-source operating systems based on OpenHarmony

OpenAtom OpenHarmony, or abbreviated as OpenHarmony (OHOS), is a family of open-source operating systems based on HarmonyOS derived from LiteOS, donated the L0-L2 branch source code by Huawei to the OpenAtom Foundation. Similar to HarmonyOS, the open-source distributed operating system is designed with a layered architecture, which consists of four layers from the bottom to the top, i.e., the kernel layer, system service layer, framework layer, and application layer.

OpenAtom Foundation, a non-profit independent legal entity registered with the Ministry of Civil Affairs, is the first foundation for the open-source software in China. It was established in June 2020 and initiated jointly by Alibaba, Baidu, Huawei, Inspur, Qihoo 360, Tencent, China Merchants Bank and other companies for operation and marketing services of open source projects.

The HarmonyOS App Pack or the App file, identified with the file extension ".app", serves as the file format used by the HarmonyOS operating system. It functions as a native HarmonyOS app for distribution and installation through Huawei AppGallery, or for distribution through Huawei Ability Gallery in respect of installation-free apps under both current classic dual-framework and HarmonyOS NEXT system. The App file is also used by a number of other open source HarmonyOS-based operating systems such as OpenHarmony and Oniro OS-based operating systems for distribution and installation of applications, video games and middleware. Including non OpenHarmony-based operating systems, such as GNU Linux-based Unity Operating System that supports the app file format.

HarmonyOS NEXT is a proprietary distributed operating system and an iteration of HarmonyOS, developed by Huawei to support only HarmonyOS native apps. The operating system is primarily aimed at software and hardware developers that deal directly with Huawei. It does not include Android's AOSP core and is incompatible with Android applications.

ArkGraphics 3D is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader API developed by Huawei as a superset of Ark Engine. It is compared to low-level APIs on other platforms such as Apple Metal, Vulkan and DirectX 12.

ArkUI is a declarative based user interface framework for building user interfaces on native HarmonyOS applications developed by Huawei for the ArkTS and Cangjie programming language.

BiSheng Compiler is an open-source compiler toolchain developed by Huawei for general-purpose processor architectures, such as Kunpeng within HiSilicon domain. It introduces and enhances multiple compilation optimization technologies and supports different programming languages, such as ArkTS, Cangjie, C, C++ and Fortran.

ArkTS is a high-level general-purpose, multi-paradigm, compiled programming language developed by Huawei which is a superset of open-source TypeScript, in turn a superset of JavaScript formerly used in July 2022 HarmonyOS 3.0 version, alongside its evolved percussor, extended TypeScript (eTS) built for HarmonyOS development as a shift towards Declarative programming. ArkTS compiles to machine code via it's Ahead-of-time compilation Ark Compiler. ArkTS was first released in September 30, 2021 on OpenHarmony, and the ArkTS toolchain has shipped in DevEco Studio since version 3.1, released in 2022. Since, OpenHarmony 4.0 release on October 26, 2023, ArkTS APIs has been added to the open source community to contribute.

<span class="mw-page-title-main">ArkWeb</span> Proprietary software engine from Huawei

ArkWeb is a native proprietary software engine by Huawei for HarmonyOS NEXT system on HarmonyOS used for Huawei Browser and third-party WebView applications.

<span class="mw-page-title-main">MindSpore</span> Machine learning software library

MindSpore is a open-source software framework for deep learning, machine learning and artificial intelligence developed by Huawei.

<span class="mw-page-title-main">Hvigor</span> Free software build automation tool

Hvigor is a build automation tool for multi-language software development built on TypeScript. It controls the development process in the tasks of compilation and packaging to testing, deployment, and publishing of a number of programming languages such as JS, eTS on older versions, ArkTS app development for DevEco Studio IDE.

References

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