HarmonyOS NEXT is a distributed operating system developed to support HarmonyOS native apps. To support the new and independent Harmony ecosystem, developers are required to migrate their applications from Android/IOS to HarmonyOS. However, HarmonyOS utilizes ArkTS, a superset of TypeScript, as the programming language for application development. Hence, migrating applications to HarmonyOS requires translating programs across different program languages, e.g., Java, which is known to be very challenging, especially for concurrency programs. Java utilizes shared memory to implement concurrency programs, while ArkTS relies on message passing (i.e., Actor model). This paper presents a LLM-based concurrent Java program to ArkTS converter. This converter leverages the sophisticated code comprehension and generation capabilities of large language models (LLMs) to streamline the translation process. By integrating the SharedArrayBuffer API native to ArkTS, we’ve crafted ThreadBridge, a shared library that replicates Java’s shared memory paradigm, aligning with the needs of a wide range of ArkTS applications. Employing this library and LLM’s Chain-of-thought mechanism, our approach methodically divides the translation challenge into specialized chains: the TypeScript (TS) chain, the concurrency chain, and the synchronization chain. These targeted chains are designed to efficiently translate Java’s source code into its ArkTS equivalent, handling TypeScript-specific syntax, concurrency patterns, and synchronization logic with precision. In particular, this study provides a set of effective solutions to overcome the differences in concurrency models between Java and ArkTS. With this converter, developers can reduce manual code rewriting and accelerate application adaptation and deployment on HarmonyOS NEXT. Experimental results show that our converter successfully compiles 66% of the 53 test samples, with an accuracy rate of 68% for the successfully compiled results. In conclusion, our approach demonstrates promising potential in handling the conversion of concurrent Java programs to ArkTS, providing a foundation for further improvement and optimization.
Tue 29 OctDisplayed time zone: Pacific Time (US & Canada) change
13:30 - 15:00 | LLM for SE 1Research Papers / NIER Track / Tool Demonstrations / Journal-first Papers at Camellia Chair(s): Chengcheng Wan East China Normal University | ||
13:30 15mTalk | How Effective Do Code Language Models Understand Poor-Readability Code? Research Papers Chao Hu Shanghai Jiao Tong University, Yitian Chai School of Software, Shanghai Jiao Tong University, Hao Zhou Pattern, Recognition Center, WeChat, Tencent, Fandong Meng WeChat AI, Tencent, Jie Zhou Tencent, Xiaodong Gu Shanghai Jiao Tong University | ||
13:45 15mTalk | An Empirical Study to Evaluate AIGC Detectors on Code Content Research Papers Jian Wang Nanyang Technological University, Shangqing Liu Nanyang Technological University, Xiaofei Xie Singapore Management University, Yi Li Nanyang Technological University Pre-print | ||
14:00 15mTalk | Distilled GPT for source code summarization Journal-first Papers | ||
14:15 15mTalk | Leveraging Large Language Model to Assist Detecting Rust Code Comment Inconsistency Research Papers Zhang Yichi , Zixi Liu Nanjing University, Yang Feng Nanjing University, Baowen Xu Nanjing University | ||
14:30 10mTalk | LLM-Based Java Concurrent Program to ArkTS Converter Tool Demonstrations Runlin Liu Beihang University, Yuhang Lin Zhejiang University, Yunge Hu Beihang University, Zhe Zhang Beihang University, Xiang Gao Beihang University | ||
14:40 10mTalk | Towards Leveraging LLMs for Reducing Open Source Onboarding Information Overload NIER Track | ||
14:50 10mTalk | CoDefeater: Using LLMs To Find Defeaters in Assurance Cases NIER Track Usman Gohar Dept. of Computer Science, Iowa State University, Michael Hunter Iowa State University, Robyn Lutz Iowa State University, Myra Cohen Iowa State University |