@inproceedings{3a43f2e128fb4c51a4fa4af85eecaa3d,
title = "Transpiling Python to Rust for Optimized Performance",
abstract = "Python has become the de facto programming language in machine learning and scientific computing, but high performance implementations are challenging to create especially for embedded systems with limited resources. We address the challenge of compiling and optimizing Python source code for a low-level target by introducing Rust as an intermediate source code step. We show that pre-existing Python implementations that depend on optimized libraries, such as NumPy, can be transpiled to Rust semi-automatically, with potential for further automation. We use two representative test cases, Black–Scholes for financial options pricing and robot trajectory optimization. The results show up to 12× speedup and 1.5× less memory use on PC, and the same performance but 4× less memory use on an ARM processor on PYNQ SoC FPGA. We also present a comprehensive list of factors for the process, to show the potential for fully automated transpilation. Our findings are generally applicable and can improve the performance of many Python applications while keeping their easy programmability.",
keywords = "Python, Rust, Embedded computing, Transpilation",
author = "Henri Lunnikivi and Kai Jylkk{\"a} and Timo H{\"a}m{\"a}l{\"a}inen",
note = "jufoid=62555; International Conference on Embedded Computer Systems: Architectures, Modeling and Simulation ; Conference date: 05-07-2020 Through 09-01-2021",
year = "2020",
month = oct,
day = "7",
doi = "10.1007/978-3-030-60939-9_9",
language = "English",
isbn = "978-3-030-60938-2",
volume = "12471",
series = "Lecture Notes in Computer Science",
publisher = "Springer",
pages = "127--138",
editor = "Alex Orailoglu and Matthias Jung and Marc Reichenbach",
booktitle = "Embedded Computer Systems: Architectures, Modeling, and Simulation",
}