GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - bonkzero404/uddin-lang: Uddin-Lang is a modern, interpreted programming language designed with simplicity, expressiveness, and functional programming principles in mind. It combines the best features of dynamic languages with a clean, readable syntax that makes programming enjoyable and productive.

BranchesTags
Open more actions menu

Latest commit

 

History

271 Commits
271 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cmd/uddin-lang
cmd/uddin-lang
 
 
docs
docs
 
 
example_usages
example_usages
 
 
examples
examples
 
 
internal/version
internal/version
 
 
interpreter
interpreter
 
 
scripts
scripts
 
 
stdlib
stdlib
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
RELEASE.md
RELEASE.md
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
uddin.go
uddin.go
 
 
uddin_test.go
uddin_test.go
 
 

Repository files navigation

UDDIN-LANG

UDDIN-LANG (Unified Dynamic Decision Interpreter Notation) - A specialized Flexible Rule Logic Platform that resembles a programming language, offering high expressiveness, full flow control, and runtime programmable capabilities for complex business decision support systems.

UDDIN-LANG Logo

Flexible Rule Logic Platform with Programming Language Expressiveness

Go Version License

๐Ÿ“š Read Full Documentation โ†’

๐Ÿ“– Table of Contents

  • About UDDIN-LANG
  • Key Features
  • Quick Start
    • Installation
    • Your First Program
    • Explore Examples
    • CLI Features & Development Tools
  • Development Workflow Use Cases
  • Language Grammar
  • Architecture Overview
  • Contributing

๐ŸŒŸ About UDDIN-LANG

UDDIN-LANG is a specialized rule engine platform designed to bridge the gap between simple rule engines and full programming languages. It combines the power of programming language expressiveness with the simplicity needed for business decision systems.

๐ŸŽฏ Perfect For:

  • ๐Ÿ›ก๏ธ Security & Anti-fraud - Multi-factor authentication rules, transaction monitoring, and behavioral analysis systems
  • ๐Ÿค– Business Automation - Approval workflows, document processing, and intelligent routing systems
  • ๏ฟฝ Decision Support - Recommendation engines, risk assessment tools, and dynamic pricing systems
  • โš–๏ธ Compliance Rules - Regulatory compliance engines with audit trails
  • ๐Ÿ’ฐ Financial Logic - Complex financial calculations and risk management
  • ๐ŸŽฏ Recommendation Systems - Intelligent content and product recommendations
  • ๐Ÿ“‹ Data Validation - Complex validation rules with custom logic
  • ๐Ÿ”„ Real-time Data Processing - Change Data Capture (CDC) for live database monitoring and event-driven architectures

๐Ÿš€ Beyond Simple Rules

Unlike traditional rule engines that limit you to simple if-then logic, UDDIN-LANG provides:

  • Full Programming Language Power - Support for loops, functions, and complex logic
  • Runtime Flexibility - Modify rules without system restarts
  • Developer Friendly - Familiar syntax with powerful debugging capabilities
  • Enterprise Ready - Built for scale and performance

๐Ÿ›  Build Rule Platforms

UDDIN-LANG serves as the foundation for building sophisticated rule management platforms:

  • Visual Rule Designers - Drag-and-drop rule creation interfaces
  • Decision Management Systems - Enterprise-grade rule management platforms
  • Workflow Automation - Complex process rules with branching logic
  • React Flow Integration - Perfect backend for visual rule designers

๐ŸŽ“ Educational Tool

Ideal for learning programming fundamentals with a focus on decision logic:

  • Clean Syntax - Easy to read and understand for beginners
  • Logic First - Focus on decision-making and algorithmic thinking
  • Debugging Friendly - Clear execution flow for learning

๐Ÿ’ก Language Philosophy

UDDIN-LANG draws inspiration from multiple paradigms while maintaining focus on rule-based logic:

graph TD
    A[Uddin-Lang] --> B[Python - Clean Syntax]
    A --> C[JavaScript - Dynamic Nature]
    A --> D[Go - Simplicity]
    A --> E[Lua - Embedded Scripting]
    A --> F[Ruby - Expressiveness]

    style A fill:#4a90e2,stroke:#333,stroke-width:3px,color:white
    style B fill:#3776ab,stroke:#333,stroke-width:2px,color:white
    style C fill:#f7df1e,stroke:#333,stroke-width:2px,color:black
    style D fill:#00add8,stroke:#333,stroke-width:2px,color:white
    style E fill:#000080,stroke:#333,stroke-width:2px,color:white
    style F fill:#cc342d,stroke:#333,stroke-width:2px,color:white
