> For the complete documentation index, see [llms.txt](https://dibs.gitbook.io/vortex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dibs.gitbook.io/vortex-docs/getting-started.md).

# Getting Started

In here you'll find all the documentation you need to get up and running with Vortex.

## How to start using Vortex

1. Head over to the [Vortex source code](https://github.com/dibsonthis/Vortex) and clone the repo.
2. Go to the root of the directory.\
   \
   **\[Mac/Linux]** Run the build script: `build.sh` *(requires clang)*\
   **\[Windows]** Run the build script: `winbuild.sh` *(requires clang)*\
   \
   If you're on Mac/Linux, the installer will ask if you want to store the interpreter in `usr/local/bin` (and set up modules in `usr/local/share`). This allows you to call Vortex from anywhere. If you choose yes, you'll need to input your password to continue.\
   \
   If you're on Windows, the same process will happen in `C:\Program Files`.\
   \
   **Note:** If you choose to add the files to your system, you can later remove them by running the `uninstall.sh` script found in `usr/local/share/vortex` or `C:\Program Files\vortex`

   \
   Depending on your system, the interpreter would have compiled in one of the system folders in `bin/build` (either mac, windows or linux). The executable we just compiled (`vortex`) is the interpreter that we'll be using to run our Vortex code.\
   \
   **Note:** If you chose not to add Vortex to your bin folder, you can manually add it to your PATH so you can call it globally. Otherwise, you'll need to either store it somewhere accessible or within your project.\
   \
   It's also important to note that choosing no will also not compile and install the modules globally, meaning that you cannot reference them.\
   \
   To compile the modules separately, you'll need to run one of these scripts inside the Modules directory: `build_modules.sh` (Mac), `build_modules_win.sh` (Windows) or `build_modules_lin.sh` (Linux).\
   \
   If you do not want to install the interpreter and modules globally, you can copy the interpreter and modules folder into a new directory, making sure that any calls to vortex reference the modules you just copied in.\
   \
   This can be done by passing in the filepath of the modules as a second argument to the interpereter: `vortex <source filepath> -m <modules path>`

## Your first Vortex program

Let's write a very quick Vortex program that defines some functions and calls them in a loop.

Start by creating a vortex source file (a file ending in the extension `.vtx`) and paste the below code in:

{% code title="hello.vtx" %}

```go
const addVars = (a, b) => a + b
const mulTwo = (a) => a * 2

for (0..5, index) {
    const add = addVars(index, index + 1)
    const res = mulTwo(add)
    println(res)
}

println("Obligatory 'Hello World'")
```

{% endcode %}

Run the above Vortex program by calling: `vortex "<path/to/dir>/hello.vtx"`

This is the expected output:

{% code title="Output" %}

```
2
6
10
14
18
Obligatory 'Hello World'
```

{% endcode %}

**Congratulations!** You just ran your first Vortex code 🎉

Read the next sections to get a better understanding of everything that Vortex has to offer.

## Language Reference

If you haven't seen the language reference yet, now would be a great time to explore the ins and outs of Vortex:

{% content-ref url="/pages/4WjPzuJQBX3pyVTFDQOB" %}
[Language Reference](/vortex-docs/language-reference.md)
{% endcontent-ref %}
