Skip to content

Commit

Permalink
Improved documentation
Browse files Browse the repository at this point in the history
* Added new development status
* Listed all supported and unsupported features
* Improved the AST vs ASR example
  • Loading branch information
Sc0rpi0n101 committed Jul 17, 2019
1 parent 6734fd4 commit 1b95756
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 22 deletions.
1 change: 1 addition & 0 deletions doc/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ nav:
- Home: index.md
- installation.md
- language.md
- progress.md
- Developer's Guide:
- design.md
- developer_tutorial.md
Expand Down
8 changes: 6 additions & 2 deletions doc/nb/AST and ASR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"```fortran\n",
"integer function f(a, b) result(r)\n",
"integer, intent(in) :: a, b\n",
"r = a + b\n",
"integer :: c, d\n",
"c = a + b - d\n",
"r = c * a",
"end function\n",
"```\n",
"and look at how the AST and ASR looks like.\n",
Expand All @@ -29,7 +31,9 @@
"src = \"\"\"\\\n",
"integer function f(a, b) result(r)\n",
"integer, intent(in) :: a, b\n",
"r = a + b\n",
"integer :: c, d\n",
"c = a + b - d\n",
"r = c * a",
"end function\n",
"\"\"\"\n",
"ast = src_to_ast(src, translation_unit=False)\n",
Expand Down
19 changes: 10 additions & 9 deletions doc/src/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ The ASR is designed to have the following features:
construction, the ASR classes always contain valid Fortran code and the rest
of LFortran can depend on it.

Note: Information that is lost when parsing source to AST: whitespace,
multiline/single line if statement distinction, case sensitivity of keywords.
Information that is lost when going from AST to ASR: detailed syntax how
variables were defined and the order of type attributes (whether array
dimension is using the `dimension` attribute, or parentheses at the variable;
or how many variables there are per declaration line or their order), as ASR
only represents the aggregated type information in the symbol table.

Note: ASR is the simplest way to generate Fortran code, as one does not
## Notes:

Information that is lost when parsing source to AST:

whitespace, multiline/single line if statement distinction, case sensitivity of keywords.
Information that is lost when going from AST to ASR:

detailed syntax how variables were defined and the order of type attributes (whether array dimension is using the `dimension` attribute, or parentheses at the variable; or how many variables there are per declaration line or their order), as ASR only represents the aggregated type information in the symbol table.

ASR is the simplest way to generate Fortran code, as one does not
have to worry about the detailed syntax (as in AST) about how and where
things are declared. One specifies the symbol table for a module, then for
each symbol (functions, global variables, types, ...) one specifies the local
Expand Down
22 changes: 11 additions & 11 deletions doc/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Python, MATLAB or Julia) as well as compile to binaries with the goal to run
user's code on modern architectures such as multi-core CPUs and GPUs.

