Skip to content

harshitt13/meowscripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐱 MeowScript

A fun, cat-themed programming language with a live web playground. Write code using meow(), purr(), catnap(), and more!

Try it live →


✨ Features

  • 📢 Printmeow("Hello!") to display output
  • 📦 Variablesx = 42 with full arithmetic support
  • 🔀 Conditionalsif (x > 10) { ... }
  • 🔄 Loopswhile (x < 50) { ... }
  • 😴 Delayscatnap(2) pauses execution
  • 😸 Purringpurr() because every cat should purr
  • 🛡️ Error handlingtry { ... } scratch { ... }
  • 💬 Comments~ purr purr this is a comment

🚀 Quick Start

Try it online

Head to the live playground and start coding — no setup needed.

Run locally

# Clone the repo
git clone https://github.com/harshitt13/meowscript.git
cd meowscript

# Start the frontend
cd Frontend
npm install
npm run dev

# In another terminal — start the backend
cd Backend
npm install
node server.js

Frontend runs at http://localhost:5173, backend at http://localhost:3001.


📖 Language Reference

Comments

~ purr purr this is a comment

Variables & Math

x = 10
y = 25
sum = x + y
meow("Total: " + sum)

Conditionals

if (x > 10) {
  meow("Big number!")
}

Loops

i = 0
while (i < 5) {
  meow("Meow #" + i)
  i = i + 1
}

Delays

meow("Getting sleepy...")
catnap(2)
meow("Awake!")

Error Handling

try {
  meow(oops)
} scratch {
  meow("Caught an error! 😼")
}

Full Example

~ purr purr Welcome to MeowScript!
x = 5
y = 10
z = x + y
meow("The sum is: " + z)

if (z > 10) {
  meow("😺 " + z + " is greater than 10!")
}

purr()

while (z < 20) {
  z = z + 2
  meow("z is now: " + z)
}

Output:

The sum is: 15
😺 15 is greater than 10!
😸 Purring...
z is now: 17
z is now: 19
z is now: 21

🏗️ Project Structure

meowscript/
├── Backend/
│   ├── interpreter.js    # MeowScript interpreter (safe expression parser)
│   ├── server.js         # Express API server
│   ├── vercel.json       # Vercel deployment config
│   └── package.json
├── Frontend/
│   ├── src/
│   │   ├── App.jsx              # Main playground UI
│   │   ├── components/
│   │   │   └── Documentation.jsx  # Language reference cards
│   │   ├── styles.css           # App styles
│   │   ├── index.css            # Global styles & design tokens
│   │   └── main.jsx             # Entry point
│   ├── public/                  # Static assets
│   ├── index.html
│   └── package.json
└── README.md

🛡️ Security

The interpreter uses a custom recursive descent parser for evaluating expressions — no eval() or Function() calls. User-submitted code runs in a sandboxed context with:

  • Iteration limit — max 10,000 iterations per execution
  • Execution timeout — 5 second hard limit
  • Input validation — max 5,000 characters
  • Rate limiting — 15 requests per minute per IP

🚢 Deployment

Both frontend and backend are deployed on Vercel:

  • Frontend — auto-deploys from Frontend/ directory
  • Backend — auto-deploys from Backend/ directory as a serverless function

To deploy your own:

  1. Fork this repo
  2. Import each directory as a separate Vercel project
  3. Set the backend URL in the frontend via the VITE_API_URL environment variable

📜 License

MIT


🤝 Contributing

PRs and issues are welcome! Whether it's a bug fix, new language feature, or UI improvement — feel free to contribute. 🐾


If you like MeowScript, give it a ⭐ on GitHub!

About

purrest programming language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors