EmojiScript is a fun programming language that uses emojis as operators and keywords. It features a rich set of operations, an interactive REPL with syntax highlighting, and a file execution mode.
- Interactive REPL with syntax highlighting
- File execution mode
- Rich set of operators and commands
- Colorful terminal output
- Helpful built-in examples and documentation
- Ensure you have Python 3.6+ installed
- Install the required dependencies:
pip install prompt_toolkit pygments termcolor
- Clone this repository:
git clone https://github.com/lwgray/emojiscript
cd emojiscript
Start the interactive REPL by running:
python emoji_cli.py
In the REPL, you can:
- Type code directly
- Use
help
to see available commands - Use
examples
to see example code - Use
exit
to quit - Use Ctrl+D or Ctrl+C to exit
Run an EmojiScript file:
python emoji_cli.py yourscript.ejs
- 📢 - Print statement
📢 💭"Hello, World! 👋"
- 📦 - Variable declaration
📦x = 10
- 🤝 - Addition
- 💔 - Subtraction
- 💫 - Multiplication
- ✂️ - Division
- 🤔 - If statement
- 🤷 - Else statement
- 🔁 - Loop
- 📈 - Greater than
- 📉 - Less than
- 💭 - String
- 🔢 - Numbers (direct input)
- 📋 - Create list
- 📎 - Append to list
- 🎣 - Get from list
- 🎲 - Random number
- 💤 - Sleep/pause
- 🤜 - Left parenthesis
- 🤛 - Right parenthesis
📢 💭"Hello, World! 👋"
📦x = 10
📦y = 5
📢 🤜📦x 🤝 📦y🤛
📦num = 7
🤔 🤜📦num 📈 5🤛 📢 💭"Big number!" 🤷 📢 💭"Small number!"
📦counter = 0
🔁 3 📦counter = 🤜📦counter 🤝 1🤛
📢 📦counter
📋 📦mylist
📎 📦mylist 42
📎 📦mylist 42
📎 📦mylist 17
📢 🎣 📦mylist 2
📢 🎲 10
EmojiScript provides clear, emoji-enhanced error messages for common issues:
- File not found errors
- Syntax errors
- Runtime errors
emojiscript/
├── emoji_cli.py # CLI interface
├── emoji.py # Core interpreter
├── README.md # Documentation
└── test_emoji.py # Unittests
python -m unittest test_emoji.py
Contributions are welcome! Areas for improvement:
- Adding new emoji operators
- Improving error messages
- Adding more examples
- Enhancing the REPL
- Writing documentation
This project is licensed under the MIT License - see the LICENSE file for details.
EmojiScript was created as a fun way to learn about:
- Lexers and parsers
- Interpreter design
- REPL interfaces
- Command-line tools
- 1.0.0
- Interactive REPL with syntax highlighting
- File execution mode
- Complete set of mathematical operators
- Control flow statements
- List operations
- Built-in help and examples