> For the complete documentation index, see [llms.txt](https://docs.varphi-lang.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.varphi-lang.com/readme.md).

# Welcome

The official website for the Varphi programming language.

Welcome to the Varphi user documentation! Here you'll get an overview of all the amazing features Varphi offers to help you build, simulate, and debug Turing machines and finite automata.

<a href="https://try.varphi-lang.com" class="button primary">Try Varphi in Your Browser!</a>

### What is Varphi?

Varphi is a modern, domain-specific language designed for defining, simulating, and studying Turing machines and finite automata.

While Turing machines are the fundamental model of computation, defining them has historically been tedious, relying on verbose state tables or fragile graphical simulators. Varphi bridges the gap between theoretical computer science and modern software engineering, providing a concise syntax, a robust compiler, and high-quality developer tooling.

### Why Varphi?

Varphi treats Turing Machines as code, not diagrams. It introduces modern language features to the theoretical domain:

* **Concise Syntax:** Define complex state transitions using pattern matching and variables instead of listing every single symbol combination.
* **Native Multi-Tape Support:** Write algorithms for $$k$$-tape machines as easily as single-tape ones. The compiler handles the complexity.
* **First-Class Tooling:** Debug your machines with a dedicated [VS Code Extension](/vs-code-extension.md), complete with syntax highlighting, live error reporting, and a step-by-step debugger (DAP).

### Jump right in

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-arrow-down-to-line">:arrow-down-to-line:</i></h4></td><td><strong>Installation</strong></td><td>Install Varphi on your machine</td><td></td><td></td><td><a href="/installation.md">Installation</a></td></tr><tr><td><h4><i class="fa-code">:code:</i></h4></td><td><strong>The Varphi Language Reference</strong></td><td>Learn about Varphi's syntax</td><td></td><td></td><td><a href="/the-varphi-language-reference.md">The Varphi Language Reference</a></td></tr><tr><td><h4><i class="fa-lightbulb">:lightbulb:</i></h4></td><td><strong>Examples</strong></td><td>See some of what you can do with Varphi</td><td></td><td></td><td><a href="/examples.md">Examples</a></td></tr></tbody></table>


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.varphi-lang.com/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
