Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why erg's python backend is pyc bytecode but not py source file #464

YAGregor started this conversation in General
Discussion options

Does not this means erg has only Interoperability with Cpython? I think python is not only Cpython

You must be logged in to vote

Replies: 1 comment

Comment options

Erg also has a backend that outputs Python scripts, but this is an experimental feature.
It may also be possible that a Python processor compatible with CPython bytecode (e.g. PyPy?) could be used as an interpreter for Erg, but this is not guaranteed.

Why are we mainly developing a CPython bytecode backend? The reason is to gain syntactic/semantic freedom.
Erg uses Python as a backend to access Python assets, but syntactically and semantically they are very different.
It is difficult to treat Erg and Python in the same representation without lowering it to the bytecode level.

For example, a backend that transpiles to Python scripts cannot use the inline module feature of Erg. Also, Python's match statement was introduced in Python 3.10, but Erg's match expression (not statement) does not use it and is therefore available regardless of the version of Python being used.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /