Skip to content

Mitra Codiga: Advanced programming language interpreter with variables, functions, control flow, interactive input/output. Features real-time web editor, REPL mode, educational examples. Perfect for learning language design, prototyping algorithms, and interactive programming. Built with Python.

License

Notifications You must be signed in to change notification settings

SarthakMitra323/Mitra-Codiga

Repository files navigation

Mitra Codiga Language Interpreter

An advanced, educational programming language interpreter built in Python. Features variables, functions, control flow, and more!

🚀 Try it Online

Mitra Codiga

✨ Features

  • Variables & Types: let x = 10, strings, numbers, booleans
  • Functions: fun name(args) { return value }
  • Control Flow: if/elif/else, while loops
  • Operators: Arithmetic (+, -, *, /, **), comparisons, boolean logic
  • Built-ins: print(), input(), len(), int(), float(), str()
  • Interactive REPL: Test code interactively
  • Web Interface: Online code editor and executor

🏃‍♂️ Quick Start

Local Installation

git clone https://github.com/SarthakMitra323/Mitra-Codiga.git
cd mitra-codiga

Run Programs

# Run a .mc file
python run_mc.py demo.mc

# Start interactive REPL
python mc_lang.py

Web Interface

pip install -r requirements.txt
python web_app.py
# Visit http://localhost:5000

📝 Example Code

# Variables and arithmetic
let x = 10;
let y = 20;
print("Sum:", x + y);

# Functions  
fun fibonacci(n) {
    if n <= 1 { return n; }
    return fibonacci(n-1) + fibonacci(n-2);
}

print("Fib(10):", fibonacci(10));

# Control flow
let i = 0;
while i < 5 {
    print("Count:", i);
    i = i + 1;
}

🌐 Free Hosting Options

1. Repl.it (Easiest)

  • Fork this repository
  • Import to Repl.it
  • Runs immediately with web interface

2. Heroku

# Add these files:
# - Procfile
# - requirements.txt
# - runtime.txt

heroku create your-app-name
git push heroku main

3. Railway

  • Connect your GitHub repo
  • Automatic deployment from main branch
  • Zero configuration needed

4. Render

  • Connect GitHub repository
  • Select "Web Service"
  • Build: pip install -r requirements.txt
  • Start: python web_app.py

5. Vercel (Static + Serverless)

  • Install Vercel CLI: npm i -g vercel
  • Run: vercel --prod
  • Automatic deployments from GitHub

6. Netlify

  • Drag & drop the folder to Netlify
  • Or connect via GitHub for auto-deployment

🔧 Development

Architecture

  1. Lexer: Converts source code to tokens
  2. Parser: Builds Abstract Syntax Tree (AST)
  3. Interpreter: Executes the AST with symbol tables

Adding Features

  • New operators: Modify lexer tokens and interpreter logic
  • Built-in functions: Add to inject_builtins()
  • Language constructs: Add AST nodes and parser rules

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

MIT License - feel free to use this for educational purposes!

🙏 Acknowledgments

Built as an educational project to demonstrate:

  • Programming language design
  • Interpreter implementation
  • Web deployment strategies
  • Modern development practices

Made with ❤️

About

Mitra Codiga: Advanced programming language interpreter with variables, functions, control flow, interactive input/output. Features real-time web editor, REPL mode, educational examples. Perfect for learning language design, prototyping algorithms, and interactive programming. Built with Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published