Skip to content
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

Add compilers to roadmap #191

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions source/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ Desired features include:

**Expected outcomes:** fpm can generate source code distributions of packages that can be build using CMake and/or Meson.

## Improving Compilers

The aim of this project is to create and maintain an open source Fortran compiler as a community, here is a non-exhaustive list of (independent) features:

* compile all Fortran projects to binaries
* work interactively (Jupyter notebooks)
* in the browser
* works as the foundation for linters, VSCode language integration and documentation generators
certik marked this conversation as resolved.
Show resolved Hide resolved
* runs well on modern hardware (CPU, GPU, ...)

There are three open source compilers under development:

* LFortran: https://lfortran.org/
* Flang: https://releases.llvm.org/15.0.0/tools/flang/docs/index.html
certik marked this conversation as resolved.
Show resolved Hide resolved
* GFortran: https://gcc.gnu.org/wiki/GFortran

Copy link
Member

@gnikit gnikit Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider adding the actual projects and deliverables we have in mind for these (at least for LFortran which you control):

https://github.com/fortran-lang/fortran-lang.org/wiki/GSoC-2022-Project-ideas#language-server
https://github.com/fortran-lang/fortran-lang.org/wiki/GSoC-2022-Project-ideas#parser--asr-for-f2py

For the LSP stuff I would add some summaries from the discussion with the vscode-cpptools devs and email conversations. I will dig them up at a later point

Suggested change
### LFortran: Language Server
This project would be used to first serialize the ASR and then use it within a language server.
- Lfortran would need to create a copy of the LSP types, see example in [clangd:Protocol.h](https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clangd/Protocol.h).
- Use a serialization library like [RapidJSON](https://github.com/Tencent/rapidjson/) to send and receive the LSP requests/responses.
- Use an RPC communication library either in TypeScript or Python to launch an instance of the language server. For example messages received _from C++_ will be `JSON.parse(yourResponse)` into Typescript JSON, and then converted to RPC with the node module `vscode-jsonrpc`. Similarly, requests to C++ will be de-RPC'd and parsed into the server via the IO buffer, in C++ then cast the JSON into LSP types found in Protocol.h
- Add option in [Modern Fortran](https://github.com/fortran-lang/vscode-fortran-support) for VS Code (vscode-fortran-support) to integrate with the LFortran Language Server for easy usage and development, see GitHb issue [vscode-fortran-support/630](https://github.com/fortran-lang/vscode-fortran-support/issues/630)
**Expected outcomes:** LFortran can be used as a Fortran language server that can be used in other software such as source code editors and IDEs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@certik wanna have a look and tell me if I forgot something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a design discussion.

I would not recommend parsing the f2py output, because it means supporting that syntax, which complicates maintenance. For f2py's application, I think it's better to just parse Fortran itself, and possibly annotate with comments, both of which we can parse.

Also adding ASR nodes must be done carefully. We try avoiding adding nodes which are only used by one tool, as opposed to all of Fortran (or other languages).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me try to write down a roadmap, for the next half a year, which effectively is to compile "fpm".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the F2PY section if that makes things simpler and then iterate on the roadmap at a later point. I simply gathered the descriptions of the GSoC projects that had not been completed in 2022

## [Modern Fortran for Visual Studio Code](https://github.com/fortran-lang/vscode-fortran-support)

### Integration with the Fortran Package Manager and CMake
Expand Down