> For the complete documentation index, see [llms.txt](https://aymericbeaumet.gitbook.io/pimp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aymericbeaumet.gitbook.io/pimp/user-guide/script-engine.md).

# Script Engine (PimpScript)

pimp embeds a scripting language (conveniently named *PimpScript*). This language is actually just the Go template languages without delimiters (`{{` and `}}`), significant whitespaces nor tabs; but with added support for newlines and `;` as end of expressions. You can use `pimp --transpile` to see how a piece of PimpScript would be evaluated:

```bash
$ pimp --transpile <<EOF
range list 1 2 3
  if eq . 1; println "Winner!"
  else; printf "You are in position %d\n" .
  end
end
EOF
```

This produces the following output:

```
{{- range list 1 2 3 -}}
{{- if eq . 1 -}}
{{- println "Winner!" -}}
{{- else -}}
{{- printf "You are in position %d\n" . -}}
{{- end -}}
{{- end -}}
```

You can execute:

```bash
pimp --exec <<EOF
range list 1 2 3
  if eq . 1
    println "Winner!"
  else
    printf "You are in position %d\n" .
  end
end
EOF
```

Which produces the following output:

```
Winner!
You are in position 2
You are in position 3
```

## REPL

pimp comes with an REPL with history, autocompletion, etc. It's a good way to experiment short scripts:

```
$ pimp
pimp> if eq (mul 3 3) 9; println "ok"; end
ok
```
