Paradigm | Multi-paradigm: functional, generic, imperative, declarative, object-oriented |
---|---|
Developer | Huawei |
First appeared | June 21, 2024 |
Preview release | 1.0 (Beta) / June 21, 2024 |
Typing discipline | Duck, gradual, structural, Static, strong, safe, nominative, manifest, strong, inferred |
OS | HarmonyOS, Linux, Windows, macOS |
License | Proprietary (HarmonyOS) |
Filename extensions | .cj |
Website | |
Influenced by | |
ArkTS, TypeScript, JavaScript, Swift, C#, F#, Java, C++, Go, Python |
Cangjie is a high-level, statically typed, general-purpose, multi-paradigm, compiled imperative and declarative programming language developed by Huawei which was first released on June 21, 2024, as a beta recruitment of the developer preview version of the HarmonyOS NEXT app development for HarmonyOS operating system. It is also referred to as CangjieLang or CJ but its proper name is Cangjie. [1]
Development of Cangjie started in 2019 by chief architect of Huawei's in-house programming language by Xinyu Feng, professor at the Department of Computer Science and Technology of Nanjing University alongside Tianjin University and Beihang University in its five-year development, [2] with the eventual collaboration of many other software programmers and engineers at Huawei at that time during the development initial release of HarmonyOS that same year, after being incubated in the R&D labs. [3]
In 2020, Huawei registered “Cangjie Language” trademark, which was classified as a “scientific instrument” and “web service” intellectual property in China. At that time, there were also rumors that Huawei was developing a new independent programming language Cangjie. [4]
During HDC 2021, in October 2021, HarmonyOS 3 Developer Preview was officially released as the OS was moving towards declarative programming software development. Huawei also announced that at that time that it would introduce the self-developed programming language for HarmonyOS in the future. [5]
It has also been reported between 2021 and 2022 that Huawei's programming language originally supposed to launch in 2022 or sometime around second half of 2022 which was pushed back due to ongoing development of HarmonyOS operating system internally. [6] [7]
On May 17, 2024, Cangjie programming language was internally added into OpenHarmony source code through its foreign function interface (FFI) mechanism. [8]
On June 17, 2024, four days before HDC 2024, Huawei renamed it's programming language lab to Cangjie programming language and announces the developer sessions of the new programming language for the event. [9]
On June 21, 2024, at HDC 2024, Cangjie developer recruitment that is running throughout June 21, 2024 until October 21, 2024, first landed for Huawei Mate60 Pro devices first with expansions of more devices going into 2025 rollout of HarmonyOS Next version. [10] Silicon Valley-based LeetCode, ICBC bank, China Mobile, Kelan Software, became one of the first local app developer companies recruited by Huawei using the new programming language to test and showcase to other developers and industry with the release of commercial apps in the initial Chinese market launch of the new HarmonyOS Next version platform. [11]
On July 5 to July 7, 2024, ACM China Turing Conference 2024 held with the Huawei Cangjie Programming Language Forum showcasing the new in-house domestic programming language across universities in China for Cangjie development integrated into academia. [12] [13]
Version history of Cangjie releases with HarmonyOS with OpenHarmony core API Level 12 SDK via DevEco Studio IDE.
Version | Release date | macOS | Windows |
---|---|---|---|
Cangjie 1.0 Beta [14] | June 21, 2024 | Yes | Yes |
The platforms Cangjie supports are HarmonyOS, Linux, Windows and macOS for app development.
A key aspect of Cangjie design is its ability to attach with or without ArkTS code developed for HarmonyOS development. On Huawei devices running HarmonyOS, it allows Native APIs in DevEco Studio templates alternative to traditional Native APIs of C, C++ alongside ArkTS code to run within one program. [15]
Cangjie is a general purpose programming language which is 'autonomous and controllable' which is not based on any existing programming languages in superset unlike ArkTS which replaced previous existing legacy programming languages as the primary development language on HarmonyOS platform alongside ArkTS. The programming language employs modern programming-language theory concepts of other existing programming languages of its category that influences it such as Java with simple and advanced syntax features like Typescript-centric ArkTS language, in declarative programming development by complementing it with efficiency. [16]
Cangjie features an embedded AgentDSL programming framework, natural language & programming language organic integration; Multi-agent collaboration, simplified symbolic expression, free combination of modes, and support for the development of various intelligent applications. It has a lightweight and scalable runtime, modular and hierarchical design, with Full-scenario domain extension, metaprogramming, and eDSL technologies support domain-oriented declarative development. In its first all-concurrent GC in the terminal scenario, for faster application threads. The lightweight threads with better concurrency performance and less overhead for programs on HarmonyOS development compared with Kotlin and Java on Android development in controlled benchmark brute force tests. [17] [18]
It is reported that applications that have already been developed on existing ArkTS do not need to be redeveloped into the Cangjie version on HarmonyOS Next version. HarmonyOS supports high-performance interoperability between the Cangjie language and the ArkTS language. In the future, developers can choose between Cangjie programming language or ArkTS for incremental development for developer needs. For high-throughput to high-frequency read/write data processing scenarios, high-frequency interaction and high-load scenarios, and scenarios sensitive to startup latency, it is recommended to preferably choose the Cangjie language that fills the gaps of ArkTS bottlenecks. [19] [20]
Cangjie also integrates 'Security DNA' into language design to help developers focus on app development functions over security functions around it that avoids vulnerabilities where it offers a static type system and automatic memory management to ensure application stability. That also includes runtime checks of detecting errors and cross-language security. [21] Cangjie also supports various toolchains for app development, including language services such as highlighting and association, debugging with cross-language debugging and thread-level visual debugging, static checking, performance analysis, package management, document generation, Mock tools, testing frameworks, coverage tools, Fuzz tools, and intelligent assisted programming tools. [22]
The following is an example of a simple AI Native application development program with Cangjie programming language on HarmonyOS. [23]
Definition of Agent @agent class Planner {
@prompt[pattern=APE] ( action: "Help users make travel routes", purpose: "Let users visit more attractions and get enough rest in the planned time", expectation: "Generate a reasonable route to a tourist attraction with information such as time, attractions, commute, etc." )
}
Use of the agent let agent = Planner() let result = agent. chat("我想前往上海")
STD module runtime, known as Std.runtime is a module runtime package for Cangjie Standard Library via Cangjie Programming Language Library API that interacts with the program's runtime environment, with varaibles of controlling, managing and monitoring the program's execution. Cangjie languages uses automatic garbage collection mechanism in order to manage memory, and manual triggers around garbage collection with collection thresholds, obtaining memory statistics that regulate and monitor the garbage collection. [24] [25]
With Ark Compiler, it supports a variety of dynamic and static programming languages such as JS, TS, and ArkTS as well as Cangjie. It is the compilation and runtime base that enables OpenHarmony alongside HarmonyOS based on the same platform 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. [26]
Cangjie uses DevEco Studio plug-in for HarmonyOS native development as Cangjie SDK using default declarative ArkUI, also other third-party UI frameworks on HarmonyOS NEXT version and OpenHarmony SDK with future cross-platform ArkUI-X support. [27]
A computing platform, digital platform, or software platform is the infrastructure on which software is executed. While the individual components of a computing platform may be obfuscated under layers of abstraction, the summation of the required components comprise the computing platform.
The Android Package with the file extension apk is the file format used by the Android operating system, and a number of other Android-based operating systems for distribution and installation of mobile apps, mobile games and middleware. A file using this format can be built from source code written in either Java or Kotlin.
EMUI is an interface based on Android developed by Chinese technology company Huawei. Used on the company's smartphones primarily globally.
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 multi-kernel design with dual frameworks: the operating system selects suitable kernels from the abstraction layer in the case of devices that use diverse resources.
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 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.
Huawei AppGallery is a package manager and application distribution platform, or marketplace 'app store', developed by Huawei Technologies Co., Ltd. It serves as the official app store for the devices running on Huawei HarmonyOS, and is also available for Huawei EMUI and Microsoft Windows via the Mobile Engine emulator.
DevEco Studio is the official integrated development environment (IDE) for Huawei's HarmonyOS operating system, built on JetBrains' IntelliJ IDEA software and formerly Huawei's SmartAssist designed specifically for HarmonyOS development built by Huawei. 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.
OpenAtom OpenHarmony, or abbreviated as OpenHarmony (OHOS), is a family of open-source distributed 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. It is also an extensive collection of free software, which can be used as an operating system or can be used in parts with other operating systems via Kernel Abstraction Layer subsystems.
AITO is a Chinese electric vehicle marque of Chinese vehicle manufacturer Seres Group and multinational technology corporation Huawei in 2021. The marque offers electric cars with autonomous driving systems and the HarmonyOS operating system.
Harmony Intelligent Mobility Alliance trading as HIMA is an automotive alliance initiated by Chinese technology company Huawei. Under HIMA, Huawei participates in product definition, design, marketing, user experience, quality control and provides intelligent vehicle software and hardware for traditional automobile manufacturers.
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.
ArkUI is a declarative based user interface framework for building user interfaces on native HarmonyOS, OpenHarmony alongside Oniro OS applications developed by Huawei for the ArkTS and Cangjie programming language.
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. 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.
BiSheng Compiler is an open-source compiler toolchain developed by Huawei for general-purpose processor architectures, such as Kunpeng within HiSilicon domain. It is based on LLVM, and 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, declarative 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 its 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.
MindSpore is a open-source software framework for deep learning, machine learning and artificial intelligence developed by Huawei.
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.
HarmonyOS Sans is a sans-serif typeface created by Huawei. It was first made available to developers on June 9, 2021, and is utilized within the HarmonyOS and OpenHarmony operating systems. It represents Huawei's second typeface following its corporate Huawei Sans sans-serif typeface.
HarmonyOS Kernel, sometimes mentioned as Harmony kernel is the computer operating system (OS) kernel developed at Huawei since August 2023 for use in the HarmonyOS NEXT iterative versions of HarmonyOS proprietary operating system replacing previous versions of HarmonyOS with AOSP compatibility, Linux kernel and LiteOS kernel legacies.