Loading

Core Philosophy

  1. "Code should read like natural language" - Prioritizing readability over brevity
  2. "Functions are first-class citizens" - Everything is a value, including functions
  3. "Fail fast, fail clearly" - Clear error messages and early error detection
  4. "Simple things should be simple" - Common tasks require minimal code

โœจ Key Features

๐Ÿ”ฅ Core Features

  • โœ… Dynamic Typing with runtime type checking
  • โœ… First-class Functions and closures
  • โœ… Built-in Data Structures (Arrays, Maps/Objects)
  • โœ… Rich Built-in Functions including enhanced range() with Python-like syntax
  • โœ… Exception Handling with try-catch blocks
  • โœ… Advanced Error Reporting with precise error location and clear explanations
  • โœ… Loop Control (break, continue statements)
  • โœ… Module System โ€” import "name" for stdlib modules; import "file.din" for local scripts
  • โœ… Stdlib Modules โ€” json, regex, datetime, fs, http, database, fact, cdc, waf
  • โœ… Flexible Comment System with both single-line (//) and multiline (/* */) comments
  • โœ… Functional Programming paradigms
  • โœ… Memory Safe with garbage collection
  • โœ… Bytecode VM โ€” register-based VM compiles AST to bytecode for faster execution
  • โœ… Rich Operator Set including logical XOR and compound assignment operators
  • โœ… Multiline Strings with backticks for raw text (perfect for JSON, SQL, HTML)
  • โœจ Extended Standard Library with advanced string manipulation, functional array methods, and new data structures (Set, Stack, Queue)
  • ๐ŸŒ Comprehensive Networking with HTTP client, TCP/UDP sockets, and network utilities (via import "http")
  • ๐Ÿ—„๏ธ Database Integration & CDC with real-time Change Data Capture for PostgreSQL and MySQL binlog streaming (via import "database" / import "cdc")

๐Ÿ› ๏ธ Developer Tools

  • โœ… Syntax Analysis (--analyze) - Fast syntax checking without execution
  • โœ… Performance Profiling (--profile) - Detailed execution metrics and timing
  • โœ… Interactive CLI with comprehensive help and examples
  • โœ… Developer-Friendly Error Messages with source code context
  • โœ… Multiple Execution Modes - Analysis, profiling, and standard execution

โš ๏ธ v2.0 Breaking Change: date_now(), read_file(), regex_match(), json_parse(), db_connect(), http_get(), etc. are no longer global. Use import "module" first:

import "datetime"; import "fs"; import "regex"
print(datetime.now())
print(fs.read_file("data.txt"))

See stdlib module reference โ†’

๐Ÿ“– For complete language reference, syntax guide, and advanced examples:

๐ŸŒ Visit Full Documentation

๐Ÿ“š Go Library Documentation


๐Ÿš€ Quick Start

Installation

As a Go Library

# Add to your Go project
go get github.com/bonkzero404/uddin-lang

As a CLI Tool

# Install globally
go install github.com/bonkzero404/uddin-lang/cmd/uddin-lang@latest

# Or build from source
git clone https://github.com/bonkzero404/uddin-lang.git
cd uddin-lang
make build   # produces ./uddinlang
# or manually:
go build -o uddinlang ./cmd/uddin-lang/

Using as Go Library

package main

import (
    "fmt"
    "strings"

    uddin "github.com/bonkzero404/uddin-lang"
)

func main() {
    engine := uddin.New()

    // Capture output via SetStdout
    var buf strings.Builder
    engine.SetStdout(&buf)

    stats, err := engine.ExecuteString(`
        x = 10
        y = 20
        print(x + y)
    `)
    if err != nil {
        panic(err)
    }
    fmt.Println("Output:", strings.TrimSpace(buf.String())) // Output: 30
    fmt.Println("Ops:", stats.Ops)

    // Evaluate a single expression โ€” returns (Value, *Stats, error)
    value, _, err := engine.EvaluateString("2 + 3 * 4")
    if err != nil {
        panic(err)
    }
    fmt.Println("Expression result:", value) // Output: Expression result: 14
}

Your First Program

Create a file hello.din:

// hello.din - Your first Uddin-Lang program
fun main():
    print("Hello, Uddin-Lang! ๐Ÿš€")

    // Variables and expressions
    name = "World"
    message = "Welcome to " + name
    print(message)

    // Simple function
    fun greet(person):
        return "Hello, " + person + "!"
    end

    print(greet("Developer"))
end

Run it:

# If installed globally
uddin-lang hello.din

# If built from source
./uddinlang hello.din

# Or run directly from source
go run cmd/uddin-lang/main.go hello.din

Explore Examples

The language comes with comprehensive examples showcasing all features:

# List all available examples
./uddinlang --examples

# Basics
./uddinlang examples/basics/hello_world.din
./uddinlang examples/basics/logical_operators.din
./uddinlang examples/basics/functional_demo.din

# Data structures
./uddinlang examples/data-structures/array_methods_demo.din
./uddinlang examples/data-structures/data_structures_demo.din   # Set, Stack, Queue

# Math & calculations
./uddinlang examples/math-and-calculations/math_library.din
./uddinlang examples/math-and-calculations/import_library_demo.din

# File & data handling (requires: import "json" / import "fs")
./uddinlang examples/file-and-data-handling/json_handling_demo.din
./uddinlang examples/file-and-data-handling/filesystem_operations_demo.din
./uddinlang examples/file-and-data-handling/xml_handling_demo.din

# Networking (requires: import "http")
./uddinlang examples/networking-and-http/http_client_demo.din

# Database (requires: import "database")
./uddinlang examples/database/connection_pooling_demo.din
./uddinlang examples/database/batch_processing_demo.din

# Rule engine (requires: import "fact" / import "cdc" / import "regex" / import "datetime")
./uddinlang examples/rule-engine/rule_engine_fact_database_demo.din
./uddinlang examples/rule-engine/rule_engine_cep_demo.din
./uddinlang examples/rule-engine/rule_engine_regex_demo.din

# Performance
./uddinlang examples/performance-and-optimization/memoization_demo.din
./uddinlang examples/performance-and-optimization/concurrent_basic_demo.din

๐Ÿ› ๏ธ CLI Features & Development Tools

Uddin-Lang provides powerful command-line tools for development workflow:

Syntax Analysis

Check your code syntax without execution - perfect for development and CI/CD:

# Analyze syntax only (fast feedback)
./uddinlang --analyze script.din
./uddinlang -a script.din

# Example output for valid syntax:
# โœ“ Syntax analysis passed - No syntax errors found

# Example output for syntax errors:
# -----------------------------------------------------------
#     if (true):
#              ^
# -----------------------------------------------------------
# Syntax Error: parse error at 6:14: expected then, but got :

Performance Profiling

Monitor execution performance and optimization metrics:

# Run with performance profiling
./uddinlang --profile script.din
./uddinlang -p script.din

# Example profiling output:
# Time Program Execution: 254.166ยตs
# Elapsed Operation: 53 Ops (208525/s)
# Builtin Calls: 8 (31475/s)
# User Calls: 1 (3934/s)

Memory Optimization

Uddin-Lang provides two levels of memory optimization:

Stable Memory Optimization (Production-Ready)
# Run with stable memory optimizations
./uddinlang --memory-optimize-stable script.din

# Combine with profiling to see optimization effects
./uddinlang --memory-optimize-stable --profile script.din

โœ… Production Features:

  • Tagged value types for reduced memory overhead
  • Compact environment structures
  • Cache-friendly data layouts
  • Thread-safe and concurrent function compatible

When to use:

  • Production environments
  • Applications using concurrent functions
  • Multi-threaded environments
  • Performance-critical applications
Experimental Memory Optimization
# Run with experimental memory optimizations
./uddinlang --memory-optimize-experimental script.din

# Legacy flag (DEPRECATED - maps to experimental)
./uddinlang --memory-optimize script.din
./uddinlang -m script.din

โš ๏ธ Experimental Features (Additional to stable):

  • Variable lookup caching
  • Expression memoization
  • Not compatible with concurrent functions (concurrent_map, concurrent_filter, concurrent_reduce)
  • May have thread safety issues

When to use experimental:

  • Sequential processing workloads only
  • Development and testing environments
  • Performance benchmarking

When to avoid experimental:

  • Programs using concurrent functions
  • Multi-threaded environments
  • Production systems requiring stability

Available CLI Commands

Command Short Description
--help -h Show usage information
--version -v Display version information
--examples -e List all available example files
--analyze -a Syntax analysis without execution
--profile -p Enable performance profiling
--memory-optimize-stable Enable stable memory optimizations (production-ready)
--memory-optimize-experimental Enable experimental memory optimizations
--memory-optimize -m Enable experimental memory optimization (DEPRECATED)
--from_json Execute code from JSON AST format

Usage Examples

# Basic execution
./uddinlang script.din

# Development workflow
./uddinlang --analyze script.din    # Check syntax first
./uddinlang --profile script.din    # Run with performance monitoring

# Memory optimization (experimental)
./uddinlang --memory-optimize script.din  # Enable memory layout optimization
./uddinlang -m script.din                 # Short form

# JSON AST execution
./uddinlang --from_json script.json  # Execute from JSON AST format

# Flexible flag positioning
./uddinlang script.din --analyze    # Flags can be placed after filename
./uddinlang -a -p script.din        # Multiple flags (analyze takes priority)

# Get help and examples
./uddinlang --help                  # Show usage
./uddinlang --examples              # List example files
./uddinlang --version               # Show version info

๐ŸŽฏ Development Workflow Use Cases

Uddin-Lang CLI tools support various development scenarios:

๐Ÿ” Syntax Validation in CI/CD

# Validate all scripts in a project
find . -name "*.din" -exec ./uddinlang --analyze {} \;

# Exit code integration for CI/CD pipelines
./uddinlang --analyze script.din && echo "Syntax OK" || echo "Syntax Error"

๐Ÿ“Š Performance Optimization

# Before optimization
./uddinlang --profile slow_script.din

# After optimization
./uddinlang --profile optimized_script.din

# Compare execution metrics to measure improvements

๐Ÿš€ Rapid Development

# Edit-check-run cycle
vim script.din                      # Edit script
./uddinlang --analyze script.din     # Quick syntax check
./uddinlang script.din               # Run if syntax is valid

๐Ÿงช IDE/Editor Integration

# Language servers can use syntax analysis
./uddinlang --analyze file.din 2>&1 | parse_errors

# Real-time syntax highlighting based on analysis results

๐Ÿ“ Language Grammar

Formal Grammar (EBNF)

// Program Structure
program        = { statement }

// Statements
statement      = expression_stmt
               | assignment
               | if_stmt
               | while_stmt
               | for_stmt
               | function_def
               | memo_function_def
               | return_stmt
               | break_stmt
               | continue_stmt
               | import_stmt
               | try_catch_stmt

expression_stmt = expression
assignment     = ( IDENTIFIER | subscript ) ( "=" | "+=" | "-=" | "*=" | "/=" | "%=" ) expression

if_stmt        = "if" "(" expression ")" "then" ":" block
                   { ( "else" "if" | "elif" ) "(" expression ")" "then" ":" block }
                   [ "else" ":" block ] "end"

while_stmt     = "while" "(" expression ")" ":" block "end"

for_stmt       = "for" "(" IDENTIFIER "in" expression ")" ":" block "end"

function_def   = "fun" IDENTIFIER "(" [ parameter_list ] ")" ":" block "end"

memo_function_def = "memo" "fun" IDENTIFIER "(" [ parameter_list ] ")" ":" block "end"

return_stmt    = "return" [ expression ]
break_stmt     = "break"
continue_stmt  = "continue"
import_stmt    = "import" STRING

try_catch_stmt = "try" ":" block "catch" "(" IDENTIFIER ")" ":" block "end"

block          = { statement }
parameter_list = IDENTIFIER { "," IDENTIFIER } [ "..." ]

// Expressions (in precedence order, lowest to highest)
expression     = ternary
ternary        = logical_or [ "?" expression ":" expression ]
logical_or     = logical_xor { "or" logical_xor }
logical_xor    = logical_and { "xor" logical_and }
logical_and    = equality { "and" equality }
equality       = comparison { ( "==" | "!=" ) comparison }
comparison     = addition { ( "<" | "<=" | ">" | ">=" ) addition }
addition       = multiplication { ( "+" | "-" ) multiplication }
multiplication = power { ( "*" | "/" | "%" ) power }
power          = unary [ "**" power ]  // Right associative
unary          = ( "not" | "-" ) unary | postfix
postfix        = primary { call_suffix | subscript_suffix | property_suffix }

call_suffix    = "(" [ argument_list ] ")"
subscript_suffix = "[" expression "]"
property_suffix = "." IDENTIFIER

argument_list  = expression { "," expression } [ "..." ]

primary        = IDENTIFIER
               | literal
               | list
               | map
               | function_expression
               | "(" expression ")"

function_expression = "fun" "(" [ parameter_list ] ")" ":" block "end"

list           = "[" [ expression { "," expression } [ "," ] ] "]"
map            = "{" [ map_entry { "," map_entry } [ "," ] ] "}"
map_entry      = ( IDENTIFIER | STRING | "(" expression ")" ) ":" expression

subscript      = postfix "[" expression "]"
               | postfix "." IDENTIFIER

// Literals
literal        = INTEGER
               | FLOAT
               | STRING
               | "true"
               | "false"
               | "null"

// Lexical Elements
IDENTIFIER     = letter { letter | digit | "_" }
INTEGER        = digit { digit }
FLOAT          = digit { digit } "." digit { digit } [ ( "e" | "E" ) [ "+" | "-" ] digit { digit } ]
               | digit { digit } ( "e" | "E" ) [ "+" | "-" ] digit { digit }
STRING         = '"' { string_char } '"'
               | "'" { string_char } "'"
               | '"""' { any_char } '"""'  // Multiline string
string_char    = any_char_except_quote_and_newline | escape_sequence
escape_sequence = "\\" ( "n" | "t" | "r" | "\\" | '"' | "'" )

letter         = "a" ... "z" | "A" ... "Z"
digit          = "0" ... "9"

// Comments
comment        = single_line_comment | multiline_comment
single_line_comment = "//" { any_character_except_newline }
multiline_comment   = "/*" { any_character } "*/"

Operator Precedence (Highest to Lowest)

Precedence Operators Associativity Description
1 () [] . Left Function call, Array access, Property access
2 not - (unary) Right Logical NOT, Unary minus
3 ** Right Exponentiation (power operator)
4 * / % Left Multiplication, Division, Modulo
5 + - Left Addition, Subtraction
6 < <= > >= Left Relational operators
7 == != Left Equality operators
8 and Left Logical AND
9 xor Left Logical XOR (exclusive or)
10 or Left Logical OR
11 ? : Right Ternary conditional operator
12 = += -= *= /= %= Right Assignment and compound assignment

Language Features

Variadic Functions

Functions can accept variable number of arguments using the ellipsis (...) operator:

// Function definition with variadic parameters
parameter_list = IDENTIFIER { "," IDENTIFIER } [ "..." ]

// Function call with argument spreading
argument_list = expression { "," expression } [ "..." ]

Examples:

// Define variadic function
fun sum(numbers...):
    total = 0
    for (num in numbers):
        total += num
    end
    return total
end

// Call with multiple arguments
result = sum(1, 2, 3, 4, 5)

// Call with array spreading
numbers = [1, 2, 3, 4, 5]
result = sum(numbers...)

Memoization

Functions can be memoized for automatic caching using the memo keyword:

memo_function_def = "memo" "fun" IDENTIFIER "(" [ parameter_list ] ")" ( ":" | "{" ) block ( "end" | "}" )

Example:

// Memoized fibonacci function
memo fun fibonacci(n):
    if (n <= 1):
        return n
    end
    return fibonacci(n-1) + fibonacci(n-2)
end

Scientific Notation

Numeric literals support scientific notation:

FLOAT = digit { digit } "." digit { digit } [ ( "e" | "E" ) [ "+" | "-" ] digit { digit } ]
      | digit { digit } ( "e" | "E" ) [ "+" | "-" ] digit { digit }

Examples:

avogadro = 6.022e23
electron_mass = 9.109e-31
speed_of_light = 2.998E+8

Multiline Strings

Strings can span multiple lines using triple quotes:

STRING = '"' { string_char } '"'
       | "'" { string_char } "'"
       | '"""' { any_char } '"""'  // Multiline string

Example:

query = """
    SELECT name, age, email
    FROM users
    WHERE age > 18
    ORDER BY name
"""

Flexible Block Syntax

Blocks use colon-end syntax:

if (condition):
    statements
end

๐Ÿ—„๏ธ Database Integration & Change Data Capture (CDC)

UDDIN-LANG provides powerful real-time database integration capabilities with built-in Change Data Capture (CDC) support for monitoring database changes and building event-driven applications.

๐Ÿ”„ Supported CDC Sources

  • PostgreSQL - LISTEN/NOTIFY based real-time streaming
  • MySQL - Binary log (binlog) streaming for high-performance CDC
  • Oracle - Planned support for Oracle CDC
  • MongoDB - Planned support for MongoDB Change Streams

๐Ÿš€ Key CDC Features

  • Real-time Event Streaming - Instant notification of data changes
  • Multi-table Monitoring - Monitor multiple tables simultaneously
  • Event Filtering - Filter events by operation type (INSERT, UPDATE, DELETE)
  • Low Latency - Optimized for high-performance streaming
  • Automatic Reconnection - Built-in resilience and error handling

๐Ÿ“ Quick CDC Example

// PostgreSQL CDC Example
import "database"
import "json"

fun main():
    // Configure CDC connection
    config = {
        "host": "localhost",
        "port": 5432,
        "database": "mydb",
        "username": "user",
        "password": "pass"
    }

    // Start streaming changes from multiple tables
    database.stream_tables(["users", "orders", "products"], config, fun(event):
        print("Database change detected:")
        print("Table: " + event.table)
        print("Operation: " + event.operation)
        print("Data: " + json.stringify(event.data))

        // Process the change event
        if (event.table == "orders" and event.operation == "INSERT") then:
            // Trigger order processing workflow
            process_new_order(event.data)
        end
    end)
end

๐ŸŽฏ CDC Use Cases

  • Real-time Analytics - Stream data changes to analytics dashboards
  • Event-driven Microservices - Trigger business processes from data changes
  • Data Synchronization - Keep multiple systems in sync
  • Audit Logging - Track all data modifications for compliance
  • Cache Invalidation - Update caches when underlying data changes
  • Search Index Updates - Keep search indexes synchronized with database

๐Ÿ“š Learn More

For detailed CDC implementation guides, configuration options, and advanced examples:

๐Ÿ“– Read CDC Documentation โ†’


๐Ÿ—๏ธ Architecture Overview

Interpreter Architecture

graph TB
    A[Source Code] --> B[Tokenizer/Lexer]
    B --> C[Parser]
    C --> D[Abstract Syntax Tree]
    D --> VM[Bytecode Compiler]
    VM --> E[Bytecode VM]
    D --> TW[Tree-walker Evaluator]
    E --> F[Interpreter Core]
    TW --> F
    F --> G[Runtime Environment]

    %% Core Components
    G --> H[Variable Scopes]
    G --> I[Built-in Dispatcher]
    G --> J[Memory Pools]
    G --> K[Error Handling]

    %% Optimization Layer
    L[Expression Optimizer] --> D
    M[Constant Folder] --> D
    N[Memoization Cache] --> F
    O[String Interning] --> J

    %% Built-in Function Categories
    I --> P[Core / Math / String / Array]
    I --> MOD[Stdlib Module Registry]
    MOD --> M1[json / regex / datetime]
    MOD --> M2[fs / http / database]
    MOD --> M3[fact / cdc / waf]

    %% Memory Management
    J --> W[Array Pools]
    J --> X[Map Pools]
    J --> Y[String Builder Pools]
    J --> Z[Variable Lookup Cache]

    style A fill:#e1f5fe
    style D fill:#f3e5f5
    style E fill:#e8f5e8
    style F fill:#fff3e0
    style G fill:#f0f4c3
    style L fill:#fce4ec
    style I fill:#e0f2f1
    style MOD fill:#e0f2f1
Loading

Memory Management & Optimization

graph TB
    A[Memory Layout Config] --> B[Tagged Values]
    A --> C[Compact Environment]
    A --> D[Cache-Friendly Structures]

    %% Object Pools
    E[Object Pools] --> F[Array Pool]
    E --> G[Map Pool]
    E --> H[String Builder Pool]
    E --> I[AST Node Pool]

    %% Caching Systems
    J[Caching Layer] --> K[Memoization Cache]
    J --> L[Variable Lookup Cache]
    J --> M[Token Cache]
    J --> N[Parser Cache]

    %% Optimization Engines
    O[Optimization] --> P[Expression Optimizer]
    O --> Q[Constant Folder]
    O --> R[Fast Numeric Evaluator]
    O --> S[String Interning]

    %% Performance Monitoring
    T[Performance Monitor] --> U[Operation Tracking]
    T --> V[Memory Leak Detection]
    T --> W[Call Statistics]

    style A fill:#e3f2fd
    style E fill:#f3e5f5
    style J fill:#e8f5e8
    style O fill:#fff3e0
    style T fill:#fce4ec
Loading

Built-in Function System

graph TB
    A[Built-in Dispatcher] --> B[Function Registry]
    B --> C[Argument Validation]
    B --> D[Call Statistics]

    %% Built-in Function Categories
    E[Core Functions] --> F[print, len, typeof, str, int]
    G[Math Functions] --> H[abs, sqrt, pow, sin, cos, round]
    I[String Functions] --> J[substr, split, join, contains, trim]
    K[Array Functions] --> L[range, filter, map, reduce, sort]
    U[Data Structure] --> V[stack, queue, set, heap, graph]
    S[Concurrent] --> T[concurrent_map, concurrent_filter]

    %% Stdlib Modules (via import "name")
    MOD[Stdlib Modules] --> M1[fs โ€” read_file, write_file, mkdir]
    MOD --> M2[http โ€” get, post, tcp_connect, udp_listen]
    MOD --> M3[database โ€” connect, query, stream_tables]
    MOD --> M4[json / regex / datetime]
    MOD --> M5[fact / cdc / waf]

    %% Dispatch Flow
    A --> E
    A --> G
    A --> I
    A --> K
    A --> S
    A --> U
    A --> MOD

    %% Optimization
    W[Fast Path] --> X[Type-specific Handlers]
    W --> Y[Specialized Builtins]
    A --> W

    style A fill:#e0f2f1
    style B fill:#f3e5f5
    style W fill:#fff3e0
Loading

Execution Flow

sequenceDiagram
    participant U as User
    participant M as Main
    participant T as Tokenizer
    participant P as Parser
    participant I as Interpreter
    participant E as Environment

    U->>M: Run uddinlang script.din
    M->>T: Tokenize source code
    T->>P: Token stream
    P->>I: Abstract Syntax Tree
    I->>E: Execute statements
    E->>I: Return values
    I->>M: Execution result
    M->>U: Output/Error
Loading

Component Responsibilities

Component Responsibility
Tokenizer Converts source code into tokens with caching (lexical analysis)
Parser Builds Abstract Syntax Tree from tokens with node pooling
AST Represents program structure in optimized tree form
Evaluator Evaluates expressions with constant folding optimization
Interpreter Core Orchestrates execution flow and manages global state
Runtime Environment Manages variable scopes, I/O streams, and execution context
Built-in Dispatcher Optimized dispatch system for built-in functions
Memory Pools Efficient memory allocation and reuse for arrays, maps, strings
Expression Optimizer Optimizes expressions through constant folding and caching
Memoization Cache Caches function results for pure functions
Variable Lookup Cache Accelerates variable resolution in nested scopes
String Interning Reduces memory usage by reusing identical strings
Performance Monitor Tracks operation counts and detects memory leaks

๐Ÿค Contributing

We welcome contributions! Here's how to get started:

1. Fork & Clone

git clone https://github.com/bonkzero404/uddin-lang.git
cd uddin-lang

2. Create Feature Branch

git checkout -b feature/my-new-feature

3. Make Changes

  • Follow Go coding conventions
  • Add tests for new features
  • Update documentation and examples
  • Ensure all tests pass

4. Submit Pull Request

git commit -m "Add my new feature"
git push origin feature/my-new-feature

About

Uddin-Lang is a modern, interpreted programming language designed with simplicity, expressiveness, and functional programming principles in mind. It combines the best features of dynamic languages with a clean, readable syntax that makes programming enjoyable and productive.

bonkzero404.github.io/uddin-lang/

Resources

Readme
MIT license
Activity

Stars

8 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.