Skip to content

EmojiScript ๐ŸŽฎ - A fun programming language where emojis are the syntax! Write code using emojis for operators (๐Ÿค for add, ๐Ÿ’” for subtract) and keywords (๐Ÿ“ข for print, ๐Ÿค” for if statements). Features a colorful REPL with syntax highlighting, file execution mode, and built-in operations for math, loops, lists, and more.

Notifications You must be signed in to change notification settings

lwgray/emojiscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EmojiScript ๐ŸŽฎ

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.

Features โœจ

  • Interactive REPL with syntax highlighting
  • File execution mode
  • Rich set of operators and commands
  • Colorful terminal output
  • Helpful built-in examples and documentation

Installation ๐Ÿš€

  1. Ensure you have Python 3.6+ installed
  2. Install the required dependencies:
pip install prompt_toolkit pygments termcolor
  1. Clone this repository:
git clone https://github.com/lwgray/emojiscript
cd emojiscript

Usage ๐Ÿ’ป

Interactive REPL

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

File Execution

Run an EmojiScript file:

python emoji_cli.py yourscript.ejs

Language Reference ๐Ÿ“š

Output

  • ๐Ÿ“ข - Print statement
    ๐Ÿ“ข ๐Ÿ’ญ"Hello, World! ๐Ÿ‘‹"
    

Variables

  • ๐Ÿ“ฆ - Variable declaration
    ๐Ÿ“ฆx = 10
    

Math Operations

  • ๐Ÿค - Addition
  • ๐Ÿ’” - Subtraction
  • ๐Ÿ’ซ - Multiplication
  • โœ‚๏ธ - Division

Control Flow

  • ๐Ÿค” - If statement
  • ๐Ÿคท - Else statement
  • ๐Ÿ” - Loop

Comparisons

  • ๐Ÿ“ˆ - Greater than
  • ๐Ÿ“‰ - Less than

Data Types

  • ๐Ÿ’ญ - String
  • ๐Ÿ”ข - Numbers (direct input)

Lists

  • ๐Ÿ“‹ - Create list
  • ๐Ÿ“Ž - Append to list
  • ๐ŸŽฃ - Get from list

Special Operations

  • ๐ŸŽฒ - Random number
  • ๐Ÿ’ค - Sleep/pause

Grouping

  • ๐Ÿคœ - Left parenthesis
  • ๐Ÿค› - Right parenthesis

Example Programs ๐Ÿ“

Hello World

๐Ÿ“ข ๐Ÿ’ญ"Hello, World! ๐Ÿ‘‹"

Variables and Math

๐Ÿ“ฆx = 10
๐Ÿ“ฆy = 5
๐Ÿ“ข ๐Ÿคœ๐Ÿ“ฆx ๐Ÿค ๐Ÿ“ฆy๐Ÿค›

If-Else Statement

๐Ÿ“ฆnum = 7
๐Ÿค” ๐Ÿคœ๐Ÿ“ฆnum ๐Ÿ“ˆ 5๐Ÿค› ๐Ÿ“ข ๐Ÿ’ญ"Big number!" ๐Ÿคท ๐Ÿ“ข ๐Ÿ’ญ"Small number!"

Loop

๐Ÿ“ฆcounter = 0
๐Ÿ” 3 ๐Ÿ“ฆcounter = ๐Ÿคœ๐Ÿ“ฆcounter ๐Ÿค 1๐Ÿค›
๐Ÿ“ข ๐Ÿ“ฆcounter

Lists

๐Ÿ“‹ ๐Ÿ“ฆmylist
๐Ÿ“Ž ๐Ÿ“ฆmylist 42
๐Ÿ“Ž ๐Ÿ“ฆmylist 42
๐Ÿ“Ž ๐Ÿ“ฆmylist 17
๐Ÿ“ข ๐ŸŽฃ ๐Ÿ“ฆmylist 2

Random Numbers

๐Ÿ“ข ๐ŸŽฒ 10

Error Handling ๐Ÿšจ

EmojiScript provides clear, emoji-enhanced error messages for common issues:

  • File not found errors
  • Syntax errors
  • Runtime errors

Development ๐Ÿ› ๏ธ

Project Structure

emojiscript/
โ”œโ”€โ”€ emoji_cli.py     # CLI interface
โ”œโ”€โ”€ emoji.py         # Core interpreter
โ”œโ”€โ”€ README.md        # Documentation
โ””โ”€โ”€ test_emoji.py    # Unittests

Running Tests

python -m unittest test_emoji.py

Contributing ๐Ÿค

Contributions are welcome! Areas for improvement:

  • Adding new emoji operators
  • Improving error messages
  • Adding more examples
  • Enhancing the REPL
  • Writing documentation

License ๐Ÿ“

This project is licensed under the MIT License - see the LICENSE file for details.

Credits ๐Ÿ‘

EmojiScript was created as a fun way to learn about:

  • Lexers and parsers
  • Interpreter design
  • REPL interfaces
  • Command-line tools

Version History ๐Ÿ“…

  • 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

About

EmojiScript ๐ŸŽฎ - A fun programming language where emojis are the syntax! Write code using emojis for operators (๐Ÿค for add, ๐Ÿ’” for subtract) and keywords (๐Ÿ“ข for print, ๐Ÿค” for if statements). Features a colorful REPL with syntax highlighting, file execution mode, and built-in operations for math, loops, lists, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages