Skip to content

d0mkaaa/ecpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECPP - a simple programing language for non nerds.

ECPP (EC++ / Easy C++) is a minimalistic programming language implemented in C++. It features basic programming constructs like functions, variables, and arithmetic operations.

Version History

v0.2.0-alpha

  • Added multiplication, division, and modulo operations
  • Added string interpolation with ${variable}
  • Added proper scope handling for variables
  • Added debug system with multiple levels
  • Added improved memory management
  • Added support for complex expressions

v0.1.0-alpha

  • Initial release
  • Basic function support
  • Variable declarations
  • Print statements
  • Basic arithmetic (+, -)

Features

  • Function declarations and calls with proper scoping
  • Variable declarations and assignments
  • Full arithmetic operations (+, -, *, /, %)
  • String literals with variable interpolation
  • Print statements
  • Complex expression support with parentheses
  • Comprehensive debug system
  • Memory-safe implementation
  • Basic error handling

Building

Windows

.\BUILD.bat

Linux/MacOS

g++ -std=c++17 -I./src/core -I./src/ast src/main.cpp src/core/.cpp -o build/ecpp

Usage

Basic usage:

./ecpp <filename.ec>

With debug output:

./ecpp <filename.ec> --debug <level>

Debug levels:

  • error: Error messages only
  • warn: Warnings and errors
  • info: General information
  • debug: Detailed debug information
  • trace: Most verbose output

Language Syntax

Functions with Scoped Variables

func greet() {
    var name = "World"
    print("Hello, ${name}!")
}

main() {
    greet()
}

Variables and Arithmetic

main() {
    var x = 10
    var y = 20
    
    print("Basic arithmetic:")
    print(x + y)
    print(y - x)
    print(x * y)
    print(y / x) 
    print(y % x) 
    
    // Complex expressions
    var z = 5
    print(x * y + z) 
    print(x * (y + z)) 
}

String Interpolation

main() {
    var name = "ECPP"
    var version = "0.2.0-alpha"
    print("Welcome to ${name} version ${version}!")
}

Debug Features

# No debug output
./ecpp hello.ec

# Only errors
./ecpp hello.ec --debug error

# Full debug information
./ecpp hello.ec --debug debug

# Most verbose output
./ecpp hello.ec --debug trace

Contributing

Feel free to open issues or submit pull requests. All contributions are welcome! ❤️

Future Improvements

  • Implement if/else conditionals
  • Add while/for loops
  • Add function parameters and return values
  • Add type system
  • Implement arrays and basic data structures
  • Add standard library functions
  • Improve error messages and recovery
  • Add module/import system

About

a simple programing language for non nerds.

Resources

License

Stars

Watchers

Forks

Packages

No packages published