py2wasm draws on Nuitka to convert Python programs to WebAssembly and run them at 3x faster speeds, Wasmer says. Credit: Ollyy/Shutterstock WebAssembly runtime maker Wasmer has unveiled py2wasm, a Python-to-WebAssembly compiler that transforms Python programs to the WebAssembly (aka Wasm) binary instruction format. Using a fork of the Nuitka Python compiler, py2wasm converts Python programs to Wasm, allowing them to run without interpreter overhead. Introduced April 18, py2wasm addresses a situation in which the performance of Python programs in WebAssembly has been less than ideal, Wasmer founder and CEO Syrus Akbary wrote in a blog post. Akbary said that py2wasm gets about 70% of native Python speed, and is about 2.5x to 3x faster than the Python interpreter. Wasmer used Nuitka to speed up Python in WebAssembly because most of the hard work was already done to transpile Python code into underlying CPython interpreter calls. Nuitka works by transpiling a program’s Python calls into C, using inner CPython API calls, Akbary said. Nuitka supports most Python programs, and also can work as a code obfuscator, preventing anyone from decompiling a program. Because Nuitka does not yet work with Python 3.12, Wasmer had to recompile Python to Python 3.11 to WASI (WebAssembly Systems Interface) and use the generated libpython.a archive. Nuitka then could use this library when targeting WASI and WebAssembly to build the executable. Because the Nuitka transpiler executed in a 64-bit architecture but generated code was running in a 32-bit architecture, work had to be done to fix the prototype, Akbary said. InfoWorld Senior Writer Serdar Yegulalp contributed to this report. Related content analysis Beyond the usual suspects: 5 fresh data science tools to try today The mid-month report includes quick tips for easier Python installation, a new VS Code-like IDE just for Python and R users, and five newer data science tools you won't want to miss. By Serdar Yegulalp Jul 12, 2024 2 mins Python Programming Languages Software Development analysis Generative AI won’t fix cloud migration You’ve probably heard how generative AI will solve all cloud migration problems. It’s not that simple. Generative AI could actually make it harder and more costly. By David Linthicum Jul 12, 2024 5 mins Generative AI Artificial Intelligence Cloud Computing news HR professionals trust AI recommendations HireVue survey finds 73% of HR professionals trust AI to make candidate recommendations, while 75% of workers are opposed to AI making hiring decisions. By Paul Krill Jul 11, 2024 3 mins Technology Industry Careers how-to Safety off: Programming in Rust with `unsafe` What does it mean to write unsafe code in Rust, and what can you do (and not do) with the 'unsafe' keyword? The facts may surprise you. By Serdar Yegulalp Jul 11, 2024 8 mins Rust Programming Languages Software Development Resources Videos