You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/_index.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,19 +5,19 @@ features that are being implemented.
5
5
6
6
## Works today
7
7
8
-
***Best possible performance for numerical, array-oriented code**
8
+
***Best possible performance for numerical, array-oriented code**
9
9
LPython gives you the speed you need for your numerical, array-oriented code. With LPython, you can write Python code that is as fast as C or C++. This is because LPython compiles your code to optimized machine code, which is the fastest way to run code on a computer.
10
10
11
-
***Code compatability with CPython**
11
+
***Code compatability with CPython**
12
12
If LPython compiles and runs a code, then it will run in CPython.
13
13
14
-
***Seamless interoperability with CPython**
14
+
***Seamless interoperability with CPython**
15
15
LPython can call functions in CPython libraries. This feature permits “break-out” to Numpy, TensorFlow, PyTorch, and even to matplotlib. The break-outs will run at ordinary (slow) Python speeds, but LPython accelerates the mathematical portions to near maximum speed.
16
16
17
-
***Just-In-Time (JIT) compilation**
18
-
LPython also supports Just-in-time compilation which requires only decorating Python function with @lpython. One can also specify the desired backend, as in, `@lpython(backend=“c”)` or `@lpython(backend=“llvm”)`. Only C is supported at present; LLVM and others will be added in the near future.
17
+
***Just-In-Time (JIT) compilation**
18
+
LPython also supports Just-in-time compilation which requires only decorating Python function with `@lpython`. One can also specify the desired backend, as in, `@lpython(backend=“c”)` or `@lpython(backend=“llvm”)`. Only C is supported at present; LLVM and others will be added in the near future.
19
19
20
-
***Clean, modular design, usable as a library**
20
+
***Clean, modular design, usable as a library**
21
21
LPython is structured around two independent modules, AST (Abstract Syntax
22
22
Tree) and ASR (Abstract Semantic Representation), both of which are
23
23
standalone (completely independent of the rest of LPython) and users are
@@ -26,13 +26,13 @@ features that are being implemented.
26
26
[Developer Tutorial](https://docs.lfortran.org/developer_tutorial/) documents for
27
27
more details.
28
28
29
-
***Create executables**
29
+
***Create executables**
30
30
It can create fast optimized executables unlike other interpreted compilers.
31
31
32
-
***Runs on Linux, Mac, Windows and WebAssembly**
32
+
***Runs on Linux, Mac, Windows and WebAssembly**
33
33
All four platforms are regularly tested by our CI.
34
34
35
-
***Several backends**
35
+
***Several backends**
36
36
The LLVM can be used to compile to binaries and for interactive usage. The
37
37
C/C++ backend translates Python code to a readable C/C++ code. The x86 backend
38
38
allows very fast compilation directly to x86 machine code. The WebAssembly
@@ -43,20 +43,20 @@ features that are being implemented.
43
43
44
44
These features are under development:
45
45
46
-
***Interactive, Jupyter support**
46
+
***Interactive, Jupyter support**
47
47
LPython is coming soon to Jupyter. It can be used as a Jupyter kernel,
48
48
allowing Python/Julia-style rapid prototyping and an exploratory
49
49
workflow (`conda install jupyter lpython`).
50
50
It can also be used from the command-line with an interactive prompt
51
51
(REPL).
52
52
53
-
***Support for diverse hardware**
53
+
***Support for diverse hardware**
54
54
LLVM makes it possible to run LPython on diverse hardware.
55
55
We plan to support a wide range of hardware platforms, including:
56
56
57
-
CPUs: compile Python code to run on CPUs of all architectures, including x86, ARM, and POWER.
58
-
GPUs: compile Python code to run on GPUs from NVIDIA, AMD, and Intel.
59
-
TPUs: compile Python code to run on TPUs from Google.
57
+
-CPUs: compile Python code to run on CPUs of all architectures, including x86, ARM, and POWER.
58
+
-GPUs: compile Python code to run on GPUs from NVIDIA, AMD, and Intel.
59
+
-TPUs: compile Python code to run on TPUs from Google.
60
60
61
61
Please vote on issues in our [issue tracker] that you want us to prioritize
62
62
(feel free to create new ones if we are missing anything).
Copy file name to clipboardExpand all lines: content/blog/lpython_mvp.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ LPython implements several machine-independent optimisations via ASR-to-ASR pass
58
58
5. Transforming division to multiplication operation
59
59
6. Fused multiplication and addition
60
60
61
-
All optimizations are applied via one command-line argument, --fast. To select individual optimizations instead, write a command-line argument like the following:
61
+
All optimizations are applied via one command-line argument, `--fast`. To select individual optimizations instead, write a command-line argument like the following:
62
62
63
63
`--pass=inline_function_calls,loop_unroll`
64
64
@@ -95,7 +95,7 @@ print(res)
95
95
./a.out 0.01s user 0.00s system 89% cpu 0.012 total
96
96
```
97
97
98
-
You can see that it's very fast. It's still plenty fast with the C backend via the command-line argument --backend=c:
98
+
You can see that it's very fast. It's still plenty fast with the C backend via the command-line argument `--backend=c`:
99
99
100
100
```zsh
101
101
% time lpython /Users/czgdp1807/lpython_project/debug.py --backend=c
@@ -107,13 +107,13 @@ Note that time lpython `/Users/czgdp1807/lpython_project/debug.py --backend=c` i
107
107
108
108
### Just-In-Time Compilation
109
109
110
-
Just-in-time compilation in LPython requires only decorating Python function with @lpython. The decorator takes an option for specifying the desired backend, as in, @lpython(backend="c") or @lpython(backend="llvm"). Only C is supported at present; LLVM and others will be added in the near future. The decorator also propagates backend-specific options. For example
110
+
Just-in-time compilation in LPython requires only decorating Python function with `@lpython`. The decorator takes an option for specifying the desired backend, as in, `@lpython(backend="c")` or `@lpython(backend="llvm")`. Only C is supported at present; LLVM and others will be added in the near future. The decorator also propagates backend-specific options. For example
111
111
112
112
```python
113
113
@lpython(backend="c",
114
-
backend_optimization_flags=["-ffast-math",
115
-
"-funroll-loops",
116
-
"-O1"])
114
+
backend_optimization_flags=["-ffast-math",
115
+
"-funroll-loops",
116
+
"-O1"])
117
117
```
118
118
119
119
Note that by default C backend is used without any optimisation flags.
@@ -187,7 +187,7 @@ def get_email(text):
187
187
lpython@lcompilers.org
188
188
```
189
189
190
-
Note: The `@pythoncall` and `@lpython` decorators are presently supported with just the `C` backend but eventually will work with the LLVM backend and that's work in progress.
190
+
*Note*: The `@pythoncall` and `@lpython` decorators are presently supported with just the `C` backend but eventually will work with the LLVM backend and that's work in progress.
191
191
192
192
193
193
## Benchmarks and Demos
@@ -200,8 +200,13 @@ We compare JIT compilation of LPython to Numba on **summation of all the element
200
200
201
201
**System Information**
202
202
203
-
Softwares - The numba version used is `numba-0.57.1`, LPython commit is `a39430386a0e7ea5de2f569e27229017dff78330` and Python version is `Python 3.10.4`.
203
+
| Compiler | Version |
204
+
|---|---|
205
+
| Numba | 0.57.1 |
206
+
| LPython | 0.19.0 |
207
+
| Python | 3.10.4 |
204
208
209
+
<br/>
205
210
<!-- Add your systems like System - Linux, System - Windows, etc and then add the results for your System in the tables that follow -->
@@ -557,7 +574,15 @@ Next, we see how LPython compares to other AoT compilers and to the standard CPy
557
574
558
575
**System Information**
559
576
560
-
The Clang++ version used is `14.0.3`, `g++` version is `11.3.0`, LPython commit is `a39430386a0e7ea5de2f569e27229017dff78330` and Python version is `Python 3.10.4`.
577
+
578
+
| Compiler | Version |
579
+
|---|---|
580
+
| clang++ | 14.0.3 |
581
+
| g++ | 11.3.0 |
582
+
| LPython | 0.19.0 |
583
+
| Python | 3.10.4 |
584
+
585
+
<br/>
561
586
562
587
**Quadratic-time implementation of the Dijkstra shortest-path algorithm on a fully connected graph**
0 commit comments