> For the complete documentation index, see [llms.txt](https://harish-kumar.gitbook.io/mathx-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harish-kumar.gitbook.io/mathx-manual/introduction.md).

# Introduction

## What is Programming ?

Computers don't understand human language, rather they understand only **binary number** (0's & 1's). Instructing computer with binary code is such a tedious work and hinders the growth of new technologies in the Computer World. So, new technologies were founded to convert human-readable code into binary and so programming languages invented. Programming Languages like Fortran, COBOL, Pascal, C, PROLOG, C/C++, Python, Java, Ruby were very powerful and useful since their origin. Programmers write their commands using such languages and execute their required task which to be done by computer. Thus, a new field arose. This is very interesting as it engages your brain to teach computers to solve problems.

## Why MathX ?

Many newbies who enter the field of Computer programming often face problems (or lose their interest) due to the deep learning curve and their misunderstanding of the newly introduced Syntax of other programming languages. MathX being a Statement-based language, has a very simple syntax which resembles actual English thus reducing the learning curve. It is actually a transpiler which transpiles MathX code to high-level languages such as C, Go, Java, etc... so you may achieve the compatibility of those languages too as you go deep into it.

**Note**: v1.0 of MathX compiles only to C. Further Languages discussed above will be added in future.

## Installing MathX

The Current version of MathX is v1.5. MathX requires Python version >= 3.6 and any C compiler to compile native code. So first install Python 3 from its [official website](https://www.python.org/) and also your favourite C compiler (I prefer [`gcc`](https://gcc.gnu.org/)`/`[`tcc`](https://bellard.org/tcc/) for best performance). After installing Python and your C compiler, do the following:

1. Go to the official MathX [releases page](https://github.com/harishtpj/MathX/releases). Select your desired version release.
2. For Linux/Mac users, download mathx-linux.tar.gz file.
3. For Windows users, download mathx-windows.zip file.
4. Unzip the file and save it to your desired location.
5. Add the folder location (location where mathxc was located) to your PATH Environment variable

Now you're ready to run your first MathX program.<br>

## Running MathX

To verify your installation, run `./mathxc -h` on Linux/Mac or `mathxc -h` on Windows. You'll be shown up with the following screen:

<figure><img src="/files/t2wTNlfeKZYJHb1bZoQQ" alt=""><figcaption><p>MathX Compiler Help Screen</p></figcaption></figure>

`mathxc` is the MathX Compiler, which we'll use to compile and run MathX programs. This compiler compiles to native code by transpiling to C which gives maximum speed.

Now, create a file named `hello.mx` and write the following into it:

```
!: Hello World Program in MathX Language.

main-para:-
println "Hello, World!".
```

After saving the file, run the following command: `./mathxc hello.mx` on Linux/Mac or `mathxc hello.mx` on Windows.

Now run `./hello` on Linux/Mac or `hello.exe` on Windows. You'll see the following screen:

<figure><img src="/files/GV13icjQjaYIraFyNRHK" alt=""><figcaption><p>Running your first MathX program</p></figcaption></figure>

🥳 Yay! You just ran your first MathX program.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://harish-kumar.gitbook.io/mathx-manual/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