Website:
[https://lfortran.org/](https://lfortran.org/)
[https://lfortran.org/](https://lfortran.org/)
Main repository:
[https://gitlab.com/lfortran/lfortran](https://gitlab.com/lfortran/lfortran)
[https://gitlab.com/lfortran/lfortran](https://gitlab.com/lfortran/lfortran)
Try online using Binder:
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb)

## Feature Highlights

LFortran is in development, there are features that work today, and there are
features that are being implemented.
features that are being implemented. You can also check out the Development Status section for more information on features being supported and being worked on.

### Works today

* **Interactive, Jupyter support**
* **Interactive, Jupyter support**
LFortran can be used from Jupyter as a Fortran kernel, allowing a
Python/Julia style rapid prototyping and exploratory workflow
(see the [static](https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c)
Expand All @@ -29,22 +29,22 @@ features that are being implemented.
example notebook).
Or it can be used from the command-line in an interactive prompt (REPL).

* **Clean, modular design, usable as a library**
* **Clean, modular design, usable as a library**
LFortran is structured around two independent modules, AST and ASR, both of
which are standalone (completely independent of the rest of LFortran) and
users are encouraged to use them independently for other applications and
build tools on top. See the [Design](design.md)
and [Developer Tutorial](developer_tutorial.md) documents for more details.

* **Interoperation with GFortran**
* **Interoperation with GFortran**
LFortran can parse GFortran module files into an ASR and generate a Fortran
wrapper that can be compiled with any Fortran compiler and linked with the
original GFortran compiled module.

* **Create executables**
* **Create executables**
It can create executables just like other Fortran compilers.

* **Runs on Linux, Mac and Windows**
* **Runs on Linux, Mac and Windows**
All three platforms are regularly tested by our CI.


Expand All @@ -53,7 +53,7 @@ features that are being implemented.
These features are under development, there is a link to the corresponding
issue so that you can track the progress by following it.

* **Native interoperation with other languages (and other Fortran compilers)**
* **Native interoperation with other languages (and other Fortran compilers)**
It can automatically call code written in other languages (such as C or
Python) just by using the `use` statement, see
[#44](https://gitlab.com/lfortran/lfortran/issues/44). It understands
Expand All @@ -62,13 +62,13 @@ issue so that you can track the progress by following it.
see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), which allows to
use LFortran with production codes today.

* **Modern hardware support**
* **Modern hardware support**
Thanks to LLVM, the goal of LFortran is to run on modern hardware and take
advantage of native Fortran language constructs (such as `do concurrent`)
to run on multi-core CPUs and GPUs, see
[#57](https://gitlab.com/lfortran/lfortran/issues/57).

* **Full Fortran 2018 support**
* **Full Fortran 2018 support**
Currently only a subset of Fortran is implemented, but the goal is to have
a full implementation of the latest Fortran 2018 standard, see
[#58](https://gitlab.com/lfortran/lfortran/issues/58).
Expand Down
94 changes: 94 additions & 0 deletions doc/src/progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# LFortran Development Status


## Development

**LFortran** is currently under development and some of the features of Fortran might not be supported currently. The information regarding which functions are currently supported and which one's are still being worked on will be available in this section. You can submit any new issue you find while using LFortran to our [issue tracker](https://gitlab.com/lfortran/lfortran/issues). You can also check out any of the issues mentioned in the sections below and provide suggestions and ideas to help us get the feature implemented.

## Fortran Standards Supported

LFortran currently supports the latest Fortran standard Fortran 2018. Since 2018 was a revision of Fortran90, most of the features of F90 are supported.

### Currently Supported:

- Fortran 2018
- Fortran 2008
- F90

###Not Supported/Currently in Development:

- F77
- F90
- F95

### Related Issues:

- [#120](https://gitlab.com/lfortran/lfortran/issues/120)

## Features Supported

LFortran is currently in development andyou might find some unsupported features while using it. We are working on fixing the issues and improving and expanding LFortran. You can also help out by reporting any new bug you find or you can check out any of the issues mentioned in the section and help us implement the feature faster.

### Currently Supported:

- AST Genreation
- ASR Generation for most nodes
- Fortran Modules
- Functions
- Subroutines
- Basic data types like int, float, character
- Binary Operations
- Conditional and iterative statements
- Printing

### Not Supported/Currently in Development

- Strings and Arrays
- Nested Function Definitions
- Complex Numbers
- Optional Arguments
- ASR not created for a few features supported by lfortran
- Conditional and iterative statements
- Function Calls
- Arithmatic assignment(like a = 10)
- Assignments with binary operations including any number
- Logical Variables
- Print Statements
- Intrinsic Fortran Functions like abs, sin, cos etc.

### Related Issues

- [#114 Strings](https://gitlab.com/lfortran/lfortran/issues/114)
- [#121 ASR](https://gitlab.com/lfortran/lfortran/issues/121)
- [#122 Nested Function Definitions](https://gitlab.com/lfortran/lfortran/issues/122)
- [#125 Complex Numbers](https://gitlab.com/lfortran/lfortran/issues/125)
- [#126 Optional Arguments](https://gitlab.com/lfortran/lfortran/issues/126)

## Intrinsic Functions

LFortran does not support some of the standard intrinsic functions for the Fortran standard. Work is being done on having support for these functions. The testing for the functions is still being done. The list will be updated with the rest of the functions soon.

### Currently Supported:

- log

### Not Suported/Currently in Development:

- ABS
- SQRT
- SIN
- COS
- TAN
- ASIN
- ACOS
- ATAN
- EXP
- INT
- REAL
- NINT
- FLOOR
- FRACTION
- REAL
- MAX
- MIN
- MOD

0 comments on commit 1b95756

Please sign in to comment.