> For the complete documentation index, see [llms.txt](https://forthc.swisschili.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://forthc.swisschili.sh/master.md).

# Installation

## Compiling

CMake, Make, a C++17 compatible compiler (GCC >= 7), and an assembler that uses AT\&T syntax are required.

Run the following commands to build the compiler:

```
$ mkdir build && cd build
$ cmake ..
$ make
```

Then use the compiler to bootstrap the standard library:

```ruby
$ cd .. # in the root directory now
$ make  # forthc needs to be located in build/forthc
```

You should now be ready to compile your first program! Write the following in a forth file

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

```ruby
: main
    "Ciao, Mondo!\n" puts 
;
```

{% endcode %}

And build it with the following commands:

```bash
$ forthc hello.forth | as -o hello.o -
$ ld hello.o /usr/lib/forth/libfstd.a -o hello
$ ./hello
Ciao, Mondo!
```


---

# 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://forthc.swisschili.sh/master.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.
