# File Setup & Hello World

## Starting a File

Gauntlet mirrors Go's package-based compilation model. As such, every file must start with `package <name>`.

## Importing and Using Modules

Gauntlet's import syntax is:<br>

```fsharp
import "<modulename>" as <aliasname>
```

It is **required** that you give an alias to every module you impor&#x74;**.**

Once you have imported it, you can use it like you normally would in Golang.

If you imported `fmt` as such:

```go
import "fmt" as fmt
```

Then you must access it using whatever is on the right side of the "as" keyword (`fmt`):

```go
fmt.println("Hello World!")
```

## The "main" Function

{% hint style="info" %}
Functions are explained in more detail later
{% endhint %}

The `main` function is the entry point of every Gauntlet program; it is not required in every file. It must have a return type of `Unit`.

## Working Hello World Example

{% tabs %}
{% tab title="Gauntlet" %}

```fsharp
package main

import "fmt" as fmt

fun main(): Unit {
  fmt.println("Hello World!")
}
```

{% endtab %}

{% tab title="Transpiled" %}

```go
package main

import fmt "fmt"

func main() {
	fmt.Println("Hello World!")
}
```

{% endtab %}

{% tab title="Output" %}

```
Hello World!
```

{% endtab %}
{% endtabs %}


---

# 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://gauntletlang.gitbook.io/docs/basics/file-setup-and-hello-world.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.
