WTFScript is a minimal, experimental scripting language with randomization as a key feature.
For the record, WTFScript stands for "Wild Type Factory Script" – a chaotic playground for exploring types, randomness, and scripting.
Using it will make you go "WTF?" and make you question your sanity, but in a fun way!
- Variable declarations with random initialization
- Type support:
int,uint,float,unofloat,bool,string - Arithmetic operations:
+ - * /with parentheses - Built-in functions:
print(args)– prints arguments (variables or literals)seed(int)– sets the randomness seed
- Range-based type declarations, e.g.
int(0, 1000) x;
wtf-script/
├── builtins/ # Built-in functions implementation
├── cmd/ # CLI entry point
├── config/ # Configuration system
├── docs/ # Language specification and roadmap
├── examples/ # Sample WTFScript programs
├── interpreter/ # AST, parser, lexer, interpreter logic (including test files)
├── types/ # Type definitions and variable system
├── go.mod
└── README.md
git clone https://github.com/danqzq/wtf-script.git
cd wtf-scriptRequires Go 1.22+:
go build -o wtf ./cmd/wtf/main.go./wtf examples/intro.wtfWTFScript supports custom configuration via JSON files to define default random ranges for all types.
./wtf --config config.json script.wtfCreate a config.json file:
{
"int": {
"min": -100,
"max": 100
},
"float": {
"min": -50.0,
"max": 50.0
},
}Default values (when no config is provided):
int: -1000 to 1000uint: 0 to 2000float: -1000.0 to 1000.0unofloat: 0.0 to 1.0- String length: 10 characters
See config.json for a complete example configuration file.
seed(42);
int(1, 100) x;
float pi = 3.14;
string name;
bool flag;
print(x);
print(pi);
print(name);
print(flag);
print("Seeded randomness!");
Possible output:
27
3.14
YvH4wqPj
true
Seeded randomness!
See more example scripts under
examples/.
See docs/spec.md for the full language specification.
- MVP with variable declarations and print
- Arithmetic operations with operator precedence
- Proper lexer and AST implementation
- Branching:
if,else(+ random branching withifrand) - Loops:
while,for(+ random loops) - Functions with parameters and returns
- Arrays and maps
- REPL mode
- Syntax highlighting plugin for VSCode
- Web playground
| Maintainers | Danial Jumagaliyev | Elshad Humbatli |
|---|---|---|
| Contributor | ![]() (The Creator) |
![]() (Top G) |
| GitHub Profile | @danqzq | @ElshadHu |
Pull requests are welcome. Feel free to file issues for bugs, suggestions, or chaotic ideas.
This project is under the MIT License
WTFScript: Because determinism is overrated. Enjoy the chaos! 🎉


