diff --git a/src/App.vue b/src/App.vue
index c0245e6..a160c53 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,10 +4,9 @@
diff --git a/src/components/C/C_Hello_World.vue b/src/components/C/C_Hello_World.vue
new file mode 100644
index 0000000..cf8f170
--- /dev/null
+++ b/src/components/C/C_Hello_World.vue
@@ -0,0 +1,9 @@
+
+
+
+ Hello World In Fortran 90
+
+
\ No newline at end of file
diff --git a/src/components/C/C_Index.vue b/src/components/C/C_Index.vue
new file mode 100644
index 0000000..060ca94
--- /dev/null
+++ b/src/components/C/C_Index.vue
@@ -0,0 +1,28 @@
+
+
+
+ C
+
+ C is one of those ancient languages that's still getting used to this very day. It's a language from
+ the year 1972, making it 53 years young as of 2025. It originated at Bell Labs, and was developed with the purpose of
+ creating utilities for Unix.
+
+ In the 80s, C steadily became more and more accepted as the go-to language. Especially with kernel and driver code.
+ The Linux kernel is one such huge project written in almost purely C, although in recent times, the kernel is introducing
+ Rust code.
+
+
+
Table of contents:
+
+
> Set Up
+
> Hello World
+
+
+
+
\ No newline at end of file
diff --git a/src/components/C/C_Set_Up.vue b/src/components/C/C_Set_Up.vue
new file mode 100644
index 0000000..56d4593
--- /dev/null
+++ b/src/components/C/C_Set_Up.vue
@@ -0,0 +1,168 @@
+
+
+
+ Setting Up The Environment
+
+
+ If you're familiar Fortran, then this guide will be quite easy for you. For C, there isn't really an "official"
+ compiler, but there are compilers that implement the standards of C. For this guide, we'll be using GCC. There are
+ other great compilers, such as clang.
+
+ Just like with the Fortran set up guide, we'll be doing this on Fedora
+ Linux, but other distros, like Ubuntu, would work just as well.
+
+
+
+
+
+ For any big C projects, a project structure is very important. It helps to organize and keep track of our
+ classes and libraries. But for smaller projects, or just for testing purposes, a project structure could be too
+ redundant.
+
+
+
+
+
+
+ Makefiles are very useful, and becomes increasingly useful, the bigger the project gets. A makefile simplifies the
+ compilation process, as all of the compile flags can be gathered inside a single file. It makes it possible to
+ dynamically change the compilation depending on the system architecture or config. It also removes the need to
+ manually compile and link your objects together, every time you make a change.
+
+ And with a bigger project, comes a big count of source files. That's where a makefile helps a lot, as it handles
+ and tracks all changes to each file, ensuring that it's only the changed files that gets re-compiled.
+
+ So let's see a makefile in action. Below code is a simple Hello World application, that we will use a makefile to
+ compile. Although it's worth noting, that a program this small, a makefile is wildly redundant. But it does show
+ how it's set up in a simple environment.
+
+ With this little example, we're doing a Hello World program, but fret not, we'll go into details in a later guide.
+
+
+ hello.c
+
+
+
+ For anyone not programming in a language that uses the make makefile, this might look rather off-putting.
+ But worry not, because at the end of the day, it's simply just some rules, that the compiler follows to compile your program.
+
+
+
+
> hello: hello.o
+
> > Here, the program "hello" depends on the object file "hello.o".
+
+
> $(CC) $(CFLAGS) -o $@ $^
+
> > This one compiles the object files into the program.
+
+
> hello.o: hello.c
+
> > Here, the object file "hello.o" depends on the source file "hello.c".
+
+
> $(CC) $(CFLAGS) -c $<
+
> > This one compiles the source files into the object files.
+
+
> run: ./hello
+
> > This runs the program if you execute make run
+
+
> clean: rm -f *.o hello
+
> > Here, the object files gets removed when running make clean
+
+
+
+ A quick note. It's very important that whenever something is indented in a makefile, that it's indented with a tab,
+ and not 4 spaces. It needs to be a tab character.
+
+ Now simply run the makefile with the following command.
+
+
+
+
+
+ We have now successfully compiled the program with the help of a makefile. Now simply run the program and we'll
+ see the output.
+
+
+
+
+$ ./hello
+Hello, World!
+
+
+
+ If we run make run command instead, the output should look pretty much the same.
+
+
+
+$ make run
+./hello
+Hello, World!
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue b/src/components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue
index 850ce6b..f559a1d 100644
--- a/src/components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue
+++ b/src/components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue
@@ -1,3 +1,9 @@
+
+
Calls, Methods, Functions and Subroutines
@@ -160,12 +166,4 @@ $ ./main
TLDR: Functions are assigned as variables, and subroutines are imported and called with the call keyword.
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/components/Fortran/Fortran_Reading_Files.vue b/src/components/Fortran/Fortran_Reading_Files.vue
index 04252ae..64a98ff 100644
--- a/src/components/Fortran/Fortran_Reading_Files.vue
+++ b/src/components/Fortran/Fortran_Reading_Files.vue
@@ -9,10 +9,12 @@ import Paragraph from "../tags/Paragraph.vue";
Reading A File In Fortran 90
- Reading files in high level programming languages is rather easy. I C#, you would just create a
+ Reading files in high level programming languages is rather easy. In C#, you would just create a
StreamReader object, and execute: streamReader.ReadLine() and bam,
you've read the first line of the file. Now just check if the string returned is null, in a while loop, and you've
read the whole file. Easy peasy.
- In Fortran 90, however, there is a little more than that. Not a lot more, to be honest, but there is a little more.
+ In Fortran 90, however, there is a little more than that. Not a lot more, to be honest, but there is a little more.
+ Especially if you're using Fortran 90, compared to newer versions. In Fortran 90, you have to read the file, line
+ by line.
\ No newline at end of file
diff --git a/src/components/Fortran/Fortran_Set_Up.vue b/src/components/Fortran/Fortran_Set_Up.vue
index 3557478..f811d79 100644
--- a/src/components/Fortran/Fortran_Set_Up.vue
+++ b/src/components/Fortran/Fortran_Set_Up.vue
@@ -14,7 +14,8 @@ import Paragraph from "../tags/Paragraph.vue";
The top listed compiler on Fortran's website, is the GNU Fortran compiler (gfortran). It's the one I will be using
throughout the examples on the site. Unless stated otherwise. There are also some other notable compilers, that
- has some rather interesting qualities to them.
+ has some rather interesting qualities to them.
+
Compilers:
@@ -25,12 +26,13 @@ import Paragraph from "../tags/Paragraph.vue";
But we will be using gfortran. Through the examples on this site, I will mainly be focusing on developing on Linux.
- First, we install the compiler.
+ First, we install the compiler.
+
-
For Fedora.
+
For Fedora:
$ sudo dnf install gcc-gfortran
-
For ubuntu.
+
For ubuntu:
$ sudo apt install gfortranAnd that's it. Pretty easy.
@@ -50,7 +52,8 @@ import Paragraph from "../tags/Paragraph.vue";
But if we're doing micro-projects, as in like, a hello world application, a test application, or a small tool,
this layout is rather redundant, and in the examples on this site, we will only use it on bigger projects,
- and we will let you know, when or how we set up the project.
+ and we will let you know, when or how we set up the project.
+
@@ -58,10 +61,10 @@ project/
├── src/ # Source files (.f90, .f95, etc.)
│ ├── modules/ # Module definitions
│ └── main.f90 # Main program file
-├── include/ # Include files (e.g., interface definitions)
+├── include/ # Include files (interface definitions)
├── lib/ # Library object files and archives
├── bin/ # Executable binaries
-├── tests/ # Test cases
+├── tests/ # Test files
└── Makefile # Build script
@@ -87,7 +90,8 @@ project/
So let's see a makefile in action. Below code is a simple Hello World application, that we will use a makefile to
compile. Although it's worth noting, that a program this small, a makefile is wildly redundant. But it does show
- how it's set up in a simple environment.
+ how it's set up in a simple environment.
+
hello.f90
@@ -119,8 +123,10 @@ clean:
- The makefile, in the eyes of a modern programmer (C#, Python, JS, Etc) might look rather repulsive. But be not
- afraid, because at the end of the day, it's simply just some rules, that the compiler follows to compile your program.
+
+ The makefile, in the eyes of a modern programmer (C#, Python, JS, Etc) might look rather repulsive. But be not
+ afraid, because at the end of the day, it's simply just some rules, that the compiler follows to compile your program.
+
> hello: hello.o
@@ -142,10 +148,12 @@ clean:
> > Here, the object files gets removed when running make clean
- A quick note. It's very important that whenever something is indented in a makefile, that it's indented with a tab,
- and not 4 spaces. It needs to be a tab character.
+
+ A quick note. It's very important that whenever something is indented in a makefile, that it's indented with a tab,
+ and not 4 spaces. It needs to be a tab character.
- Now simply run the makefile with the following command.
+ Now simply run the makefile with the following command.
+
- We have now successfully compiled the program with the help of a makefile. Now simply run the program and we'll
- see the output.
+
+ We have now successfully compiled the program with the help of a makefile. Now simply run the program and we'll
+ see the output.
+
diff --git a/src/components/Lisp/Lisp_Index.vue b/src/components/Lisp/Lisp_Index.vue
deleted file mode 100644
index 96c0baf..0000000
--- a/src/components/Lisp/Lisp_Index.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/Pascal/Pascal_Index.vue b/src/components/Pascal/Pascal_Index.vue
deleted file mode 100644
index 96c0baf..0000000
--- a/src/components/Pascal/Pascal_Index.vue
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main.ts b/src/main.ts
index f7f5e65..859b0df 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -6,14 +6,13 @@ import App from './App.vue'
import Home from "./components/Home.vue";
import About from "./components/About.vue";
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";
import FortranSetUp from "./components/Fortran/Fortran_Set_Up.vue";
import FortranDataTypes from "./components/Fortran/Fortran_Data_Types.vue";
-import FortranCallsMethodsFunctionsSubroutines
- from "./components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue";
+import FortranCallsMethodsFunctionsSubroutines from "./components/Fortran/Fortran_Calls_Methods_Functions_Subroutines.vue";
+import CIndex from "./components/C/C_Index.vue";
+import CSetUp from "./components/C/C_Set_Up.vue";
const router = createRouter({
history: createWebHistory(),
@@ -22,16 +21,14 @@ const router = createRouter({
{path: '/About', name: 'About', component: About},
{path: '/Fortran', name: 'Fortran', component: FortranIndex},
- {path: '/Fortran/SetUp', name: 'SetUp', component: FortranSetUp},
- {path: '/Fortran/HelloWorld', name: 'HelloWorld', component: FortranHelloWorld},
- {path: '/Fortran/DataTypes', name: 'DataTypes', component: FortranDataTypes},
- {path: '/Fortran/Methods', name: 'Methods', component: FortranCallsMethodsFunctionsSubroutines},
- {path: '/Fortran/ReadingAFile', name: 'ReadingAFile', component: FortranReadingFiles},
+ {path: '/Fortran/SetUp', name: 'F_SetUp', component: FortranSetUp},
+ {path: '/Fortran/HelloWorld', name: 'F_HelloWorld', component: FortranHelloWorld},
+ {path: '/Fortran/DataTypes', name: 'F_DataTypes', component: FortranDataTypes},
+ {path: '/Fortran/Methods', name: 'F_Methods', component: FortranCallsMethodsFunctionsSubroutines},
+ {path: '/Fortran/ReadingAFile', name: 'F_ReadingAFile', component: FortranReadingFiles},
- {path: '/Pascal', name: 'Pascal', component: PascalIndex},
-
-
- {path: '/Lisp', name: 'Lisp', component: LispIndex}
+ {path: '/C', name: 'C', component: CIndex},
+ {path: '/C/SetUp', name: 'C_SetUp', component: CSetUp},
]
})