Skip to content

rahul05ranjan/couple-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

💕 CoupleScript Programming Language

The world's most romantic programming language - where every program is a love story!

License: MIT Platform Language Build Status Docker Love Level Documentation

Explore our beautiful documentation site with installation guides, API reference, and 20+ fun examples!

🌟 What is CoupleScript?

CoupleScript is a fun, relationship-themed programming language that uses marriage and love metaphors to make programming more enjoyable and relatable. Built completely from scratch with no dependencies on existing languages!

# Your first love story in code! 💕
marry husband "Alex"
marry wife "Emma"

remember "Meet our lovely couple: " + husband + " and " + wife

argue love:
    remember "They lived happily ever after! 🎉"
    anniversary year in couple[1, 2, 3, 4, 5]:
        remember "Year " + year + ": Still in love! 💖"
makeup:
    remember "Every relationship has its challenges... 💪"

🚀 Features

  • 💝 Completely Independent - No Python, C, or JavaScript dependencies
  • 🎭 Relationship-Themed Keywords - marry, propose, accept, argue, makeup, remember
  • 🔧 Self-Hosting - Compiler written in CoupleScript itself!
  • Fast - Assembly-based virtual machine
  • 🌍 Cross-Platform - Windows, Linux, macOS, Docker
  • 📚 Educational - Learn programming through romantic metaphors
  • 🎮 Interactive REPL - Live coding environment
  • 🐳 Docker Ready - Run anywhere with Docker support
  • 💖 Fun - Makes programming enjoyable for everyone!

Language Features

Keywords & Concepts

  • marry - Variable declaration/assignment
  • divorce - Variable deletion
  • propose - Function definition
  • accept - Function call
  • argue - Conditional statements (if)
  • makeup - Else clause
  • remember - Print/output
  • forget - Clear/reset
  • promise - Return statement
  • anniversary - Loop
  • separate - Break
  • together - Block grouping

Data Types

  • love - Boolean true
  • hate - Boolean false
  • heart - Numbers
  • words - Strings
  • couple - Arrays/Lists
  • memory - Objects/Dictionaries

Quick Start

# Variable declaration
marry name "Alice"
marry age 25

# Function definition
propose greet(person):
    remember "Hello, " + person + "!"

# Function call
accept greet(name)

# Conditional logic
argue age > 18:
    remember "Adult"
makeup:
    remember "Minor"

# Loops
anniversary i in couple[1, 2, 3, 4, 5]:
    remember i

🚀 Super Easy Installation

🎯 Prerequisites

Windows:

  • Install NASM assembler
  • Install Visual Studio Build Tools or use WSL

Linux/Mac:

# Ubuntu/Debian
sudo apt-get install build-essential nasm

# macOS
xcode-select --install  # Optional: brew install nasm

🏃‍♂️ Build & Run

All Platforms:

# 1. Clone the repository
git clone https://github.com/rahul05ranjan/couple-script.git
cd couple-script

# 2. Build CoupleScript
make all

# 3. Start coding in love!
# Windows:
couplescript.bat examples/hello.couple    # Run a program
couplescript.bat                          # Interactive mode

# Linux/Mac:
./couplescript examples/hello.couple      # Run a program
./couplescript                            # Interactive mode

Windows Alternative:

# Easy Windows build script
build_windows.bat

📖 Need Help?

🚨 Windows Users Quick Setup

Option 1: Install Native Tools

  1. Install NASM - download and add to PATH
  2. Install Visual Studio Build Tools
  3. Run: build_windows.bat or make all

Option 2: Use WSL (Recommended for ease)

  1. Install WSL: wsl --install (restart required)
  2. In WSL: sudo apt update && sudo apt install build-essential nasm
  3. In WSL: make all

Option 3: GitHub Codespaces/Online

  • Open this repo in GitHub Codespaces - everything works out of the box!

Option 4: Docker (Easiest - No Dependencies!)

🐳 No installation required! Run CoupleScript instantly with Docker:

