Skip to content

Which modules to implement from the Python standard library #200

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

Open
certik opened this issue Mar 4, 2022 · 15 comments
Open

Which modules to implement from the Python standard library #200

certik opened this issue Mar 4, 2022 · 15 comments

Comments

@certik
Copy link
Contributor

certik commented Mar 4, 2022

The Python standard library has a lot of modules: https://docs.python.org/3/library/index.html, but many of them are rarely used. First we should concentrate on the most commonly used modules, probably:

  • sys
  • os
  • string
  • time
  • datetime
  • cmath
  • decimal
  • numbers
  • fractions
  • statistics
  • glob
  • tempfile
  • itertools
  • functools
  • pickle
  • csv
  • argparse
  • logging
  • platform
  • json
  • pdb
  • ast

Some of these might be initially difficult to implement, but some of these might be doable already.

@Smit-create
Copy link
Collaborator

I can work on implementing statistics.

@namannimmo10
Copy link
Collaborator

namannimmo10 commented Mar 6, 2022

I can begin with the random module

@Oshanath
Copy link
Contributor

Should these modules be implemented in C++ or in LPython itself?

@certik
Copy link
Contributor Author

certik commented Mar 14, 2022

All these modules should be in LPython, i.e., the subset of Python that LPython can compile. You can try to implement some simple function and if LPython is missing some feature, you can open up an issue for it.

@Oshanath
Copy link
Contributor

Basically if I were to implement something from this list, what I should do is refer to the Python documentation of that module and implement those same functions the same way using LPython. Am I correct?

@certik
Copy link
Contributor Author

certik commented Mar 14, 2022

Yes, and add them to src/runtime and add tests to integration_tests and register them in integration_tests/run_tests.py, they will be run via CPython (to ensure the test script is written correctly) as well as LPython (to ensure everything actually compiles).

@rajpratyush
Copy link

I think itertools, datetime, sys and os should also be added to the lpython since they are used extensively in scientific computing. i can start the work for sys and os modules.

@namannimmo10
Copy link
Collaborator

I think itertools, datetime, sys and os should also be added to the lpython since they are used extensively in scientific computing. i can start the work for sys and os modules.

Great. Let us know if you need any help!

@rajpratyush
Copy link

sure could you provide me up links to the development guide so that I can set up the project locally. or any kind of documentation website

@namannimmo10
Copy link
Collaborator

You can find the installation guide in the README.md file. For now, see https://docs.lfortran.org/developer_tutorial/ for more information -- LPython follows the same design as in LFortran.

@rajpratyush
Copy link

so it doesn't have a documentation website ?

@certik
Copy link
Contributor Author

certik commented Mar 24, 2022

We currently don't have dedicated LPython documentation. We will eventually add it.

@rajpratyush
Copy link

how about building one?

@certik
Copy link
Contributor Author

certik commented Mar 24, 2022

Yes, we should.

@Umesh-JNU
Copy link

I would like to work for argparse. Can you please help me how to start?

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

6 participants