Skip to content

Commit c02434b

Browse files
committed
Add LFortran source files
1 parent 51e6ee3 commit c02434b

37 files changed

+1901
-67
lines changed

.gitlab-ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
image: registry.gitlab.com/certik/ci-images:conda_base
2+
3+
variables:
4+
GIT_SUBMODULE_STRATEGY: recursive
5+
6+
stages:
7+
- build
8+
- test
9+
- deploy
10+
11+
build pages:
12+
stage: build
13+
image: klakegg/hugo:0.96.0-ext-ci
14+
script:
15+
- hugo version
16+
- hugo --ignoreCache
17+
artifacts:
18+
paths:
19+
- public
20+
21+
deploy to testing:
22+
stage: test
23+
image: registry.gitlab.com/lfortran/ci-images:mirror-1.4.0
24+
script:
25+
- ci/upload_testing.sh
26+
environment:
27+
name: review/$CI_COMMIT_REF_NAME
28+
url: https://gitlab.com/lfortran/web/www.lfortran.org-testing/tree/$CI_COMMIT_REF_NAME
29+
30+
deploy to www.fortran.org:
31+
stage: deploy
32+
image: registry.gitlab.com/lfortran/ci-images:mirror-1.4.0
33+
script:
34+
- ci/upload_production.sh
35+
only:
36+
- master
37+
#when: manual

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "themes/beautifulhugo"]
2+
path = themes/beautifulhugo
3+
url = https://github.com/halogenica/beautifulhugo

LICENSE

-21
This file was deleted.

README.md

-4
This file was deleted.

ci/upload_production.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
if [[ $CI_COMMIT_REF_NAME != "master" ]]; then
7+
echo "This only runs on master"
8+
exit 1
9+
else
10+
# Release version
11+
test_repo="[email protected]:lfortran/web/www.lfortran.org-testing.git"
12+
deploy_repo="[email protected]:lfortran/wfo-deploy.git"
13+
fi
14+
15+
mkdir ~/.ssh
16+
chmod 700 ~/.ssh
17+
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
18+
ssh-keyscan github.com >> ~/.ssh/known_hosts
19+
20+
eval "$(ssh-agent -s)"
21+
22+
set +x
23+
if [[ "${SSH_PRIVATE_KEY}" == "" ]]; then
24+
echo "Note: SSH_PRIVATE_KEY is empty, skipping..."
25+
exit 0
26+
fi
27+
# Generate the private/public key pair using:
28+
#
29+
# ssh-keygen -f deploy_key -N ""
30+
#
31+
# then set the $SSH_PRIVATE_KEY environment variable in the GitLab-CI to
32+
# the base64 encoded private key:
33+
#
34+
# cat deploy_key | base64 -w0
35+
#
36+
# and add the public key `deploy_key.pub` into the target git repository (with
37+
# write permissions).
38+
39+
ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d)
40+
set -x
41+
42+
43+
mkdir $HOME/repos
44+
cd $HOME/repos
45+
46+
git clone ${test_repo} test_repo
47+
cd test_repo
48+
git push ${deploy_repo} master:master

