Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alternate translation mode #4

Open
nanobowers opened this issue Jan 21, 2023 · 0 comments
Open

Add alternate translation mode #4

nanobowers opened this issue Jan 21, 2023 · 0 comments

Comments

@nanobowers
Copy link
Owner

There are many reasons why someone would want to perform a code translation, but two that come to mind are:

  1. Translate code and have it function identically to the source but not intend to touch the post-translated code much
  2. Intending to use it as a starting point for development in the target language.

Thusfar, this project attempts to strive for identical function (or as close as is reasonably possible) rather than a more idomatic translation that could be incorrect. High compatiblity most cases requires using wrappers in the target language, but this makes the target code less readable, less easy to modify and keeps baggage of the source language behind.

for instance, having a source of

if x:
    print(y)

and target of:

if py_is_bool(x)
  py_print(y)
end

may function identically, but you might rather have:

# no-wrappers but may not function identically to the source python for all cases of x and y
if x
  puts(y)
end

I think it should be possible to offer two modes, with and without wrappers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant