-
Notifications
You must be signed in to change notification settings - Fork 171
GSoC 2022 Ideas
Below we list developed project ideas listed by priority. The "High Priority" section contains projects that we are especially interested in, as they lie on the critical path to a minimal viable product: make LPython usable for simpler projects.
However, feel free to propose any project idea that you like to improve LPython, for example by browsing open issues:
https://github.com/lcompilers/lpython/issues
If you are interested in applying, please get in touch with us at either our Zulip chat or our mailinglist:
We will help answer questions and help with finding and refining a project idea. You do not need to have a prior experience with compilers, we will teach you. It is fun. LPython is written in C++, but we do not use many advanced features and if you have any programming experience you will be able to pick it up.
Here are a few projects for inspiration. You are welcome to propose your own idea.
Potential mentors:
- Ondřej Čertík
- Gagandeep Singh
- Rohit Goswami
- Thirumalai Shaktivel
- Naman Gera
- Smit Lunagariya
Right now we use CPython itself to do the parsing to CPython AST, then we convert to LPython AST from Python: https://github.com/lcompilers/lpython/blob/f81caecd9897ac38cc6c08eb8ca22793cbb1dddc/src/runtime/lpython_parser.py, serialize to a file and deserialize from C++. That is a slow process. In order to get as fast parser as possible, we need to parse from C++ and generate the AST nodes directly. To do that, we should explore whether the CPython parser (implemented in C) could be used. If not, we should write our own parser using re2c and Bison.
Expected outcomes: LPython can parse any Python code to AST using its own very fast parser.
Skills preferred: Python and C++ programming
Difficulty: intermediate, 350 hours
Mentors - Ondřej Čertík
Currently LPython requires all arguments to functions to be typed. In this project we will extend LPython to be able to compile functions where argument types are templates (generic programming). The untyped function becomes a generic function, and then when it is used with concrete types, the template gets instantiated at compile time, ahead of time.
Expected outcomes: LPython can compile untyped code using generics.
Skills preferred: Python and C++ programming
Difficulty: intermediate, 350 hours
Mentors - Ondřej Čertík
The roadmap https://github.com/lcompilers/lpython/issues/155 issue contains a list of Python features that we want implemented. Each feature should be implemented at the ASR level and in the LLVM backend to be complete. If AST is missing for a given feature, then it has to be implemented also.
Here you can pick a feature or a set of features from the list and propose it as a GSoC project. In other words, this project idea can accommodate multiple student projects.
List of resources for more information and background:
- ASR.asdl, the comment at the top explains the design motivation
- asr_to_llvm.cpp is the LLVM backend
- ast_to_asr.cpp is the AST -> ASR conversion where all semantics checks are being done and compiler errors reported to the user
- Developer Tutorial
If you have any questions, please do not hesitate to ask, we can discuss or provide more details.
Mentors: Ondrej Certik (@certik)
This project would entail working with LPython, LLVM, Emscripten, and Webassembly to allow running LPython in the browser.
- use LLVM and Emscripten to compile LPython code to Webassembly
- create custom Webassembly backend for LPython and compile LPython itself to Webassembly
Relevant issues:
- https://gitlab.com/lfortran/lfortran/-/issues/583
- https://gitlab.com/lfortran/lfortran/-/merge_requests/1549
- https://gitlab.com/lfortran/lfortran/-/merge_requests/1385
Expected outcomes: LPython can compile Python code, as well as bootstrap itself, to Weabassembly.
Skills preferred: Python and C++ programming
Difficulty: intermediate, 350 hours
Mentors - Ondřej Čertík
This project would be used to first serialize the ASR and then use it within a language server.
Expected outcomes: LPython can be used as a Python language server that can be used in other software such as source code editors and IDEs.
Skills preferred: Python and C++ programming
Difficulty: intermediate, 350 hours
Mentors: Ondřej Čertík (@certik)
LPython has a very fast x86 code generation backend implemented in asr_to_x86.cpp which allows very fast compiling (many times faster than going via LLVM). The x86 backend does not do any optimizations, so it is meant to be used in Debug mode only. As every backend in LPython, the backend receives the code as ASR, and it recursively walks over each ASR node and generates x86 machine code.
The purpose of this project would be to extend this backend to cover more Python features.
If you have any questions, please do not hesitate to ask, we can discuss or provide more details.
Mentors: Ondrej Certik (@certik)
Add a backend to LPython that automatically exposes (eventually all) LPython module contents to Python. That will allow to use LPython compiled code to be used from CPython itself.
Related issues:
- lfortran#133: Automatic wrappers ASR -> Python
Mentors: Ondrej Certik (@certik),