• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JuliaCN/Py2Jl.jl: Python to Julia transpiler.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

JuliaCN/Py2Jl.jl

开源软件地址:

https://github.com/JuliaCN/Py2Jl.jl

开源编程语言:

Python 84.1%

开源软件介绍:

Python To Julia Transpiler

example.png

This project aims at providing a Py2Jl transpiler targeting the compatibility level 1 and 2 mentioned in the section #CPython Compatibility Level, while the methods to support libraries like numpy, scipy or pytorch will be given in the documentation.

This project is in its early stage, and now we have only partly achieved the level 1 compatibility. This means that you can already write performant Julia code using pure Python, but you might not succeed in transforming any existing Python codebase to Julia with this tool.

Usage

python -m Py2Jl input.py output.jl

To run the generated Julia code, you should add the package Py2JlRuntime to your environment (e.g., pkg> dev runtime-support/Py2JlRuntime). The package Py2JlRuntime is included in the runtime-support folder.

CPython Compatibility Level

  1. Level 1: trivial transformation for seemingly similar code correspondence. With this level, Python code transpiled to Julia usually does not work the same.

  2. Level 2: semantics-driven transformation that respects the Python languages semantics and behaviours. With this level, Pure Python code transpiled to Julia strictly works the same.

  3. Level 3: the transpiler respects the original execution model of CPython. such as some unusual functions in the inspect module, sys._getframe. This level is usually forcing the transpiler to use the same or similar object models as the original CPython, which has negative performance implications.

  4. Level 4: the transpiler respects the original object memory layout of CPython. This means the transpiler becomes a replication of the original CPython, which is too boring. This level also fully supports C-extensions, but it is not the only approach.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap