According to news from this site on June 21, at the HDC 2024 Huawei Developer Conference this afternoon, Gong Ti, President of Huawei Terminal BG Software Department, officially announced Huawei’s self-developed Cangjie programming language and released a developer preview of HarmonyOS NEXT Cangjie language. Version. This is the first time Huawei has publicly released the Cangjie programming language.
Gong Ti said: "In 2019, the Cangjie programming language project was born at Huawei. After 5 years of research and development and a lot of R&D investment, it finally meets global developers today. Cangjie programming language adopts modern language features Integration, comprehensive compilation optimization and runtime implementation, and out-of-the-box IDE tool chain support create a friendly development experience and excellent program performance for developers.”
According to reports, Cangjie programming language is a universal programming language. A new generation of scenario-intelligent programming language that focuses on "native intelligence, natural all-scenario, high performance, and strong security." Integrate into the Hongmeng ecosystem to provide developers with a good programming experience.Native intelligenceEmbedded AgentDSL programming framework, organic integration of natural language & programming language; multi-Agent collaboration, simplified symbolic expression, free combination of patterns, supporting the development of various intelligent applications.Cangjie programming language is a modern programming language for all-scenario application development. Its specific features are:Born with full scenariosLightweight and scalable runtime, modular layered design, no matter how small the memory is, it can be installed; full-scenario domain expansion, meta-programming and eDSL technology, supports domain-oriented declarative style development. High performanceThe first fully concurrent GC for terminal scenarios, the application thread is smoother and the response is faster. Lightweight threads, better concurrency performance and less overhead. Strong SecuritySecurity DNA is integrated into the language design to help developers focus on business logic and avoid investing too much energy in defensive programming. Coding is safe, and vulnerabilities are nowhere to be hidden.
Efficient programming: Cangjie is a multi-paradigm programming language that supports functional programming , imperative and object-oriented paradigms, including features such as value types, classes and interfaces, generics, algebraic data types, pattern matching, and higher-order functions. In addition, Cangjie also supports type inference, which can reduce the burden of type annotation on developers; various syntax sugar and macro capabilities built into the language support developers to quickly develop domain-specific languages (DSL) and build domain abstractions based on Cangjie . Safe and reliable: As a modern programming language, Cangjie pursues coding as safety, and ensures the type safety and null safety of the program through static type system and automatic memory management. At the same time, Cangjie also provides various runtime checks, Including array subscript out-of-bounds check, type conversion check, numerical calculation overflow check, and string encoding legality check, etc., which can promptly detect errors in program operation; in addition, code scanning tools, obfuscation tools, and sterilizers are also used to further provide Support for cross-language interoperability security and code asset protection. Easy concurrency: Cangjie language implements lightweight user-space threads and concurrent object libraries, using the user-space thread model. Each Cangjie thread is an extremely lightweight execution entity, with an independent execution context but shared memory. For developers, the use of user-mode threads is consistent with the use of traditional system threads and does not bring additional burdens; from a running-state perspective, thread management is completed by the runtime and does not rely on the thread management of the operating system. , so thread creation, scheduling, and destruction operations are more efficient and occupy less resources than system threads. In order to avoid data competition, Cangjie language provides a concurrent object library. The methods of concurrent objects are thread-safe, so calling these methods in multi-threads is no different from serial programming. Developers of application logic do not need to worry about concurrency management. For some core libraries, Cangjie also provides lock-free or fine-grained lock algorithm implementations, which can further reduce thread blocking and improve concurrency.Excellent performance:
The Cangjie compiler and runtime optimize compilation from the full stack, including the compiler front-end based on CHIR (Cangjie HighLevel IR) high-level compilation optimization (such as semantic-aware loop optimization, semantic-aware back-end collaborative optimization, etc. ), back-end-based compilation optimization (such as SLP vectorization, Intrinsic optimization, InlineCache, inter-procedural pointer optimization, Barrier optimization, etc.), runtime-based optimization (such as lightweight locks, distributed marking, concurrent tracing optimization, etc.).
In addition, Cangjie language has a native lightweight design for the runtime. Through the modular and hierarchical design of the runtime, it defines the Cangjie public object model and the common basic components of the runtime. Based on the public object model, it implements runtime memory management and recall. Basic capabilities such as stack, exception handling, and cross-language calling significantly reduce redundant object design among multiple capabilities and streamline runtime volume. At the same time, through the on-demand loading technology of packages, the memory overhead of redundant packages started by Cangjie applications is reduced. Therefore, for resource-sensitive devices, it takes up less resources and is more friendly to support.
In addition, Cangjie also supports a series of tool chains for application development, including language services (highlighting, association), debugging (cross-language debugging, thread-level visual debugging), static inspection, performance analysis, and package management , document generation, Mock tools, testing frameworks, coverage tools, Fuzz tools and intelligent auxiliary programming tools.
Huawei HarmonyOS NEXT Cangjie Language Developer Preview Beta is now officially open for recruitment. Interested friends of this site can sign up to experience it:
https://developer.huawei.com/consumer/cn /activityDetail/cangjie-beta/
Huawei HDC 2024 Developer Conference Special Topic
The above is the detailed content of After 5 years of research and development, Huawei's next-generation programming language 'Cangjie” has officially launched its preview. For more information, please follow other related articles on the PHP Chinese website!