Skip to content

Repository files navigation

Animal Language

Documentation Status Go Report Card Release

Animal is a programming language where operators, control flow and data structures are expressed with animal calls and behaviors with fully‑feathered (get it?) language with functions, nests (classes), lists, file I/O and symbolic error handling.

Quick Start

go install github.com/animal-lang/animal/cmd/animal@latest

# Start the REPL
animal --repl

# Run a program
animal path/to/script.anml

Try this simple Animal program:

roar "Welcome to the animal kingdom!"

age -> 5
weight -> 10
total -> age meow weight

roar "Total:", total

Highlights

  • Intuitive syntaxmeow, woof, moo, leap, pounce, howl and more!

  • Modern tooling – Interactive REPL, execution timers (animal --time) and debugging output (animal --debug).

  • Deep standard library – File helpers (drop, fetch, sniff_file), symbolic error handling (try/catch blocks), list methods (sniff, snarl, prowl, wag, …) and math utilities.

  • Nests and functions – Build reusable abstractions with nest definitions and first‑class howl functions.

  • Runs everywhere – Native Go binary plus a WebAssembly build so Animal code can run in the browser.

Editor Support

Documentation

Full guides, language reference and standard library docs is available at animal.readthedocs.io.

Install from Source

git clone https://github.com/animal-lang/animal.git
cd animal
go build -o animal ./cmd/animal
go test ./...

Basic example

-- Conditionals
n -> 5

growl n <= 1 {
    roar 1 
} wag {
    roar n moo n 
}


-- Loops
leap i from 0 to 5 {
    roar i
}

-- Functions
howl calculate_area(length, width) {
    length moo width sniffback  -- Multiplication
}

area -> calculate_area(5, 10)
roar "Area:", area

Example for lists, file I/O and symbolic errors

log_path -> "log.txt"

pack -> ["lynx", "otter", "stoat"]
pack.sniff("mink")

drop(log_path, "Pack members: " purr pack)

*[
  howl find_index(name) {
      idx -> pack.howl(name)
      idx growl -1 sniffback
  }

  roar "Mink index:", find_index("mink")
]* *(
  roar "Something went wrong:", _error
)* *{
  "Missing pack member"
}*

License

Animal is released under the MIT License.

About

Custom programming language built in Go inspired by animal sounds and behaviors.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages