A programming language based on knock-knock jokes. Every statement follows the classic "Knock knock" → "Who's there?" → Command → "Command who?" pattern.
git clone https://github.com/darthvader58/knockscript.git
cd knockscript
bundle installruby knockscript.rb examples/hello_world.ksruby web/app.rb
# Visit http://localhost:4567Knock knock
Who's there?
Print
Print who? "Hello, World!"
Knock knock
Who's there?
Set
Set who? x to 42
Knock knock
Who's there?
If
If who? x greater than 10
Knock knock
Who's there?
Print
Print who? "x is big"
Otherwise
Knock knock
Who's there?
Print
Print who? "x is small"
Done
Knock knock
Who's there?
Class
Class who? Person with name and age
Knock knock
Who's there?
Set
Set who? alice to new Person with name "Alice" and age 30
- Variables and arithmetic operations
- Control flow (if/else, while, for loops)
- Object-oriented programming (classes, methods, attributes)
- Arrays and basic data structures
- Web-based code editor and runner
knockscript.rb- Main CLI entry pointlexer.rb- Tokenizerparser.rb- AST builderinterpreter.rb- Code executorweb/- Web interfaceexamples/- Sample programs
See CONTRIBUTING.md for guidelines on how to contribute to this project.
APACHE 2.0 License - see LICENSE file for details.