ci/upload_testing.sh

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
deploy_repo_pull="https://github.com/lfortran/wfo-deploy"
7+
8+
if [[ $CI_COMMIT_REF_NAME != "master" ]]; then
9+
# Development version
10+
dest_branch=${CI_COMMIT_REF_NAME}
11+
deploy_repo="[email protected]:lfortran/web/www.lfortran.org-testing.git"
12+
else
13+
# Release version
14+
dest_branch="master"
15+
deploy_repo="[email protected]:lfortran/web/www.lfortran.org-testing.git"
16+
fi
17+
18+
mkdir ~/.ssh
19+
chmod 700 ~/.ssh
20+
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
21+
ssh-keyscan github.com >> ~/.ssh/known_hosts
22+
23+
D=`pwd`
24+
25+
mkdir $HOME/repos
26+
cd $HOME/repos
27+
28+
git clone ${deploy_repo_pull} docs-deploy
29+
cd docs-deploy
30+
rm -rf docs
31+
mkdir docs
32+
echo "lfortran.org" > docs/CNAME
33+
cp -r $D/public/* docs/
34+
echo "${CI_COMMIT_SHA}" > source_commit
35+
36+
git config user.name "Deploy"
37+
git config user.email "noreply@deploy"
38+
COMMIT_MESSAGE="Deploying on $(date "+%Y-%m-%d %H:%M:%S")"
39+
40+
git add .
41+
git commit -m "${COMMIT_MESSAGE}" --allow-empty
42+
43+
git show HEAD --stat
44+
dest_commit=$(git show HEAD -s --format=%H)
45+
46+
47+
eval "$(ssh-agent -s)"
48+
49+
set +x
50+
if [[ "${SSH_PRIVATE_KEY}" == "" ]]; then
51+
echo "Note: SSH_PRIVATE_KEY is empty, skipping..."
52+
exit 0
53+
fi
54+
# Generate the private/public key pair using:
55+
#
56+
# ssh-keygen -f deploy_key -N ""
57+
#
58+
# then set the $SSH_PRIVATE_KEY environment variable in the GitLab-CI to
59+
# the base64 encoded private key:
60+
#
61+
# cat deploy_key | base64 -w0
62+
#
63+
# and add the public key `deploy_key.pub` into the target git repository (with
64+
# write permissions).
65+
66+
ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d)
67+
set -x
68+
69+
git push ${deploy_repo} +master:${dest_branch}
70+
71+
echo "See the new testing branch online at:"
72+
echo "https://gitlab.com/lfortran/web/www.lfortran.org-testing/tree/${dest_branch}"
73+
74+
echo "Examine the new commit at:"
75+
echo "https://gitlab.com/lfortran/web/www.lfortran.org-testing/commit/${dest_commit}"

config.toml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
baseURL = "https://lfortran.org/"
2+
languageCode = "en-us"
3+
title = "LFortran"
4+
theme = "beautifulhugo"
5+
googleAnalytics = "UA-138613977-1"
6+
7+
[permalinks]
8+
blog = "blog/:year/:month/:title/"
9+
10+
[taxonomies]
11+
tag = "tags"
12+
13+
[Params]
14+
subtitle = "Modern interactive LLVM-based Fortran compiler"
15+
readingTime = true
16+
wordCount = true
17+
18+
[[menu.main]]
19+
name = "Download"
20+
url = "download/"
21+
weight = 1
22+
23+
[[menu.main]]
24+
name = "Documentation"
25+
url = "https://docs.lfortran.org/"
26+
weight = 2
27+
28+
[[menu.main]]
29+
name = "Blog"
30+
url = "blog/"
31+
weight = 3

content/_index.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Feature Highlights
2+
3+
LFortran is in development, there are features that work today, and there are
4+
features that are being implemented.
5+
6+
## Works today
7+
8+
* **Full Fortran 2018 parser**
9+
LFortran can parse any Fortran 2018 syntax to AST (Abstract Syntax Tree)
10+
and format it back as Fortran source code (`lfortran fmt`).
11+
12+
* **Interactive, Jupyter support**
13+
LFortran can be used as a Jupyter kernel, allowing Python/Julia-style rapid
14+
prototyping and an exploratory workflow (`conda install jupyter lfortran`).
15+
It can also be used from the command-line with an interactive prompt
16+
(REPL).
17+
18+
* **Clean, modular design, usable as a library**
19+
LFortran is structured around two independent modules, AST (Abstract Syntax
20+
Tree) and ASR (Abstract Semantic Representation), both of which are
21+
standalone (completely independent of the rest of LFortran) and users are
22+
encouraged to use them independently for other applications and build tools
23+
on top. See the [Design](https://docs.lfortran.org/design/) and
24+
[Developer Tutorial](https://docs.lfortran.org/developer_tutorial/) documents for
25+
more details.
26+
27+
* **Create executables**
28+
It can create executables just like other Fortran compilers.
29+
30+
* **Runs on Linux, Mac, Windows and WebAssembly**
31+
All four platforms are regularly tested by our CI.
32+
33+
* **Several backends**
34+
The LLVM can be used to compile to binaries and for interactive usage. The
35+
C++ backend translates Fortran code to a readable C++ code. The x86 backend
36+
allows very fast compilation directly to x86 machine code. The WebAssembly
37+
backend can quickly generate WASM.
38+
39+
40+
## Under Development
41+
42+
These features are under development:
43+
44+
* **Full Fortran 2018 support**
45+
The parser can now parse all of Fortran 2018 syntax to AST. A smaller
46+
subset can be transformed into ASR and even smaller subset compiled via
47+
LLVM to machine code. We are now working on extending the subset that
48+
LFortran can fully compile until we reach full Fortran 2018 support.
49+
50+
* **Support for diverse hardware**
51+
LLVM makes it possible to run LFortran on diverse hardware and take
52+
advantage of native Fortran language constructs (such as `do concurrent`)
53+
on multi-core CPUs and GPUs.
54+
55+
Please vote on issues in our [issue tracker] that you want us to prioritize
56+
(feel free to create new ones if we are missing anything).
57+
58+
59+
[static]: https://nbviewer.jupyter.org/gist/certik/f1d28a486510810d824869ab0c491b1c
60+
[interactive]: https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb
61+
62+
[issue tracker]: https://github.com/lfortran/lfortran/issues

content/benefits/benefit-1.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Fortran is fast"
3+
icon: "fa fa-fighter-jet"
4+
---
5+
Fortran is built from the ground up to translate mathematics into simple,
6+
readable, and fast code.

content/benefits/benefit-2.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: "Basic mathematics in the core language"
3+
icon: "fa fa-square-root-alt"
4+
---
5+
Rich array operations, complex numbers, exponentiation, special functions, ...

content/benefits/benefit-3.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "Simple but powerful"
3+
icon: "fa fa-bolt"
4+
---
5+
More restricting (and higher level) than languages like C or C++, so that the
6+
resulting code is easier to maintain and write and easier for the compilers to
7+
optimize. There is one canonical way to do things.

content/benefits/benefit-4.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Interactive"
3+
icon: "fa fa-cogs"
4+
---
5+
LFortran allows to use Fortran interactively just like Python, Julia or MATLAB.
6+
It works in a Jupyter notebook.

content/benefits/benefit-5.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Established language"
3+
icon: "fa fa-check"
4+
---
5+
[Fortran](https://fortran-lang.org) is an established language, building on 64
6+
years of expertise. Widely used for High Performance Computing (HPC).

content/benefits/benefit-6.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Open source"
3+
icon: "fas fa-code-branch"
4+
---
5+
Fortran has many excellent open source compilers: GFortran for production; new
6+
compilers in development such as Flang and LFortran.

content/benefits/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
headless: true
3+
---

content/blog/_index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: LFortran Blog
3+
type: page
4+
layout: bloglayout
5+
---

0 commit comments

Comments
 (0)