The Toy Language is a small, dynamic, toy scripting language written in Go.
Toy is somewhat similar to Go, but was created as a configuration language to ditch another YAML DSL. Its codebase is based on The Tengo Language, but it has been modified to make the language more comfortable to work with and add missing features and functionality. Do not expect this language to be blazingly fast, it relies heavily on interfaces and reflection, and it is even slower than Tengo.
fmt := import("fmt")
fib := fn(n) {
if n == 0 {
return 0
} else if n == 1 {
return 1
}
return fib(n-1) + fib(n-2)
}
fmt.println(fib(35)) // 9227465
- Vim/Neovim: toy-vim
- All editors which support Treesitter: tree-sitter-toy