News

Ark Compiler JS runtime became open source in Huawei HarmonyOS

Published

on

Ark compiler front-end tool- Ark JS runtime officially became open source in Huawei OpenHarmony OS. It’s the first Ark compiler to use direct compilations of programming to machine codes on an operating system.

It improves the running efficiency for Java and C programming languages. The key components include compilers, toolchains, and runtimes. Coming back to the components of Ark JS compiler that officially Huawei open-source OpenHarmony includes three files that are mentioned below-

  1. JS runtime
  2. runtime core
  3. ts2abc

Ark JS components Details:

JS Runtime: It is the runtime that is used by JavaScript (JS) applications on OpenHarmony. It consists of the following files-

  • The JS object allocator
  • The garbage collector (GC)
  • A standard library that is compliant with ECMAScript specifications
  • ARK bytecode interpreter
  • Inline caches that store hidden classes
  • The ARK Foreign Function Interface (AFFI).

Related: OpenHarmony 2.0 Canary version released, Huawei with other firms donated the core codes

Runtime Core: Being a most common module of ARK runtime, it offers language-irrelevant runtime libraries, including ARK File, Tooling, and ARK Base. Furthermore, the ARK File stores bytecodes and information required for executing bytecodes. Moving ahead the tooling supports Debugger. Overall the ARK Base is responsible for fulfilling system calls.

Ts2abc: It is a front-end tool for JavaScript (JS) in the ARK compiler. It is responsible for converting JS files into ARK bytecode files. In this line, it uses the command line interplay mode to converts JS code into ARK bytecode files. These files support various systems such as Windows, Linux, and macOS and are compiled on an ARK runtime system.

Also Check: HarmonyOS Samples with five practical examples, can download and learn

About OpenHarmony:

OpenHarmony is an open-source project control by the OpenAtom Foundation. The purpose of building the system is to make a full full-scenario platform for digital applications. Hardware collaboration and resource sharing, One-time development for multi-device deployment, and a unified OS for flexible deployment are some of the features of the OpenHarmony project.

Additionally, it supports a mini system (minimum memory 128 KiB), Small System (minimum memory 1 MiB), Standandard system (minimum memory 128 MiB).

(Source- Ithome)

Copyright © 2022 Huaweicentral.com