# Build and run immediately (one command!)
docker build -t couplescript https://github.com/rahul05ranjan/couple-script.git && docker run -it --rm couplescript

# Or clone and use helper scripts:
git clone https://github.com/rahul05ranjan/couple-script.git
cd couple-script
./docker-run.sh build && ./docker-run.sh run    # Linux/Mac
docker-run.bat build && docker-run.bat run      # Windows

Perfect for:

  • 🎓 Education - No setup hassles for students
  • 🧪 Testing - Try CoupleScript without installing anything
  • 🌍 Any Platform - Works anywhere Docker runs
  • 👥 Teams - Consistent development environment

📖 Complete Docker Guide for advanced usage, development, and deployment

🐳 Docker Support

CoupleScript now supports Docker for easy deployment across any platform! Perfect for consistent development environments and cloud deployments.

Quick Docker Start

# Build the image
make docker-build

# Run interactively
make docker-run

# Or use helper scripts:
./docker-run.sh build    # Linux/Mac
docker-run.bat build     # Windows

Docker Commands

# Build & run
make docker-build        # Build Docker image
make docker-run          # Run interactive CoupleScript
make docker-test         # Run all tests in Docker
make docker-examples     # Run example programs
make docker-dev          # Start development environment
make docker-clean        # Clean up Docker resources

📖 Complete Docker Guide - Detailed Docker usage instructions

Examples

See the examples/ directory for sample programs demonstrating various features of CoupleScript.

Architecture

  • lexer.couple - Tokenizes CoupleScript source code (written in CoupleScript itself!)
  • parser.couple - Parses tokens into an Abstract Syntax Tree
  • vm.couple - Virtual machine that executes CoupleScript bytecode
  • compiler.couple - Compiles AST to bytecode
  • runtime.couple - Runtime system and memory management
  • bootstrap/ - Initial bootstrap compiler written in assembly
  • Makefile - Build system

🤝 Contributing

We love contributions from the community! CoupleScript is all about spreading love through code, and we'd love your help to make it even better. Whether you're a seasoned developer or just starting your coding journey, there are many ways to contribute! 💕

👉 Read our detailed Contributing Guide for complete instructions!

🌟 Quick Ways to Contribute

🐛 Bug Reports & Feature Requests

  • Found a bug? Open an issue
  • Have a romantic feature idea? We'd love to hear it!
  • Improve documentation or add more examples

💻 Code Contributions

  • Add new relationship-themed keywords or functions
  • Improve the compiler or virtual machine
  • Create fun example programs
  • Enhance error messages to be more user-friendly
  • Add support for new platforms

📚 Documentation & Examples

  • Write tutorials or blog posts
  • Create more fun example programs
  • Improve installation guides
  • Add translations for documentation

🧪 Testing

CoupleScript includes a comprehensive testing framework designed for the complete language implementation:

🎯 Current CI Status: ✅ PASSING

The CI pipeline validates project structure and build system:

# CI validation (works now)
make test                   # Project structure validation
./validate_project.sh      # Comprehensive project health check

# Build testing (requires NASM)
make test-build            # Validates successful compilation

# Full testing (requires working interpreter)
make test-full             # Complete test suite with execution

📊 Test Coverage Levels

Level 1 - ✅ Structure Validation (CI Ready)

  • ✅ Project structure and file organization
  • ✅ CoupleScript syntax validation in examples
  • ✅ Documentation completeness
  • ✅ Build system configuration

Level 2 - 🔨 Build Validation (NASM Required)

  • 🔨 Bootstrap compiler assembly
  • 🔨 Virtual machine compilation
  • 🔨 Binary artifact creation

Level 3 - 🚀 Runtime Testing (Full Implementation)

  • 🚀 Language feature execution
  • 🚀 Error handling validation
  • 🚀 Performance benchmarking
  • 🚀 Cross-platform compatibility

🏗️ Testing Infrastructure

