You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transpiled code seems to be highly backend dependant. Attempting something like a basic python slice already breaks c++ code:
def say_hi():
print( 'hello world'[3:6])
==>
File "./rusthon.py", line 539, in build
pak = translate_to_cpp( pyjs, cached_json_files=cached_json ) ## pak contains: c_header and cpp_header
File "<string>", line 13898, in translate_to_cpp
File "<string>", line 1244, in visit
File "<string>", line 13547, in visit_Module
File "<string>", line 1244, in visit
File "<string>", line 6341, in visit_FunctionDef
File "<string>", line 12084, in _visit_function
File "<string>", line 12212, in generate_generic_branches
File "<string>", line 1244, in visit
File "<string>", line 13723, in visit_Print
File "<string>", line 1244, in visit
File "<string>", line 10764, in visit_Subscript
__main__.GenerateSlice: {'upper': '6', 'lower': '3', 'slice': <_ast.Slice object at 0x102deabd0>, 'step': None, 'value': 'std::string("hello world")'}
Looks like to do some effective crossplatform program rusthon needs to reimplement a generic standard library which sometimes will map to the native standard library or implement some minimal code. Or maybe I have missed this support. Is it possible to write something like print(a.replace("h", "a")) and have it work on C++, Go, and Java?
The text was updated successfully, but these errors were encountered:
This crosses needs with a PyPy project, where a lot of new languages written in RPython could benefit from such library of functionality with a known behaviour.
I would be interested in helping to create a python standard library for the JS backend. E.g. starting with math and random and then looking further to what needs to be done.
Would it make sense to create a repo under the rusthon umbrella for this purpose?
The transpiled code seems to be highly backend dependant. Attempting something like a basic python slice already breaks c++ code:
Looks like to do some effective crossplatform program rusthon needs to reimplement a generic standard library which sometimes will map to the native standard library or implement some minimal code. Or maybe I have missed this support. Is it possible to write something like
print(a.replace("h", "a"))
and have it work on C++, Go, and Java?The text was updated successfully, but these errors were encountered: