Skip to content

miggoxyz/miggolang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Miggolang

Key Features

  • Variable Bindings:
    let x = 42;
    let y = x + 8;
    
  • First-Class Functions:
    let multiply = fn(a, b) { a * b; };
    multiply(6, 7); // 42
    
  • Closures:
    let makeIncrementer = fn(x) { fn(y) { x + y; }};
    let addTwo = makeIncrementer(2);
    addTwo(3); // 5
    
  • Data Structures:
    • Arrays: [1, 2, 3]
    • Hash Maps: { "key": "value" }
  • Conditional Expressions:
    if (5 > 3) { "Yes" } else { "No" }
    

Running Miggolang

  1. Clone the repository:

    git clone https://github.com/miggoxyz/miggolang.git
    cd miggolang
  2. Build the interpreter:

    go build -o miggolang
  3. Launch the REPL (Read-Eval-Print Loop):

    ./miggolang
  4. Start writing Miggolang code:

    >> let x = 10 * 2;
    >> x
    20
    

Technical Highlights

  • Lexer: Converts raw source code into tokens for processing.
  • Parser: Constructs an Abstract Syntax Tree (AST) from tokens.
  • Evaluator: Interprets the AST and executes operations dynamically.
  • Built-in Functions: Includes functions like len, first, last, and custom user-defined functions.
  • Error Handling: Gracefully identifies and reports syntax or runtime errors.

Contributing

About

A programming language written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages