vbe0201 / 3DS.py

Python on your Nintendo 3DS
Apache License 2.0
133 stars 7 forks source link

What has been of upstreaming? #7

Closed mirh closed 4 years ago

mirh commented 4 years ago

There was once an attempt https://bugs.python.org/issue22623

vbe0201 commented 4 years ago

I wasn't aware of this issue yet, good catch. Many of the relevant patches are already included in similar ways. The people from devkitPro (the project requires their toolchains) are deeply involved in the 3DS homebrew scene, which is why their ecosystem aims to bring a POSIX environment to platforms (mostly Nintendo consoles) that couldn't violate POSIX any more, which, of course, brings up conflicts.

Though devkitPro's efforts make it possible to bring a lot of existing C code (including cpython) to the 3DS, there are also limitations. For example when it comes to random data, /dev/urandom is commonly used for generation- though it compiles fine, the syscalls fails because the OS of the 3DS is modelled completely different. That said, my personal goal isn't bringing everything related to POSIX to the 3DS, but have a stable port of Python that only relies on resources that are actually provided and usable. chroot, fchdir and symlink are examples of POSIX functions that would never run on the 3DS, and thus cannot be used. That's why there are certain modules that wrap around functionality that couldn't be brought to the 3DS in a sane way (for example pwd), which is why they're excluded from the compiled extensions.

All development currently goes to the rewrite branch, which makes use of a separate Python fork instead of nasty patch files which may break easily are cumbersome to update. For further discussion, feel free to join our Discord server and mention Vale#5252.

mirh commented 4 years ago

Randomness could be delegated to newlib's getentropy I guess? And symlink and whatnots are already supposed not to be always available/universal AFAICT. All without too much bother to them.

Anyway, well, thanks. This was nice to know.

mirh commented 4 years ago

There was also this other port btw https://github.com/ObsidianX/3ds_monty