Add hello world Fortran page

This commit is contained in:
Rasmus Rasmussen 2025-01-31 16:50:55 +01:00
parent 8a31de3981
commit 016af83350
5 changed files with 57 additions and 5 deletions

View File

@ -43,7 +43,9 @@
<p>Not bad huh? The things you see when everyone is asleep.</p>
<br>
<img src="/public/Images/avif/PXL_20230720_032828882_scaled.avif" alt="My humble bike." loading="lazy" decoding="async" width="1434" height="1080">
<p>And this is my humble bike. It has taken me many places, and it's still going strong.</p>
<p>And this is my humble bike. It has taken me many places, and it's still going strong. The odometer no longer works,
so I just use my FitBit Charge 5 instead. I've modeled and 3D printed the two orange bottle holders myself, on my
Original Prusa MK3S+.</p>
</div>
</template>

View File

@ -0,0 +1,33 @@
<script setup lang="ts">
</script>
<template>
<div>
<h1 class="text-3xl">Hello World In Fortran 90</h1>
<hr>
<p></p>
<div class="px-3 py-2">
<pre class="language-fortran"><code class="text-sm">
program hello
implicit none
write(*,*) 'Hello world!'
end program hello
</code></pre>
</div>
<p>With modern compilers, running the newest Fortran standards, <span><code>write(*,*)</code> and <code>print</code></span>
will compile to the exact same assembly. So if you only need to print something to stdout, just use <span><code>print</code></span>
as it conveys the meaning of the code better. Plus we don't need the full functionality of <span><code>write(*,*)</code></span>
in this example.</p>
<div>
<pre class="language-fortran"><code class="text-sm">
$ gfortran -o hello main.f90
$ ./hello
&gt; Hello world!
</code></pre>
</div>
</div>
</template>

View File

@ -6,12 +6,23 @@
<div>
<h1 class="text-3xl">Fortran</h1>
<hr>
<p>Fortran is an interesting language. It's one of the older languages still in use to this very day.</p>
<p>Fortran, which stands for Formula Translation, is indeed an interesting language with a rich history. As one of
the oldest programming languages still in active use today, it has played a significant role in shaping the
development of modern computing. First introduced in the 1950s by a team at IBM led by John Backus, Fortran was
designed specifically for scientific and engineering applications, where its ability to efficiently handle
complex numerical computations proved invaluable.</p>
<br>
<p>
Over the years, Fortran has undergone numerous updates and revisions, with the most recent standard being Fortran
2018. Despite the rise of newer languages like C++, Java, and Python, Fortran remains a popular choice in many
fields, including physics, chemistry, meteorology, and engineering, due to its performance. Even Nvidia and Intel
are still developing their compilers, as well as FOSS compilers such as gfortran and lfortran.</p>
<br>
<p>Table of contents:</p>
<ul>
<li><RouterLink to="/Fortran/ReadingAFile">Reading A File</RouterLink></li>
<li><RouterLink to="/Fortran/HelloWorld">&gt; Hello World</RouterLink></li>
<li><RouterLink to="/Fortran/ReadingAFile">&gt; Reading A File</RouterLink></li>
</ul>
</div>
</template>

View File

@ -7,5 +7,9 @@
<h1 class="text-3xl">Reading A File In Fortran 90</h1>
<hr>
<p></p>
<code class="">
</code>
</div>
</template>

View File

@ -8,6 +8,7 @@ import FortranIndex from "./components/Fortran/Fortran_Index.vue";
import PascalIndex from "./components/Pascal/Pascal_Index.vue";
import LispIndex from "./components/Lisp/Lisp_Index.vue";
import FortranReadingFiles from "./components/Fortran/Fortran_Reading_Files.vue";
import FortranHelloWorld from "./components/Fortran/Fortran_Hello_World.vue";
const router = createRouter({
history: createWebHistory(),
@ -16,6 +17,7 @@ const router = createRouter({
{path: '/About', name: 'About', component: About},
{path: '/Fortran', name: 'Fortran', component: FortranIndex},
{path: '/Fortran/HelloWorld', name: 'HelloWorld', component: FortranHelloWorld},
{path: '/Fortran/ReadingAFile', name: 'ReadingAFile', component: FortranReadingFiles},
{path: '/Pascal', name: 'Pascal', component: PascalIndex},