Huawei Ark Compiler has added support for C language, which is the basis for implementing mixed Java and C compilation.
At the end of August 2019, Huawei Ark Compiler was officially open source, taking a leap forward.
For more than a year, the Ark programming system has realized the open-source of the compiler, engine, and debugger, where the compiler's key functions are mainly focused on the static compilation of Java applications.
Huawei stressed that the goal of the Ark project is to build a MapleIR-based cross-language programming environment to achieve cross-language global analysis and optimization.
For example, in the existing Java programming environment, developers often need to write Java and C programs at the same time and call each other through JNI, while the two languages are not directly interoperable.
One of the ultimate visions of the Ark programming system is to provide a consistent representation of different languages through IR, and to optimize globally across languages.
In the future, the Ark engine will not only JIT compile IR code from Java, but will also support JIT compilation of IR code from C and C++.
Code link address.
This open-source content is mainly limited to the scope of O0 capabilities, for C O2 above the optimization of the future for further open source.
Currently, Open Ark Compiler already supports most of the common features of C. The features that are not supported yet are complex types, packed struct, long double, and alloca out-of-scope free.
Currently, it supports aarch64 backend and most of the gcc_torture use cases, such as a third-party collaborative C frontend (open source time to be determined), which can run all C integer use cases of spec2017 correctly.
As a next step, the Ark community plans to do more broadening and deepening work on the Maple compiler.
On the one hand, it will try to support new languages to further validate the language-independence of the Maple base platform, and on the other hand, it will add support for new backends such as RISC-V.
Its community will open-source O2 analysis and optimization phase as soon as possible, performance benchmark LLVM/GCC, while using a unified Maple representation, the layout of cross-language global optimization.
Since the official open-source, Ark community open-source code grew from 50K to 170K, a total of 6.9K Star, and incubate five related subprojects.