LLM-Based Java Concurrent Program to ArkTS Converter

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 to HarmonyOS. However, HarmonyOS utilizes ArkTS, a superset of TypeScript, as the prog...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:IEEE/ACM International Conference on Automated Software Engineering : [proceedings] S. 2403 - 2406
Hauptverfasser: Liu, Runlin, Lin, Yuhang, Hu, Yunge, Zhang, Zhe, Gao, Xiang
Format: Tagungsbericht
Sprache:Englisch
Veröffentlicht: ACM 27.10.2024
Schlagworte:
ISSN:2643-1572
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Abstract 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 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 an LLM-based concurrent Java program to ArkTS converter.Our converter utilizes large language models (LLMs) for efficient code translation, integrating ArkTS's SharedArrayBuffer API to create ThreadBridge, a library that replicates Java's shared memory model. Using LLM's Chain-of-Thought mechanism, the translation process is divided into specialized chains: the TS chain, concurrency chain, and synchronization chain, each handling TypeScript syntax, concurrency patterns, and synchronization logic with precision.This study offers solutions to bridge concurrency model differences between Java and ArkTS, reducing manual code rewriting and speeding up adaptation for HarmonyOS NEXT. Experiments show the converter successfully compiles 66% of 53 test samples, with 69% accuracy for compiled results. Overall, the approach shows promise in converting concurrent Java programs to ArkTS, laying the foundation for future improvements.
AbstractList 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 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 an LLM-based concurrent Java program to ArkTS converter.Our converter utilizes large language models (LLMs) for efficient code translation, integrating ArkTS's SharedArrayBuffer API to create ThreadBridge, a library that replicates Java's shared memory model. Using LLM's Chain-of-Thought mechanism, the translation process is divided into specialized chains: the TS chain, concurrency chain, and synchronization chain, each handling TypeScript syntax, concurrency patterns, and synchronization logic with precision.This study offers solutions to bridge concurrency model differences between Java and ArkTS, reducing manual code rewriting and speeding up adaptation for HarmonyOS NEXT. Experiments show the converter successfully compiles 66% of 53 test samples, with 69% accuracy for compiled results. Overall, the approach shows promise in converting concurrent Java programs to ArkTS, laying the foundation for future improvements.
Author Liu, Runlin
Zhang, Zhe
Lin, Yuhang
Hu, Yunge
Gao, Xiang
Author_xml – sequence: 1
  givenname: Runlin
  surname: Liu
  fullname: Liu, Runlin
  email: ler4065@gmail.com
  organization: Beihang University,China
– sequence: 2
  givenname: Yuhang
  surname: Lin
  fullname: Lin, Yuhang
  email: yuhanglin35@gmail.com
  organization: Beihang University,China
– sequence: 3
  givenname: Yunge
  surname: Hu
  fullname: Hu, Yunge
  email: hygchn04@gmail.com
  organization: Beihang University,China
– sequence: 4
  givenname: Zhe
  surname: Zhang
  fullname: Zhang, Zhe
  email: zhangzhe2023@buaa.edu.cn
  organization: Beihang University,China
– sequence: 5
  givenname: Xiang
  surname: Gao
  fullname: Gao, Xiang
  email: xiang_gao@buaa.edu.cn
  organization: Beihang University,China
BookMark eNotjc1KxDAURqMoOI5du3GRF-h4b5KbNMux-EtFwXE9pM2tFJ1W0jrg21vR1fngwHdOxVE_9CzEOcIK0dClth6tgtVM0lYdiMw7XxgAh8oU7lAslDU6R3LqRGTj2NUwT7KIdiFMVT3mV2HkKB_CPshy6JuvlLif5HMa3lLYyWmQ6_S-efl1e04TpzNx3IaPkbN_LsXrzfWmvMurp9v7cl3lYQ5POdVaG0fAoIiMjhEjmIa0AohkWoImNNrWThlm3UTfgidLWFMRPKrQ6qW4-PvtmHn7mbpdSN9bBGeN91b_AA9ZRVw
CODEN IEEPAD
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1145/3691620.3695362
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume
IEEE Xplore All Conference Proceedings
IEEE Electronic Library (IEL)
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Electronic Library (IEL)
  url: https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 9798400712487
EISSN 2643-1572
EndPage 2406
ExternalDocumentID 10764996
Genre orig-research
GrantInformation_xml – fundername: National Natural Science Foundation of China
  funderid: 10.13039/501100001809