The project includes a complete testing framework ready for when the interpreter is functional:

  • tests/test_framework.couple - Testing framework written in CoupleScript
  • tests/unit/ - Unit tests for language features
  • tests/integration/ - End-to-end integration tests
  • run_tests.sh / run_tests.bat - Cross-platform test runners

See tests/README.md for detailed testing documentation.

🚀 Quick Startfor Contributors

1. Fork & Clone

# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/couple-script.git
cd couple-script
git remote add upstream https://github.com/rahul05ranjan/couple-script.git

2. Set Up Development Environment

# Install dependencies (Linux/macOS)
sudo apt-get install build-essential nasm  # Ubuntu/Debian
# or: brew install nasm                     # macOS

# Build the project
make all

# Test your setup
make test
./couplescript examples/hello.couple

3. Create Your Feature Branch

git checkout -b feature/amazing-romantic-feature
# or: git checkout -b fix/some-bug-fix

4. Make Your Changes

  • Write your code with love! 💖
  • Follow the existing code style
  • Add comments explaining your romantic logic
  • Create or update examples if needed

5. Test Your Changes

# Build and test
make clean && make all
make test

# Test your specific changes
# Windows:
couplescript.bat your_test_program.couple
# Linux/macOS:
./couplescript your_test_program.couple

6. Commit Your Love

git add .
git commit -m "Add amazing romantic feature that makes coding more lovely"

7. Push & Create Pull Request

git push origin feature/amazing-romantic-feature

Then create a Pull Request on GitHub with:

  • Clear description of your changes
  • Why this makes CoupleScript more romantic/better
  • Any testing you've done

🎯 Contribution Ideas

🆕 Easy (Good First Issues)

  • Add new example programs (love poems, date planners, etc.)
  • Improve error messages to be more romantic
  • Add more relationship-themed built-in functions
  • Fix typos in documentation
  • Add unit tests for existing features

🔧 Intermediate

  • Implement new language features (e.g., engagement for constants)
  • Improve the REPL experience
  • Add debugging capabilities
  • Create a VS Code extension with syntax highlighting
  • Implement more data structures (e.g., wedding_guest_list)

🚀 Advanced

  • Optimize the virtual machine performance
  • Add networking capabilities for "long-distance relationships"
  • Create a package manager for CoupleScript libraries
  • Implement compilation to native machine code
  • Add support for concurrent "relationships" (threading)

📋 Code Guidelines

Romantic Coding Standards

  • Use relationship metaphors consistently
  • Write code that tells a love story
  • Comment your code as if explaining to your significant other
  • Test thoroughly - we want stable relationships!
  • Keep functions small and focused (like perfect date plans)

Naming Conventions

  • Variables: camelCase (e.g., myLoveStory, firstDate)
  • Functions: snake_case with romantic names (e.g., propose_marriage, calculate_love_score)
  • Constants: UPPER_CASE (e.g., ETERNAL_LOVE, MAX_ROMANCE_LEVEL)

Example Code Style

# Good: Romantic and clear
marry couple_names couple["Alice", "Bob"]
propose plan_perfect_date(location, activity):
    marry date_plan memory[
        "location": location,
        "activity": activity,
        "romance_level": 100
    ]
    promise date_plan

# Comments should be loving and helpful
# This function calculates the compatibility between two people
propose calculate_compatibility(person1, person2):
    # Love always finds a way! 💕
    promise love

🏆 Recognition

Contributors will be:

  • ✨ Added to our Hall of Love (contributors list)
  • 💕 Mentioned in release notes
  • 🌟 Given special romantic titles based on contributions
  • 💖 Invited to help shape the future of CoupleScript

💬 Community & Support

📜 Code of Conduct

We're committed to providing a welcoming and inclusive environment. Please:

  • Be respectful and kind (like in any good relationship)
  • Help others learn and grow
  • Embrace diversity and different perspectives
  • Keep discussions constructive and romantic! 💕

Remember: In code as in love, every contribution matters! 💖


Ready to contribute? We can't wait to see what romantic features you'll bring to CoupleScript!

License

MIT License - Feel free to use this for educational purposes or just for fun!

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published