Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Language model and limits

Goblin is a dynamically typed language with a tree-walking interpreter and a Go transpilation backend. Both backends use the same parser, semantic checks, and runtime object model. Use goblin run for iteration and goblin build-exe when a standalone executable is needed.

The language is intentionally small. These boundaries are useful to know before designing a larger program:

AreaCurrent behavior
TypesDynamic; functions and fields have no annotations
FunctionsRequired and defaulted parameters plus *args and **kwargs
StringsUnicode-aware iteration and size; no string[index] syntax
ListsDirect indexes are non-negative; some methods such as pop() accept negative indexes
ImportsModule scope only; local paths are relative to the importing file
ConcurrencyGoroutines, channels, and joinable Goblin handles; no select or cancellation
ErrorsExplicit raise and try/catch; spawned-function errors are not propagated

Goblin favors direct, explicit code over a large amount of syntax. When a feature is absent, compose the available pieces: use a channel instead of a join operation, or an explicit loop instead of a specialized expression form.

Choosing a backend

Start with goblin run while developing. It gives direct source tracebacks and does not need to invoke Go. Use goblin build-exe only once the program works; it generates Go code and requires a working Go toolchain. A generated executable still uses Goblin's runtime behavior, rather than turning a Goblin value into a native Go primitive everywhere.