GroupedDBID 6IE
6IF
6IH
6IK
6IL
6IM
6IN
6J9
AAJGR
AAWTH
ABLEC
ACREN
ADYOE
ADZIZ
AFYQB
ALMA_UNASSIGNED_HOLDINGS
AMTXH
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
CHZPO
IEGSK
IPLJI
M43
OCL
RIE
RIL
ID FETCH-LOGICAL-a248t-5b334750e025543dd1d04c53200d54f50cac36b724ee3cd9f095651b58a912af3
IEDL.DBID RIE
ISICitedReferencesCount 1
ISICitedReferencesURI http://www.webofscience.com/api/gateway?GWVersion=2&SrcApp=Summon&SrcAuth=ProQuest&DestLinkType=CitingArticles&DestApp=WOS_CPL&KeyUT=001353105400223&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
IngestDate Wed Jan 15 06:20:43 EST 2025
IsPeerReviewed false
IsScholarly true
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-a248t-5b334750e025543dd1d04c53200d54f50cac36b724ee3cd9f095651b58a912af3
PageCount 4
ParticipantIDs ieee_primary_10764996
PublicationCentury 2000
PublicationDate 2024-Oct.-27
PublicationDateYYYYMMDD 2024-10-27
PublicationDate_xml – month: 10
  year: 2024
  text: 2024-Oct.-27
  day: 27
PublicationDecade 2020
PublicationTitle IEEE/ACM International Conference on Automated Software Engineering : [proceedings]
PublicationTitleAbbrev ASE
PublicationYear 2024
Publisher ACM
Publisher_xml – name: ACM
SSID ssib057256116
ssj0051577
Score 2.2792063
Snippet HarmonyOS NEXT is a distributed operating system developed to support HarmonyOS native apps. To support the new and independent Harmony ecosystem, developers...
SourceID ieee
SourceType Publisher
StartPage 2403
SubjectTerms Accuracy
ArkTS
Codes
Concurrent computing
HarmonyOS NEXT
Java
Large language models
Manuals
Message systems
Operating systems
Source code translations
Synchronization
Syntactics
Title LLM-Based Java Concurrent Program to ArkTS Converter
URI https://ieeexplore.ieee.org/document/10764996
WOSCitedRecordID wos001353105400223&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3LSsNAFL3Y4sJVfVR8Mwu30WSeyVLFIhJLwSrdlXmCCK3EtN_v3CRVXLhwFxIGwp3HOTN3zj0Al5HEG2HQNYBJl3CTukRTJRNvXbBprkNo5NGvpRqP89msmHRi9UYL471vLp_5K3xscvluaVd4VBZnuJKRocse9JSSrVhrM3iEiuCdIddpl-GI00p1tXwyLq6ZjESIxj2qxIQl_WWm0mDJaPDPv9iF4Y8qj0y-8WYPtvxiHwYbWwbSzdID4GX5lNxGdHLkUa81ic1tW4UJm-NtLFIvyU31Pn3Gb2jI7KshvIzup3cPSWeOEGPJ8zoRhjEe4d7jpoAz5zKXcos2D6kTPIjUasukUZR7z6wrAlYcFJkRuS4yqgM7hP5iufBHQBzPDaYfU2Vs5GfOBGYKZtDoW3vqzTEMMQrzj7b-xXwTgJM_3p_CDo3Qjys8VWfQr6uVP4dtu67fPquLpte-AGQRlc8
linkProvider IEEE
linkToHtml http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV3LSsNAFL1oFXRVHxXfzsJtNJlnslSxVE1LwSrdlXkFRGglpv1-56ap4sKFu5AwEO48zpm5c-4BuAwk3giDrgFMuoib2EWaKhl56wobp7ooann0a64Gg3Q8zoaNWL3Wwnjv68tn_gof61y-m9k5HpWFGa5kYOhyHTbQOquRa62Gj1ABvhNkO8uFOCC1Uk01n4SLayYDFaJhlyoxZUl_2anUaNJt__M_dqDzo8sjw2_E2YU1P92D9sqYgTTzdB94nvej24BPjjzqhSahuV3WYcLmeB-LVDNyU76PnvEbWjL7sgMv3fvRXS9q7BFCNHlaRcIwxgPge9wWcOZc4mJu0eghdoIXIrbaMmkU5d4z67ICaw6KxIhUZwnVBTuA1nQ29YdAHE8NJiBjZWxgaM4UzGTMoNW39tSbI-hgFCYfywoYk1UAjv94fwFbvVE_n-QPg6cT2KaBCOB6T9UptKpy7s9g0y6qt8_yvO7BL2ggmRg
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=IEEE%2FACM+International+Conference+on+Automated+Software+Engineering+%3A+%5Bproceedings%5D&rft.atitle=LLM-Based+Java+Concurrent+Program+to+ArkTS+Converter&rft.au=Liu%2C+Runlin&rft.au=Lin%2C+Yuhang&rft.au=Hu%2C+Yunge&rft.au=Zhang%2C+Zhe&rft.date=2024-10-27&rft.pub=ACM&rft.eissn=2643-1572&rft.spage=2403&rft.epage=2406&rft_id=info:doi/10.1145%2F3691620.3695362&rft.externalDocID=10764996