diff --git a/docs/blog/2019/04/why-we-created-lfortran/index.html b/docs/blog/2019/04/why-we-created-lfortran/index.html index dd409a2..4427d83 100644 --- a/docs/blog/2019/04/why-we-created-lfortran/index.html +++ b/docs/blog/2019/04/why-we-created-lfortran/index.html @@ -471,7 +471,7 @@

How to bootstrap it

  • Jacob Williams
  • Hackaday
  • - + diff --git a/docs/blog/2019/05/why-to-use-fortran-for-new-projects/index.html b/docs/blog/2019/05/why-to-use-fortran-for-new-projects/index.html index c52facd..bcbe3c7 100644 --- a/docs/blog/2019/05/why-to-use-fortran-for-new-projects/index.html +++ b/docs/blog/2019/05/why-to-use-fortran-for-new-projects/index.html @@ -378,7 +378,7 @@

    Why Fortran?

    - + diff --git a/docs/blog/2024/04/lfortran-compiles-fortran-stdlib/index.html b/docs/blog/2024/04/lfortran-compiles-fortran-stdlib/index.html index d0c6591..2fdbc06 100644 --- a/docs/blog/2024/04/lfortran-compiles-fortran-stdlib/index.html +++ b/docs/blog/2024/04/lfortran-compiles-fortran-stdlib/index.html @@ -425,6 +425,10 @@

    Discussions

    + + diff --git a/docs/blog/2024/05/fortran-on-web-using-lfortran/index.html b/docs/blog/2024/05/fortran-on-web-using-lfortran/index.html new file mode 100644 index 0000000..5487667 --- /dev/null +++ b/docs/blog/2024/05/fortran-on-web-using-lfortran/index.html @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + Fortran On Web Using LFortran - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    +
    + +

    Fortran On Web Using LFortran

    + + + + + + + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    +

    Fortran On Web Using LFortran

    +

    Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser.

    +

    MNIST

    + +

    We cloned the original authors code and just swapped-in two of our generated files mnist.js and mnist.wasm with the original files. We also fixed few minor bugs in the code that we came across (details in the commit history).

    +

    Other Examples

    +

    Apart from the mnist example, we also have two more examples 2D matrix multiplication and simple linear regression. The sources of these are present here https://github.com/lfortran/Fortran-On-Web.

    + +
    + +

    Compiling to wasm using LFortran

    +

    LFortran supports compiling to wasm via different approaches.

    +
      +
    1. Using clang-wasi:
    2. +
    +
    lfortran main.f90 --target=wasm32-wasi -o main.wasm
    +
    +wasmtime main.wasm
    +
      +
    1. Using emscripten:
    2. +
    +
    lfortran main.f90 --target=wasm32-unknown-emscripten -o main.js
    +
    +node main.js
    +
      +
    1. Using custom wasm backend:
    2. +
    +
    lfortran main.f90 --backend=wasm -o main
    +
    +wasmtime main
    +
    +or
    +
    +node main.js
    +

    Out of the above three approaches, using the clang-wasi or emscripten approach is more stable as it uses our most advanced llvm backend.

    +

    To use the clang-wasi approach, one needs the WASI SDK installed and added to PATH. Detailed steps for this are shared here.

    +

    To use the emscripten approach, one needs the emscripten SDK (emsdk) installed and added to PATH. Detailed steps for this are shared here.

    +

    Contributing

    +

    If you liked the above examples, go ahead and try using LFortran to compile your Fortran codes to WebAssembly. Remember that LFortran is alpha quality, so please report all bugs that you discover. It should be however possible to workaround them in most cases.

    +

    We also continuously welcome new contributors to join our endeavor. If you’re interested, please reach out to us. Working on a compiler offers a stimulating learning experience, and we’re committed to providing all the necessary guidance and training. Join us in shaping the future of LFortran!

    +

    Acknowledgements

    +

    We want to thank:

    + +

    Discussions

    +
      +
    • Fortran Discourse:
    • +
    • Twitter:
    • +
    • Mastodon:
    • +
    + + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + + + + + +
    + + + + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/blog/index.html b/docs/blog/index.html index 245c864..5b82a96 100644 --- a/docs/blog/index.html +++ b/docs/blog/index.html @@ -260,6 +260,54 @@

    LFortran Blog

    +
    + +

    Fortran On Web Using LFortran

    + + +
    + + + + +
    + + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + [Read More] + +
    + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + +
    +

    LFortran compiles Fortran stdlib

    diff --git a/docs/blog/index.xml b/docs/blog/index.xml index a6e61e3..eba6c8c 100644 --- a/docs/blog/index.xml +++ b/docs/blog/index.xml @@ -6,7 +6,17 @@ Recent content in LFortran Blog on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + LFortran compiles Fortran stdlib https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ diff --git a/docs/download/index.html b/docs/download/index.html index 8a0d4f2..24e0a73 100644 --- a/docs/download/index.html +++ b/docs/download/index.html @@ -558,8 +558,8 @@

    Development Version

    diff --git a/docs/index.xml b/docs/index.xml index 6a01563..6012e8b 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -6,7 +6,17 @@ Recent content on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + LFortran compiles Fortran stdlib https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 5b75c82..a904417 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -3,29 +3,35 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> https://lfortran.org/ - 2024-04-16T00:00:00+00:00 + 2024-05-02T00:00:00+00:00 0 https://lfortran.org/tags/announcement/ - 2024-04-16T00:00:00+00:00 + 2024-05-02T00:00:00+00:00 https://lfortran.org/tags/fortran/ - 2024-04-16T00:00:00+00:00 + 2024-05-02T00:00:00+00:00 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + 2024-05-02T00:00:00+00:00 https://lfortran.org/tags/fortran-lang/ - 2024-04-16T00:00:00+00:00 + 2024-05-02T00:00:00+00:00 https://lfortran.org/blog/ - 2024-04-16T00:00:00+00:00 + 2024-05-02T00:00:00+00:00 + + https://lfortran.org/tags/ + 2024-05-02T00:00:00+00:00 + + https://lfortran.org/tags/webassembly/ + 2024-05-02T00:00:00+00:00 https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ 2024-04-16T00:00:00+00:00 https://lfortran.org/tags/stdlib/ 2024-04-16T00:00:00+00:00 - - https://lfortran.org/tags/ - 2024-04-16T00:00:00+00:00 https://lfortran.org/blog/2024/01/lfortran-compiles-60-of-scipy/ 2024-01-10T00:00:00+00:00 diff --git a/docs/tags/announcement/index.html b/docs/tags/announcement/index.html index b7ee9dd..ec988a1 100644 --- a/docs/tags/announcement/index.html +++ b/docs/tags/announcement/index.html @@ -259,6 +259,58 @@

    Announcement

    +
    + +

    Fortran On Web Using LFortran

    + + + +
    + + +
    + + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + [Read More] + +
    + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + + +
    +

    LFortran compiles Fortran stdlib

    diff --git a/docs/tags/announcement/index.xml b/docs/tags/announcement/index.xml index cf55a75..f5db369 100644 --- a/docs/tags/announcement/index.xml +++ b/docs/tags/announcement/index.xml @@ -6,7 +6,17 @@ Recent content in Announcement on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + LFortran compiles Fortran stdlib https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ diff --git a/docs/tags/fortran-lang/index.html b/docs/tags/fortran-lang/index.html index 8ae6ca6..5867650 100644 --- a/docs/tags/fortran-lang/index.html +++ b/docs/tags/fortran-lang/index.html @@ -259,6 +259,58 @@

    fortran-lang

    +
    + +

    Fortran On Web Using LFortran

    + + + +
    + + +
    + + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + [Read More] + +
    + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + + +
    +

    LFortran compiles Fortran stdlib

    diff --git a/docs/tags/fortran-lang/index.xml b/docs/tags/fortran-lang/index.xml index b0e24b4..2f971a6 100644 --- a/docs/tags/fortran-lang/index.xml +++ b/docs/tags/fortran-lang/index.xml @@ -6,7 +6,17 @@ Recent content in fortran-lang on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + LFortran compiles Fortran stdlib https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ diff --git a/docs/tags/fortran/index.html b/docs/tags/fortran/index.html index 018cd47..0bccf8e 100644 --- a/docs/tags/fortran/index.html +++ b/docs/tags/fortran/index.html @@ -259,6 +259,58 @@

    Fortran

    +
    + +

    Fortran On Web Using LFortran

    + + + +
    + + +
    + + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + [Read More] + +
    + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + + +
    +

    LFortran compiles Fortran stdlib

    diff --git a/docs/tags/fortran/index.xml b/docs/tags/fortran/index.xml index 6e5629d..bba9488 100644 --- a/docs/tags/fortran/index.xml +++ b/docs/tags/fortran/index.xml @@ -6,7 +6,17 @@ Recent content in Fortran on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + LFortran compiles Fortran stdlib https://lfortran.org/blog/2024/04/lfortran-compiles-fortran-stdlib/ diff --git a/docs/tags/index.html b/docs/tags/index.html index 568c790..12e59de 100644 --- a/docs/tags/index.html +++ b/docs/tags/index.html @@ -267,7 +267,7 @@

    Tags

    fortran - 7 + 8

    @@ -277,6 +277,8 @@

    View all + + - +

    diff --git a/docs/tags/index.xml b/docs/tags/index.xml index 4657365..11091ff 100644 --- a/docs/tags/index.xml +++ b/docs/tags/index.xml @@ -6,11 +6,11 @@ Recent content in Tags on LFortran Hugo -- gohugo.io en-us - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 Announcement https://lfortran.org/tags/announcement/ - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 https://lfortran.org/tags/announcement/ @@ -19,7 +19,7 @@ Fortran https://lfortran.org/tags/fortran/ - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 https://lfortran.org/tags/fortran/ @@ -28,12 +28,21 @@ fortran-lang https://lfortran.org/tags/fortran-lang/ - Tue, 16 Apr 2024 00:00:00 +0000 + Thu, 02 May 2024 00:00:00 +0000 https://lfortran.org/tags/fortran-lang/ + + webassembly + https://lfortran.org/tags/webassembly/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/tags/webassembly/ + + + stdlib https://lfortran.org/tags/stdlib/ diff --git a/docs/tags/webassembly/index.html b/docs/tags/webassembly/index.html new file mode 100644 index 0000000..c3528f6 --- /dev/null +++ b/docs/tags/webassembly/index.html @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + webassembly - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    +
    + +

    webassembly

    + + +
    + + + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + +
    + +

    Fortran On Web Using LFortran

    + + + +
    + + +
    + + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + [Read More] + +
    + + +
    + + Fortran  + + Announcement  + + webassembly  + + fortran-lang  + +
    + + +
    + +
    + +
    +
    +
    + + +
    +
    +
    +
    + + + +

    + + +

    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/docs/tags/webassembly/index.xml b/docs/tags/webassembly/index.xml new file mode 100644 index 0000000..4909866 --- /dev/null +++ b/docs/tags/webassembly/index.xml @@ -0,0 +1,21 @@ + + + + webassembly on LFortran + https://lfortran.org/tags/webassembly/ + Recent content in webassembly on LFortran + Hugo -- gohugo.io + en-us + Thu, 02 May 2024 00:00:00 +0000 + + Fortran On Web Using LFortran + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Thu, 02 May 2024 00:00:00 +0000 + + https://lfortran.org/blog/2024/05/fortran-on-web-using-lfortran/ + Fortran On Web Using LFortran Recently, there was a blog post titled Fortran on WebAssembly released by Dr George W Stagg. This article inspired us to compile the same example using our LFortran compiler. We are happy to share that we have the fortran mnist classifier example used in the blog post, compiled to WebAssembly using LFortran (with no hacks to the compiler) and working perfectly in the browser. +MNIST We cloned the original authors code and just swapped-in two of our generated files mnist. + + + + diff --git a/docs/tags/webassembly/page/1/index.html b/docs/tags/webassembly/page/1/index.html new file mode 100644 index 0000000..b69b454 --- /dev/null +++ b/docs/tags/webassembly/page/1/index.html @@ -0,0 +1,10 @@ + + + + https://lfortran.org/tags/webassembly/ + + + + + + diff --git a/source_commit b/source_commit index 4316a14..473d2ce 100644 --- a/source_commit +++ b/source_commit @@ -1 +1 @@ -cf07707068240a9c56ce325797b195ca4bd56b71 +7e854e2acbd970eea4918f79ef836627afae027b