Extending PyJL - Transpiling Python Libraries to Julia

Authors Miguel Marcelino , António Menezes Leitão

Thumbnail PDF


  • Filesize: 0.64 MB
  • 14 pages

Document Identifiers

Author Details

Miguel Marcelino
  • INESC-ID/Instituto Superior Técnico University of Lisbon, Portugal
António Menezes Leitão
  • INESC-ID/Instituto Superior Técnico University of Lisbon, Portugal

Cite AsGet BibTex

Miguel Marcelino and António Menezes Leitão. Extending PyJL - Transpiling Python Libraries to Julia. In 11th Symposium on Languages, Applications and Technologies (SLATE 2022). Open Access Series in Informatics (OASIcs), Volume 104, pp. 6:1-6:14, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


Many high-level programming languages have emerged in recent years. Julia is one of these languages, claiming to offer the speed of C, the macro capabilities of Lisp, and the user-friendliness of Python. Julia’s syntax is one of its major strengths, making it ideal for scientific and numerical computing. Furthermore, Julia’s high-performance on modern hardware makes it an appealing alternative to Python. However, Python has a considerable advantage over Julia: its extensive library set. There have been efforts to make Python libraries available to Julia either through Foreign Function Interfaces (FFI’s), or through manual translation, but both have their tradeoffs: FFI’s do not take advantage of Julia’s performance, as they call Python’s Virtual Machine, and manual translation is demanding and time-consuming. To address these issues and bridge the gap between the two languages, we propose PyJL, a transpilation tool that converts Python source-code to human-readable Julia source-code. Although the development of PyJL is still at an early stage, our preliminary results reveal that the generated code follows the pragmatics of Julia and is capable of high performance.

Subject Classification

ACM Subject Classification
  • Software and its engineering → Source code generation
  • General and reference → Cross-computing tools and techniques
  • Source-to-Source Compiler
  • Automatic Transpilation
  • Library Translation
  • Python
  • Julia


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Babel. Babel, September 2012. Retrieved April 7th, 2022 from: URL: https://github.com/babel/babel.
  2. Ira D. Baxter, Christopher Pidgeon, and Michael Mehlich. DMS: Program Transformations for Practical Scalable Software Evolution. In ICSE '04: Proceedings of the 26th International Conference on Software Engineering, pages 625-634, Edinburgh International Conference Centre, Scotland, UK, 2004. Semantic Designs. Google Scholar
  3. Jeff Bezanson, Stefan Karpinski, Viral Shah, Alan Edelman, et al. Julia Language Documentation - Performance Tips, 2014. Chapter 3, p.279-299. Google Scholar
  4. Mateusz Bysiek, Aleksandr Drozd, and Satoshi Matsuoka. Migrating Legacy Fortran to Python While Retaining Fortran-Level Performance through Transpilation and Type Hints. In 2016 6th Workshop on Python for High-Performance and Scientific Computing (PyHPC), pages 9-18, 2016. URL: https://doi.org/10.1109/PyHPC.2016.006.
  5. James R. Cordy, Thomas R. Dean, Andrew J. Malton, and Kevin A. Schneider. Source transformation in software engineering using the TXL transformation system. Information and Software Technology, 44(13), pages 827-837, 2018. URL: https://doi.org/10.1016/s0950-5849(02)00104-0.
  6. Intel Corporation. MCS-86 Assembly Language Converter Operating Instructions for ISIS-II Users, 1979. Google Scholar
  7. Google. Pytype: A static type analyzer for Python code, March 2015. [Online. Retrieved February 25th, 2022 from: https://github.com/google/pytype].
  8. Isaac Gouy. The Computer Language Benchmarks Game, 2007. Retrieved April 16th, 2022 from: URL: https://salsa.debian.org/benchmarksgame-team/benchmarksgame.
  9. Jim Hugunin. Python and java: The best of both worlds. In Proceedings of the 6th international Python conference, volume 9, pages 2-18, Reston, VA, 1997. Citeseer. Google Scholar
  10. Jim Hugunin. IronPython Home Page, 2013. [Online. Retrieved April 6th, 2022 from: https://ironpython.net/].
  11. Philip Japikse, Kevin Grossnicklaus, and Ben Dewey. Introduction to TypeScript. Apress, 2017. Chapter 7. URL: https://doi.org/10.1007/978-1-4842-2478-6.
  12. JuliaArrays. Offsetarrays.jl, January 2014. Retrieved April 11th, 2022 from: URL: https://github.com/JuliaArrays/OffsetArrays.jl.
  13. JuliaCN. Py2Jl, 2018. [Online. Retrieved 19th April, 2022 from: https://github.com/JuliaCN/Py2Jl.jl].
  14. JuliaLang. The julia language - 1.7.3, May 2022. Google Scholar
  15. António Menezes Leitão. The next 700 programming libraries. In Proceedings of the 2007 International Lisp Conference, ILC '07, New York, NY, USA, 2007. Association for Computing Machinery. URL: https://doi.org/10.1145/1622123.1622147.
  16. Mark Lutz. Learning Python - 3rd Edition. O'Reilly Media, Inc., 2007. Google Scholar
  17. Miguel Marcelino and António Menezes Leitão. Transpiling Python to Julia using PyJL. In Proceedings of the 2022 European Lisp Conference. Zenodo, March 2022. URL: https://doi.org/10.5281/zenodo.6332890.
  18. Andrei Markeev. ts2c: JavaScript/TypeScript to C Transpiler, 2016. [Online. Retrieved March 30th, 2022 from: https://github.com/andrei-markeev/ts2c].
  19. Travis Oliphant. NumPy, 2009. [Online. Retrieved May 30th, 2022 from: https://numpy.org].
  20. Armin Rigo. Pypy, 2007. [Online. Retrieved April 17th, 2022 from: https://www.pypy.org/].
  21. Arun Sharma, Lukas Martinelli, Julian Konchunas, and John Vandenberg. Py2many: Python to many CLike languages transpiler, 2015. Retrieved April 22nd, 2022 from: URL: https://github.com/adsharma/py2many.
  22. Guido van Rossum and Python Development Team. The Python Language Reference - Release 3.9.7, August 2021. [Online. Retrieved April 9th, 2022 from: https://docs.python.org/release/3.9.7/].
  23. Andrea Zanelli, Tommaso Sartor, Peter Bowyer, and Dominik Moritz. Prometeo - An experimental Python-to-C transpiler, 2017. [Online. Retrieved 19th October, 2022 from: https://github.com/zanellia/prometeo].
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail