{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,4,2]],"date-time":"2026-04-02T11:19:18Z","timestamp":1775128758612,"version":"3.50.1"},"reference-count":44,"publisher":"Association for Computing Machinery (ACM)","issue":"ISSTA","content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2025,6,22]]},"abstract":"<jats:p>OpenHarmony emerges as a potent force in the mobile app domain, poised to stand alongside established industry giants. ArkTS is its main language, enhancing TypeScript (TS) and JavaScript (JS) with strict typing for improved performance. Developers are encouraged to port popular TS\/JS libraries to OpenHarmony, supported by detailed guidelines. However, this requires a deep understanding of ArkTS syntax, following porting specifications, and making manual changes. An automated solution is crucial to streamline this process and foster a robust software ecosystem.<\/jats:p>\n          <jats:p>As a new programming language, ArkTS currently lacks essential analysis tools for automated analysis and porting of software libraries. However, the rise of Large Language Models (LLMs) shows promise for effectively addressing automated porting tasks. There are two challenges in using LLMs to automate the porting of TS\/JS libraries to OpenHarmony: (1) LLMs have limited exposure to ArkTS code, making it difficult for them to grasp the syntactical differences between ArkTS and JS\/TS, as well as the various adaptation scenarios. (2) Project-level code adaptation often involves correcting numerous syntax mismatches, which complicates matters for LLMs as they must handle the interactions between different mismatches and interdependent code. In response, we introduce ArkAdapter, a project-level automatic code adaptation approach. ArkAdapter addresses Challenge 1 by establishing an adaptation knowledge repository for ArkTS syntax comprehension. It expands a collection of real code adaptation examples based on expert experience across various scenarios, improving the adaptation capabilities of LLMs through few-shot learning. ArkAdapter overcomes Challenge 2 based on an adaptation priority strategy by considering both the dependency structure and the granularity of syntax-mismatching code. This strategy helps prevent interference among various syntax mismatches and their interdependent code. Evaluation shows ArkAdapter achieves high precision (86.84<\/jats:p>","DOI":"10.1145\/3728941","type":"journal-article","created":{"date-parts":[[2025,6,22]],"date-time":"2025-06-22T10:52:56Z","timestamp":1750589576000},"page":"1445-1466","source":"Crossref","is-referenced-by-count":2,"title":["Porting Software Libraries to OpenHarmony: Transitioning from TypeScript or JavaScript to ArkTS"],"prefix":"10.1145","volume":"2","author":[{"ORCID":"https:\/\/orcid.org\/0009-0006-1409-4417","authenticated-orcid":false,"given":"Bo","family":"Zhou","sequence":"first","affiliation":[{"name":"Northeastern University, Shenyang, China"}]},{"ORCID":"https:\/\/orcid.org\/0009-0005-2591-2334","authenticated-orcid":false,"given":"Jiaqi","family":"Shi","sequence":"additional","affiliation":[{"name":"Northeastern University, Shenyang, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8645-4326","authenticated-orcid":false,"given":"Ying","family":"Wang","sequence":"additional","affiliation":[{"name":"Northeastern University, Shenyang, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2990-1614","authenticated-orcid":false,"given":"Li","family":"Li","sequence":"additional","affiliation":[{"name":"Beihang University, Beijing, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8031-4947","authenticated-orcid":false,"given":"Tsz On","family":"Li","sequence":"additional","affiliation":[{"name":"Hong Kong University of Science and Technology, HONG KONG, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-8024-1781","authenticated-orcid":false,"given":"Hai","family":"Yu","sequence":"additional","affiliation":[{"name":"Northeastern University, Shenyang, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3422-5585","authenticated-orcid":false,"given":"Zhiliang","family":"Zhu","sequence":"additional","affiliation":[{"name":"Northeastern University, Shenyang, China"}]}],"member":"320","published-online":{"date-parts":[[2025,6,22]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"2024. Adaptation Rules from TypeScript\/JavaScript to ArkTS Language:. https:\/\/gitee.com\/openharmony\/docs\/blob\/master\/zh-cn\/application-dev\/quick-start\/typescript-to-arkts-migration-guide.md Accessed: 2024-09-01"},{"key":"e_1_2_1_2_1","unstructured":"2024. ArkAnalyzer tool:. https:\/\/portrait.gitee.com\/openharmony-sig\/arkanalyzer?skip_mobile=true Accessed: 2024-09-01"},{"key":"e_1_2_1_3_1","unstructured":"2024. ArkCompiler:. https:\/\/developer.huawei.com\/consumer\/cn\/arkcompiler\/ Accessed: 2024-10-15"},{"key":"e_1_2_1_4_1","unstructured":"2024. chardet:. https:\/\/www.npmjs.com\/package\/chardet Accessed: 2024-10-15"},{"key":"e_1_2_1_5_1","unstructured":"2024. Code Generation Leaderboard:. https:\/\/huggingface.co\/spaces\/bigcode\/bigcode-models-leaderboard Accessed: 2024-10-15"},{"key":"e_1_2_1_6_1","unstructured":"2024. cssnano:. https:\/\/www.npmjs.com\/package\/cssnano"},{"key":"e_1_2_1_7_1","unstructured":"2024. deep-eql:. https:\/\/www.npmjs.com\/package\/deep-eql Accessed: 2024-10-15"},{"key":"e_1_2_1_8_1","unstructured":"2024. direction:. https:\/\/www.npmjs.com\/package\/direction Accessed: 2024-10-15"},{"key":"e_1_2_1_9_1","unstructured":"2024. encode-utf8:. https:\/\/www.npmjs.com\/package\/encode-utf8 Accessed: 2024-10-15"},{"key":"e_1_2_1_10_1","unstructured":"2024. flexsearch:. https:\/\/www.npmjs.com\/package\/flexsearch Accessed: 2024-10-15"},{"key":"e_1_2_1_11_1","unstructured":"2024. ip6:. https:\/\/www.npmjs.com\/package\/ip6 Accessed: 2024-10-15"},{"key":"e_1_2_1_12_1","unstructured":"2024. js-e2e tool:. https:\/\/gitee.com\/chenwenjiehw\/js-e2e\/tree\/master\/js-compatibiitiy Accessed: 2024-09-01"},{"key":"e_1_2_1_13_1","unstructured":"2024. kuler:. https:\/\/www.npmjs.com\/package\/kuler Accessed: 2024-10-15"},{"key":"e_1_2_1_14_1","unstructured":"2024. Library Porting Specifications:. https:\/\/gitee.com\/openharmony-tpc\/docs\/blob\/master\/contribute\/adapter-guide Accessed: 2024-09-01"},{"key":"e_1_2_1_15_1","unstructured":"2024. node-gyp:. https:\/\/www.npmjs.com\/package\/node-gyp Accessed: 2024-10-15"},{"key":"e_1_2_1_16_1","unstructured":"2024. OHPM:. https:\/\/ohpm.openharmony.cn\/#\/cn\/home Accessed: 2024-10-15"},{"key":"e_1_2_1_17_1","unstructured":"2024. OpenAtom Foundation:. https:\/\/en.wikipedia.org\/wiki\/OpenAtom_Foundation Accessed: 2024-10-15"},{"key":"e_1_2_1_18_1","unstructured":"2024. pinyin4js:. https:\/\/www.npmjs.com\/package\/pinyin4js Accessed: 2024-10-15"},{"key":"e_1_2_1_19_1","unstructured":"2024. postcss-font-variant:. https:\/\/www.npmjs.com\/package\/postcss-font-variant Accessed: 2024-10-15"},{"key":"e_1_2_1_20_1","unstructured":"2024. postcss-media-minmax:. https:\/\/www.npmjs.com\/package\/postcss-media-minmax Accessed: 2024-10-15"},{"key":"e_1_2_1_21_1","unstructured":"2024. postcss-opacity-percentage:. https:\/\/www.npmjs.com\/package\/postcss-opacity-percentage Accessed: 2024-10-15"},{"key":"e_1_2_1_22_1","unstructured":"2024. punycode:. https:\/\/www.npmjs.com\/package\/punycode Accessed: 2024-10-15"},{"key":"e_1_2_1_23_1","unstructured":"2024. yoctocolors:. https:\/\/www.npmjs.com\/package\/yoctocolors Accessed: 2024-10-15"},{"key":"e_1_2_1_24_1","volume-title":"Proceedings of the 35th IEEE\/ACM International Conference on Automated Software Engineering. 275\u2013286","author":"Ding Yangruibo","year":"2020","unstructured":"Yangruibo Ding, Baishakhi Ray, Premkumar Devanbu, and Vincent J Hellendoorn. 2020. Patching as translation: the data and the metaphor. In Proceedings of the 35th IEEE\/ACM International Conference on Automated Software Engineering. 275\u2013286."},{"key":"e_1_2_1_25_1","doi-asserted-by":"crossref","first-page":"3","DOI":"10.1007\/s10664-024-10573-2","article-title":"Type-migrating C-to-Rust translation using a large language model","volume":"30","author":"Hong Jaemin","year":"2025","unstructured":"Jaemin Hong and Sukyoung Ryu. 2025. Type-migrating C-to-Rust translation using a large language model. Empirical Software Engineering, 30, 1 (2025), 3.","journal-title":"Empirical Software Engineering"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE56229.2023.00181"},{"key":"e_1_2_1_27_1","volume-title":"2023 38th IEEE\/ACM International Conference on Automated Software Engineering (ASE). 1529\u20131541","author":"Jiao Mingsheng","year":"2023","unstructured":"Mingsheng Jiao, Tingrui Yu, Xuan Li, Guanjie Qiu, Xiaodong Gu, and Beijun Shen. 2023. On the evaluation of neural code translation: Taxonomy and benchmark. In 2023 38th IEEE\/ACM International Conference on Automated Software Engineering (ASE). 1529\u20131541."},{"key":"e_1_2_1_28_1","unstructured":"Li Li Xiang Gao Hailong Sun Chunming Hu Xiaoyu Sun Haoyu Wang Haipeng Cai Ting Su Xiapu Luo and Tegawend\u00e9 F Bissyand\u00e9. 2023. Software engineering for openharmony: A research roadmap. arXiv preprint arXiv:2311.01311."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE56229.2023.00089"},{"key":"e_1_2_1_30_1","volume-title":"Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1496\u20131508","author":"Liu Mingwei","year":"2023","unstructured":"Mingwei Liu, Yanjun Yang, Yiling Lou, Xin Peng, Zhong Zhou, Xueying Du, and Tianyong Yang. 2023. Recommending analogical APIS via knowledge graph embedding. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1496\u20131508."},{"key":"e_1_2_1_31_1","volume-title":"Interrater reliability: the kappa statistic. Biochemia medica, 22, 3","author":"McHugh Mary L","year":"2012","unstructured":"Mary L McHugh. 2012. Interrater reliability: the kappa statistic. Biochemia medica, 22, 3 (2012), 276\u2013282."},{"key":"e_1_2_1_32_1","volume-title":"Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning. In 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). 2450\u20132462","author":"Nashid Noor","year":"2023","unstructured":"Noor Nashid, Mifta Sintaha, and Ali Mesbah. 2023. Retrieval-Based Prompt Selection for Code-Related Few-Shot Learning. In 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). 2450\u20132462."},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639226"},{"key":"e_1_2_1_34_1","volume-title":"Unsupervised translation of programming languages. Advances in neural information processing systems, 33","author":"Roziere Baptiste","year":"2020","unstructured":"Baptiste Roziere, Marie-Anne Lachaux, Lowik Chanussot, and Guillaume Lample. 2020. Unsupervised translation of programming languages. Advances in neural information processing systems, 33 (2020), 20601\u201320611."},{"key":"e_1_2_1_35_1","unstructured":"Baptiste Roziere Jie M Zhang Francois Charton Mark Harman Gabriel Synnaeve and Guillaume Lample. 2021. Leveraging automated unit tests for unsupervised code translation. arXiv preprint arXiv:2110.06773."},{"key":"e_1_2_1_36_1","unstructured":"Marc Szafraniec Baptiste Roziere Hugh Leather Francois Charton Patrick Labatut and Gabriel Synnaeve. 2022. Code translation with compiler representations. arXiv preprint arXiv:2207.03578."},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/3611643.3616271"},{"key":"e_1_2_1_38_1","volume-title":"Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering. 15\u201325","author":"Wu Rongxin","year":"2011","unstructured":"Rongxin Wu, Hongyu Zhang, Sunghun Kim, and Shing-Chi Cheung. 2011. Relink: recovering links between bugs and changes. In Proceedings of the 19th ACM SIGSOFT symposium and the 13th European conference on Foundations of software engineering. 15\u201325."},{"key":"e_1_2_1_39_1","volume-title":"2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). IEEE","author":"Xia Chunqiu Steven","year":"2023","unstructured":"Chunqiu Steven Xia, Yuxiang Wei, and Lingming Zhang. 2023. Automated program repair in the era of large pre-trained language models. In 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE). IEEE, Melbourne, Australia, 1482\u20131494."},{"key":"e_1_2_1_40_1","volume-title":"2022 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering.","author":"Xia Chunqiu Steven","year":"2022","unstructured":"Chunqiu Steven Xia and Lingming Zhang. 2022. Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-Shot Learning. In 2022 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering."},{"key":"e_1_2_1_41_1","doi-asserted-by":"publisher","DOI":"10.1145\/3650212.3680323"},{"key":"e_1_2_1_42_1","volume-title":"Proceedings of the ACM on Software Engineering, 1, FSE","author":"Yang Zhen","year":"2024","unstructured":"Zhen Yang, Fang Liu, Zhongxing Yu, Jacky Wai Keung, Jia Li, Shuo Liu, Yifan Hong, Xiaoxue Ma, Zhi Jin, and Ge Li. 2024. Exploring and unleashing the power of large language models in automated code translation. Proceedings of the ACM on Software Engineering, 1, FSE (2024), 1585\u20131608."},{"key":"e_1_2_1_43_1","volume-title":"Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis. 1274\u20131286","author":"Yin Xin","year":"2024","unstructured":"Xin Yin, Chao Ni, Shaohua Wang, Zhenhao Li, Limin Zeng, and Xiaohu Yang. 2024. Thinkrepair: Self-directed automated program repair. In Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis. 1274\u20131286."},{"key":"e_1_2_1_44_1","volume-title":"Proceedings of the AAAI conference on artificial intelligence. 36","author":"Zhu Ming","year":"2022","unstructured":"Ming Zhu, Karthik Suresh, and Chandan K Reddy. 2022. Multilingual code snippets training for program translation. In Proceedings of the AAAI conference on artificial intelligence. 36, 11783\u201311790."}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3728941","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,7,16]],"date-time":"2025-07-16T16:49:28Z","timestamp":1752684568000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3728941"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,22]]},"references-count":44,"journal-issue":{"issue":"ISSTA","published-print":{"date-parts":[[2025,6,22]]}},"alternative-id":["10.1145\/3728941"],"URL":"https:\/\/doi.org\/10.1145\/3728941","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,22]]}}}