# Getting Started

## 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.\
   \
   \&#xNAN;**\[Mac/Linux]** Run the build script: `build.sh` *(requires clang)*\
   \&#xNAN;**\[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 %}


---

# Agent Instructions: 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:

```
GET https://dibs.gitbook.io/vortex-docs/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
