by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Noah
    @coolreader18
    You can just name it something like getwindowsversion_type, and change the vm.try_class call to use that too. CPython stores it in a global variable, but that's not that idiomatic for rust, so we try to keep the types in modules.
    Jeong YunWon
    @youknowone
    I think we don’t need to export the type
    sys.getwindowsversion always will be function
    there is no way to access the type directly
    Basix
    @BasixKOR
    Ah ok
    Thank you all
    Noah
    @coolreader18
    @youknowone but we do, otherwise vm.class() will fail when we try to instantiate it from getwindowsversion
    Jeong YunWon
    @youknowone
    uh, i didn’t know that. how cpython handle it?
    Noah
    @coolreader18
    They just have a static variable that they initialize at startup
    Arthur Depasse
    @LeBoucEtMistere
    Hey ! Newbie on the project here, I really want to get involved since I love python and rust. I am already working on extending the os module and I have quite a lot of questions around this. Particularly in this comment (https://github.com/RustPython/RustPython/pull/1984#issuecomment-658315846), regarding a possible refactor to improve code clarity, and this comment (https://github.com/RustPython/RustPython/pull/1984#issuecomment-658317377) regarding the various tests suites.
    For the latest, I finally figured out that integration tests should probably be written in https://github.com/RustPython/RustPython/blob/master/tests/snippets/stdlib_os.py , can anyone confirm ?
    Andrew Bastien
    @volundmush
    so what's happening in RustySnakes land?
    Bolun Thompson
    @BolunThompson
    Hello! In the development guide you mention that Lib/ is composed of files copied from CPython. What are the criteria for having a file copied into Lib/?
    Jeong YunWon
    @youknowone
    No strict policy but at least possible to import
    Bolun Thompson
    @BolunThompson
    Another question, but I'm trying to fix RustPython/RustPython#1357. In there, there is an issue where method __init_subclass__ isn't a class method by default. When creating python methods (from my knowledge, using byte code instruction MAKE_FUNCTION then storing it on a class), is there a way to access the class it is declared upon or should I be going about this another way?
    Bolun Thompson
    @BolunThompson
    I may have made a wrong assumption there, so sorry if I'm not making sense!
    Bolun Thompson
    @BolunThompson
    never mind, I solved my problem
    Jeong YunWon
    @youknowone
    because some functions take both bytes and str as valid argument especially when it is used for foreign interface (like os), I think we need a term to call both bytes and str at same time but there isn’t one yet. any idea?
    Noah
    @coolreader18
    Isn't there PyPathLike?
    Jeong YunWon
    @youknowone
    it is corresponding to path_t in CPython
    and something is not simply a path
    like os_system or execv in the opened PR
    Basix
    @BasixKOR
    Should we implement the undocumented functions of msvcrt module?
    it's used in CPython tests but it seems like it's okay to just disable them
    Jeong YunWon
    @youknowone
    As I know, we don’t have strict policy. Documented first but we also are copying undocumented behaviors too
    CPython is the sole live standard so even if any feature is documented or not, people regard its behavior is what Python is (unless it is explicitly deprecated)
    Basix
    @BasixKOR
    aha, okay then
    image.png
    btw after disabling some undocumented functions I successfully ran CPython tests on Windows!
    Jeong YunWon
    @youknowone
    could you make a PR about it? let’s see which one is better just disabling it or disabling it only for windows
    and running test on windows - that’s definitely a good news
    congratulation and thank you
    Basix
    @BasixKOR
    msvcrt is only for windows so probably won't cause problems on other platforms
    guess i'm making two PRs
    Basix
    @BasixKOR
    Basix
    @BasixKOR
    it seems like the test fails on testInfiniteRecursion and it says thread 'main' has overflowed its stack
    i'll make a issue about it
    Stuart Hunt
    @onnoowl_gitlab

    Hi! First, I wanted to quickly say thank you to everyone involved in this project for your hard work. I just stumbled across this, and it looks amazing!

    Second, I had a quick question about the performance of rustpython. I ran a quick super trivial/naive benchmark (https://gitlab.com/-/snippets/2000967) and saw that it ran about half as slow in rustpython as in python. Do you think rustpython's performance will eventually overtake the default python interpreter, or is python thoroughly optimized enough that it would be difficult to match/surpass?

    Jeong YunWon
    @youknowone
    In general, CPython is not optimized for speed. Unless CPython change the policy for speed, any implementation can beat CPython, eventually.
    Stuart Hunt
    @onnoowl_gitlab
    So my current python version is Python 3.6.4 :: Anaconda, Inc.. Is that using CPython under the covers?
    Noah
    @coolreader18
    Yep! CPython is just the default, reference interpreter of Python
    Sergey Filkin
    @liberium
    Does RustPython have GIL? Does it compile JIT?
    Noah
    @coolreader18
    It does GIL-less threading (at a performance cost) and it does not do JIT compilation
    We don't have threading with a GIL available, but it would in theory not be too difficult to implement with how we've structured threading support
    Sergey Filkin
    @liberium
    Is JIT compilation planned? How does it compare with CPython in terms of performance?
    Noah
    @coolreader18
    We don't have a plan towards JIT compilation, though it wouldn't be totally impossible -- probably would require a lot of restructuring though. Performance is ~2-10x slower than CPython atm, though the GIL-less threading might impact that; I haven't done a ton of benchmarks against CPython since we recently added the option to disable threading altogether
    Alan Justino da Silva
    @alanjds

    since we recently added the option to disable threading altogether

    This is interesting. How was it done? nooping the mutexes? May I should search for the PR to see...

    Noah
    @coolreader18
    @alanjds yup, pretty much, just replacing Mutexes with RefCells: RustPython/RustPython#2018
    common/src/{cell,rc}.rs has the "logic" for it on master
    Alan Justino da Silva
    @alanjds
    The solution was very nice! Thanks for the PR link.