# Agentica

Agentica is Ruby with static types. It has Ruby-like syntax. Every program is checked before it runs, and values never change in place. The language is small on purpose, so people and AI agents can write, read and fix programs with few surprises. Every error has a stable code, a source position and often a hint with the fix.

The project is hosted on [GitHub](https://github.com/agentica-lang/agentica).

```agentica
# Prices are in cents, so the math stays exact.
TAX_PERCENT = 21

## Returns the price with the tax added.
def with_tax(cents: Int) -> Int = cents + (cents * TAX_PERCENT) / 100

def main() -> Void
  prices = [250, 1_000, 99]
  # Ranges include both ends: 1..3 is 1, 2, 3.
  for i in 1..prices.size
    puts("item #{i}: #{with_tax(prices[i - 1])} cents")
  end

  total = prices.map(&with_tax).sum
  puts("total: #{total} cents")
end
```

Run it with `agentica prices.agc`:

```output
item 1: 302 cents
item 2: 1210 cents
item 3: 119 cents
total: 1631 cents
```

## Read next

- [Getting started](https://www.agentica-lang.com/agentica/getting-started/index.md): install Agentica, run your first program and check it.
- [Language tour](https://www.agentica-lang.com/agentica/tour/index.md): the language in short pages, one idea at a time.
- [Command line](https://www.agentica-lang.com/agentica/cli/index.md): every command, option and cache of the `agentica` program.
- [Library](https://www.agentica-lang.com/agentica/library/index.md): every builtin module, with one example per function.
- [Language specification](https://www.agentica-lang.com/agentica/reference/index.md): the formal grammar and rules.
- [Style guide](https://www.agentica-lang.com/agentica/style/index.md): how to write simple code that is easy to read.
- [Patterns](https://www.agentica-lang.com/agentica/patterns/index.md): the common design patterns in Agentica.
- [The Aurora VM](https://www.agentica-lang.com/agentica/vm/index.md): how your program runs, and the libraries underneath.
