From 2dee134bc3308b5b7bb10e589082feb94464e922 Mon Sep 17 00:00:00 2001 From: Brad Byrd Date: Mon, 23 Jun 2025 07:46:55 -0500 Subject: [PATCH 1/5] Add Claude documentation and permission settings Creates two new files to improve Claude AI integration: 1. `.claude/settings.local.json` - Configures permissions for Claude to use Bash commands 'find' and 'ls' when working with this repository 2. `CLAUDE.md` - Comprehensive guidance document for Claude Code when working with this repository, including: - Project overview of WFL (WebFirst Language) - Development directives and critical rules - Standard debugging procedures - Documentation and testing requirements - CLI flag reference - Architecture overview - Implementation notes - Current focus areas --- .claude/settings.local.json | 9 ++ CLAUDE.md | 174 ++++++++++++++++++++++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 .claude/settings.local.json create mode 100644 CLAUDE.md diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 00000000..0aa94d55 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(find:*)", + "Bash(ls:*)" + ], + "deny": [] + } +} \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..8fed82c9 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,174 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +WFL (WebFirst Language) is a natural language programming language implemented in Rust. It features intuitive syntax like "store x as 5" and "display 'Hello'", with static typing, async support, and comprehensive development tooling. + +## Memory Bank Context + +This project uses a comprehensive memory bank system located in `.kilocode/rules/memory-bank/`. Always consult these files for detailed context: +- `architecture.md` - System design and processing pipeline +- `context.md` - Development history and key decisions +- `product.md` - Features, roadmap, and user experience +- `tech.md` - Implementation details and technical specifications + +## Prime Development Directives + +1. **Test Programs MUST Pass**: After ANY code change, run ALL programs in TestPrograms/ and ensure they execute successfully +2. **Backward Compatibility is Sacred**: NEVER break existing WFL programs. Maintain 100% compatibility with all syntax +3. **User Experience First**: Error messages must be helpful, clear, and actionable +4. **Performance Matters**: Optimize for speed without sacrificing clarity or correctness +5. **Document Your Journey**: Create detailed Dev Diary entries for all significant changes + +## Critical Development Rules + +### Backward Compatibility Commitment +**NEVER BREAK EXISTING WFL PROGRAMS**. This is the #1 rule. Before merging any change: +1. Run ALL test programs in TestPrograms/ +2. Verify identical behavior for existing syntax +3. Add new tests for new features +4. Document any edge cases + +### Development Commands +```bash +# Build the project +cargo build --release + +# Run a WFL program +cargo run -- program.wfl + +# Run with debugging +cargo run -- program.wfl --debug > debug.txt 2>&1 + +# Run all tests +cargo test + +# Lint a program +cargo run -- --lint program.wfl + +# Analyze for issues +cargo run -- --analyze program.wfl + +# Auto-fix formatting +cargo run -- --fix program.wfl --in-place + +# Start REPL +cargo run + +# Check code quality +cargo fmt --all -- --check +cargo clippy --all-targets --all-features -- -D warnings +``` + +## Standard Debug Procedure + +When debugging ANY issue: +1. Create minimal test case in TestPrograms/ +2. Run with debug flag: `cargo run -- test.wfl --debug > test_debug.txt 2>&1` +3. Check debug output for execution trace +4. Run static analyzer: `cargo run -- --analyze test.wfl` +5. Fix issues and verify ALL existing tests still pass + +## Documentation Requirements + +Before making changes: +1. Read `Docs/wfl-spec.md` for language specification +2. Check module-specific docs in `Docs/` +3. Review recent Dev Diary entries +4. Consult memory bank files in `.kilocode/rules/memory-bank/` + +After making changes: +1. Update relevant documentation +2. Create Dev Diary entry with implementation details +3. Add/update tests in appropriate locations + +## Testing Requirements + +**ALL test programs in TestPrograms/ MUST pass**. Test categories: +- Basic syntax tests (variables, loops, conditions) +- Async/await tests +- Error handling tests +- Standard library tests +- Performance benchmarks + +Run specific test: `cargo test test_name` +Run module tests: `cargo test --package wfl --lib module_name` + +## Development Workflow + +1. **Understand the task**: Read all relevant documentation +2. **Check existing code**: Search for similar patterns +3. **Write tests first**: Add to TestPrograms/ or unit tests +4. **Implement feature**: Follow existing code style +5. **Run all tests**: `cargo test` and TestPrograms/ +6. **Check quality**: `cargo fmt` and `cargo clippy` +7. **Update docs**: Modify relevant .md files +8. **Create Dev Diary**: Document your implementation + +## CLI Flag Reference + +| Flag | Description | Example | +|------|-------------|---------| +| `--lex` | Output lexer tokens only | `cargo run -- --lex program.wfl` | +| `--parse` | Output AST only | `cargo run -- --parse program.wfl` | +| `--lint` | Check code style | `cargo run -- --lint program.wfl` | +| `--analyze` | Static analysis | `cargo run -- --analyze program.wfl` | +| `--fix` | Auto-format code | `cargo run -- --fix program.wfl` | +| `--in-place` | Modify file directly | `cargo run -- --fix program.wfl --in-place` | +| `--check` | Dry run for --fix | `cargo run -- --fix program.wfl --check` | +| `--debug` | Enable debug output | `cargo run -- --debug program.wfl` | +| `--config` | Specify config file | `cargo run -- --config custom.wflcfg program.wfl` | +| `--time` | Show execution time | `cargo run -- --time program.wfl` | +| `-v, --version` | Show version info | `cargo run -- --version` | + +## Architecture Overview + +``` +Input (.wfl) → Lexer → Parser → Analyzer → Type Checker → Interpreter → Output + ↓ ↓ ↓ ↓ ↓ + Tokens AST Validated Type Info Execution + AST Results +``` + +Key components: +- **Lexer**: Token generation with Logos +- **Parser**: Recursive descent, indentation-aware +- **Analyzer**: Semantic validation, dead code detection +- **Type Checker**: Static type analysis +- **Interpreter**: Direct AST execution with async support +- **Stdlib**: core, math, text, list, time, pattern modules + +## Key Implementation Notes + +### Error Handling +- Use `InterpreterError` for runtime errors +- Include source location via spans +- Provide helpful error messages with context + +### Async Operations +- All I/O operations are async (web.get, file operations) +- Use `await` keyword in WFL code +- Tokio runtime handles execution + +### Type System +- Static typing with inference +- Types: text, number, boolean, list, null, any +- Function types for callbacks +- Pattern matching with regex support + +### Memory Management +- Variables stored in Environment HashMap +- Scope management with push/pop +- Automatic cleanup on scope exit + +## Current Focus Areas (June 2025) + +1. **Testing**: Expanding test coverage and TestPrograms +2. **Performance**: Optimizing lexer and parser +3. **Error Messages**: Improving clarity and helpfulness +4. **Documentation**: Keeping all docs up-to-date +5. **Stability**: Ensuring backward compatibility + +Remember: The goal is to make programming accessible while maintaining professional-grade tooling and performance. \ No newline at end of file From a0d08884d878a5e6b37b0132dc3ee40227e5af65 Mon Sep 17 00:00:00 2001 From: Brad Byrd Date: Mon, 23 Jun 2025 07:59:39 -0500 Subject: [PATCH 2/5] Modernize README with improved formatting and content Completely revises the README to present WFL in a more professional and accessible format: - Updates version number and project status badges - Improves feature descriptions and documentation structure - Adds cleaner code examples and better visual hierarchy - Reorganizes tooling and documentation sections - Introduces clearer commitment to backward compatibility - Simplifies language overview while maintaining comprehensiveness The new README maintains core information about the project while making it more approachable for new users. --- README.md | 618 +++++++++++++++++++++++------------------------------- 1 file changed, 265 insertions(+), 353 deletions(-) diff --git a/README.md b/README.md index a46e7c54..ac852401 100644 --- a/README.md +++ b/README.md @@ -1,337 +1,280 @@ -# WFL (WebFirst Language) v0.1.0 +# WFL (WebFirst Language) -**⚠️ IMPORTANT: This software is alpha quality and should not be relied on for production use. ⚠️** +
+ Version + Status + License + Rust Version +
-WFL is a programming language designed to be readable and intuitive, using natural language constructs to lower the barrier to entry for new programmers while still providing powerful features for experienced developers. +
+

Programming that reads like plain English

+

Bridge the gap between natural language and code

+
-## Overview +--- -WFL features a syntax that resembles English sentences, indentation-based structure, and modern programming concepts like containers (classes), actions (functions), and collections. The language is designed to be approachable for beginners while still being powerful enough for real-world applications. +## ⚠️ Alpha Software Notice -## Project Status +**This software is in alpha stage and should not be used in production environments.** We're actively developing and improving WFL. Your feedback and contributions are welcome! -The WFL compiler is currently in active development with most core components complete and stable. Here's the current status: +## 🎯 What is WFL? -- ✅ **Lexer**: Complete - Converts source code into tokens with full support for natural language constructs -- ✅ **Parser**: Complete - Transforms tokens into an Abstract Syntax Tree (AST) - - ✅ Enhanced to support natural language function calls (e.g., `typeof of value`) - - ✅ **Critical Stability Fixes (May 2025)**: Comprehensive end token handling prevents infinite loops -- ✅ **Semantic Analyzer**: Complete - Analyzes the AST for semantic correctness -- ✅ **Type Checker**: Complete - Performs static type analysis on the AST -- ✅ **Standard Library**: Complete - Core functions, math, text, and list operations -- ✅ **Language Server Protocol (LSP)**: Complete - Provides editor integration with real-time diagnostics and auto-completion -- ✅ **Interpreter**: Complete - Executes the AST directly - - ✅ Supports all basic language features - - ✅ Includes runtime error handling and reporting - - ✅ HTTP GET/POST support via Reqwest - - ✅ Database integration (SQLite, MySQL, PostgreSQL) via SQLx - - ✅ Try/when/otherwise exception handling - - ✅ **Asynchronous operations support** - Full Tokio integration with async/await -- ✅ **Error Reporting System**: Complete - Comprehensive diagnostics with actionable messages using codespan-reporting -- ✅ **Linter and Code Fixer**: Complete - Code quality tools with CLI integration -- ✅ **Enhanced Logging System**: Complete - Standardized debug output with exec_trace! macro -- 🔄 **Bytecode Compiler**: Planned - Will convert the AST into bytecode instructions -- 🔄 **Virtual Machine**: Planned - Will execute bytecode instructions +WFL (WebFirst Language) is a programming language designed to make coding more intuitive and accessible. Instead of abstract symbols and cryptic syntax, WFL uses natural English-like constructs that anyone can read and understand. -## Recent Major Improvements (May 2025) - -### Parser Stability Enhancement -- **Fixed critical infinite loop issue**: Comprehensive end token handling for all constructs (`end action`, `end check`, `end for`, `end count`, etc.) -- **Enhanced error recovery**: Improved synchronization and orphaned token consumption -- **Resolved borrow checker issues**: Stable compilation with proper token lookahead -- **Added comprehensive logging**: Better debugging and execution tracing - -### Debug Output Refactoring -- **Standardized logging system**: All debug output now uses `exec_trace!` macro -- **Clean separation**: Program output no longer polluted by debug messages -- **Memory optimization**: Adjusted thresholds while maintaining efficiency -- **Enhanced traceability**: Improved execution flow analysis - -## Current Capabilities - -WFL now supports: - -- **Asynchronous Programming**: Full async/await support with Tokio runtime -- **Network Operations**: HTTP requests with Reqwest integration -- **Database Access**: SQLite, MySQL, and PostgreSQL support via SQLx -- **File I/O**: Comprehensive file operations with async support -- **Natural Language Syntax**: English-like constructs for improved readability -- **Type Safety**: Static type checking with intelligent type inference -- **Error Handling**: Try/when/otherwise constructs for graceful error management -- **Real-time Development**: LSP server provides instant feedback in editors - -## Current Limitations - -- The `wait for ... and ...` construct executes sequentially (true concurrency planned for future release) -- The `open file` command creates the file if it doesn't exist (dedicated `create file` syntax planned) - -## Execution Pipeline - -All runs are type-checked and semantically analyzed by default. This ensures that scripts are validated for semantic correctness and type safety before execution, preventing many common runtime errors. +```wfl +store greeting as "Hello, World!" +display greeting -## AI-Assisted Development +check if 5 is greater than 3: + display "Math works!" +otherwise: + display "Something is wrong with the universe." +end check -This project is developed with the assistance of AI: +count from 1 to 5: + display "Counting: " with the current count +end count +``` -- **Devin.ai**: Primary AI developer responsible for core implementation -- **ChatGPT (GPT-o3)**: Assisted with code reviews and optimization -- **Claude (via Cline)**: Assisted with documentation and architectural design -- **Grok**: Indirectly contributed to the project through knowledge base +## ✨ Key Features -The combination of AI assistance with human oversight has allowed for rapid development while maintaining high code quality and documentation standards. +- **📖 Natural Language Syntax**: Write code that reads like English sentences +- **🚀 Modern Async Support**: Built-in async/await for concurrent operations +- **🛡️ Type Safety**: Static type checking with intelligent inference +- **🌐 Web-First Design**: Native HTTP and database support +- **🎨 Developer Experience**: Comprehensive tooling and real-time error checking +- **♻️ Backward Compatibility**: Your code will always work with future versions -## Getting Started +## 🚀 Quick Start ### Prerequisites -- Rust (latest stable version) +- Rust 1.75 or later - Cargo (comes with Rust) ### Installation -1. Clone the repository: - ``` - git clone https://github.com/logbie/wfl.git - cd wfl - ``` +```bash +# Clone the repository +git clone https://github.com/logbie/wfl.git +cd wfl -2. Build the project: - ``` - cargo build --release - ``` +# Build the project +cargo build --release -### Usage +# Add to PATH (optional) +export PATH="$PATH:$(pwd)/target/release" +``` -To run a WFL program: +### Your First Program -``` -cargo run -- path/to/your/program.wfl -``` +Create a file called `hello.wfl`: -Or, after building: +```wfl +store name as "Developer" +display "Welcome to WFL, " with name with "!" +// Using async operations +try: + wait for open url "https://api.github.com/zen" and read response + display "GitHub says: " with response +when error: + display "Could not fetch wisdom from GitHub" +end try ``` -./target/release/wfl path/to/your/program.wfl + +Run it: + +```bash +wfl hello.wfl ``` -### Development Tools +## 🛠️ Development Tools -WFL includes comprehensive development tooling: +WFL comes with a comprehensive suite of development tools: -```bash -# Run with real-time error checking -wfl --interactive your_script.wfl +### 🔍 Code Quality -# Check code quality -wfl --lint your_script.wfl +```bash +# Check code style and conventions +wfl --lint your_program.wfl # Perform static analysis -wfl --analyze your_script.wfl +wfl --analyze your_program.wfl # Auto-format and fix code -wfl --fix your_script.wfl --in-place +wfl --fix your_program.wfl --in-place -# Validate configuration -wfl --configCheck +# View changes before applying +wfl --fix your_program.wfl --diff ``` -## Standard Library - -WFL includes a comprehensive standard library with the following modules: +### 🐛 Debugging -### Core Module -- `print`: Outputs text to the console -- `typeof`: Returns the type of a value as text -- `isnothing`: Checks if a value is nothing (null) +```bash +# Run with debug output +wfl --debug your_program.wfl > debug.txt 2>&1 -### Math Module -- `abs`: Returns the absolute value of a number -- `round`, `floor`, `ceil`: Rounding functions -- `random`: Generates a random number between 0 and 1 -- `clamp`: Constrains a value between a minimum and maximum +# Show execution timing +wfl --time your_program.wfl -### Text Module -- `length`: Returns the length of a text string -- `touppercase`, `tolowercase`: Case conversion functions -- `contains`: Checks if a text string contains another string -- `substring`: Extracts a portion of a text string +# Output tokens or AST +wfl --lex your_program.wfl +wfl --parse your_program.wfl +``` -### List Module -- `length`: Returns the number of items in a list -- `push`: Adds an item to the end of a list -- `pop`: Removes and returns the last item from a list -- `contains`: Checks if a list contains a specific item -- `indexof`: Returns the position of an item in a list +### 📝 Editor Support -### I/O and Network Module -- `open file`: Asynchronous file operations -- `open url`: HTTP requests with full async support -- `wait for`: Async/await operations for concurrent programming +WFL includes a Language Server Protocol (LSP) implementation for real-time error checking and auto-completion in your favorite editor. -## Example WFL Program +**VSCode Extension**: +```bash +# Install the VSCode extension +scripts/install_vscode_extension.ps1 +``` +Features: +- Syntax highlighting +- Real-time error checking +- Auto-completion +- Go-to definition +- Hover documentation + +## 📚 Language Overview + +### Variables and Types + +```wfl +// Simple variable assignment +store age as 25 +store name as "Alice" +store pi as 3.14159 +store is active as true +store items as [1, 2, 3, 4, 5] + +// Type inference +display typeof of age // "number" +display typeof of name // "text" +display typeof of items // "list" ``` -store greeting as "Hello, World!" -display greeting -check if 5 is greater than 3: - display "Math works!" +### Control Flow + +```wfl +// Conditional statements +check if age is greater than 18: + display "You can vote!" +otherwise check if age is 18: + display "You just became eligible to vote!" otherwise: - display "Something is wrong with the universe." + display "You'll be able to vote in the future" end check -count from 1 to 5: - display "Counting: " with the current count +// Loops +count from 1 to 10: + display "Number: " with the current count end count -// Using standard library functions -store my list as [1, 2, 3, 4, 5] -display "List length: " with length of my list -display "Type of list: " with typeof of my list - -// Asynchronous operations -try: - wait for open url "https://api.example.com/data" and read response - display "Data received: " with response -when error: - display "Network error: " with error message -end try -``` - -## Project Structure - -- `src/`: Source code - - `lexer/`: Lexical analyzer with Logos integration - - `parser/`: Parser and AST with comprehensive error handling - - `analyzer/`: Semantic analyzer - - `typechecker/`: Static type checker - - `interpreter/`: Runtime interpreter with Tokio async support - - `stdlib/`: Standard library implementation - - `logging/`: Structured logging system with exec_trace! macro - - `diagnostics/`: Error diagnostic and reporting system using codespan-reporting - - `debug_report/`: Debugging tools and runtime error reports -- `Docs/`: Comprehensive documentation - - `wfl-spec.md`: Language specification - - `wfl-foundation.md`: Design principles - - `wfl-error.md`: Error handling philosophy - - `wfl-staticTypeChecker.md`: Type system design - - `wfl-interpretor.md`: Interpreter design - - `error_catalog.md`: Comprehensive error message documentation - - `implementation_progress_*.md`: Implementation status reports -- `Test Programs/`: Example WFL programs and test cases - - Various test scripts demonstrating language features - - `error_examples/`: Sample scripts demonstrating different error types -- `wfl-lsp/`: Language Server Protocol implementation for editor integration -- `Tools/`: Utility scripts for development and deployment - - `launch_msi_build.py`: MSI build launcher with version management - - `wfl_config_checker.py`: Configuration validation tool - - `rust_loc_counter.py`: Statistics for Rust code - - `wfl_md_combiner.py`: Markdown documentation combiner -- `vscode-wfl/`: VSCode extension for WFL syntax highlighting and LSP integration - -## Error Reporting and Diagnostics - -WebFirst Language includes a comprehensive error reporting system that provides clear, actionable error messages to help developers quickly identify and fix issues: - -- **User-Friendly Error Messages**: Inspired by Elm's approach to error messages, using codespan-reporting for professional formatting -- **Source Context**: Error messages include the relevant source code snippets with precise highlighting -- **Actionable Suggestions**: For common errors, WebFirst Language suggests specific fixes and corrections -- **Unified Error System**: Consistent error formatting across all error types (syntax, semantic, type, runtime) -- **Contextual Hints**: Special handling for common mistakes like missing keywords in variable declarations -- **Enhanced Debugging**: Standardized exec_trace! macro for consistent debug output - -## Code Quality Suite - -WebFirst Language includes a built-in code quality suite with three main components: - -### Linter (`--lint`) - -The linter checks your code for style issues and best practices: - -```bash -wfl --lint your_script.wfl +for each item in items: + display "Processing: " with item +end for ``` -It enforces: -- Naming conventions (snake_case for variables and actions) -- 4-space indentation -- Consistent keyword casing (lowercase) -- No trailing whitespace -- Line length limits (default: 100 characters) -- Nesting depth limits (default: 5 levels) +### Actions (Functions) -### Static Analyzer (`--analyze`) +```wfl +action greet with name: + display "Hello, " with name with "!" +end action -The static analyzer performs deeper code analysis: +action calculate area with width and height: + store result as width times height + return result +end action -```bash -wfl --analyze your_script.wfl +// Using actions +call greet with "World" +store room area as calculate area with 10 and 20 ``` -It detects: -- Unused variables and actions -- Unreachable code and dead branches -- Variable shadowing -- Inconsistent return paths - -### Code Fixer (`--fix`) +### Async Operations -The code fixer automatically formats your code and performs safe refactorings: +```wfl +// Concurrent web requests +wait for: + open url "https://api.example.com/data1" and read response1 + open url "https://api.example.com/data2" and read response2 +end wait -```bash -# Print fixed code to stdout -wfl --fix your_script.wfl - -# Overwrite the file with fixed code -wfl --fix your_script.wfl --in-place +display "Got both responses!" -# Show a diff of the changes -wfl --fix your_script.wfl --diff +// File operations +wait for open file "data.txt" and read contents +display "File contents: " with contents ``` -The fixer performs the following operations: -- Pretty-prints the code with consistent formatting -- Renames identifiers to follow snake_case convention -- Removes dead code -- Simplifies boolean expressions +### Error Handling -#### Recent Improvements +```wfl +try: + store result as risky operation() + display "Success: " with result +when error: + display "An error occurred: " with error message +otherwise: + display "Operation completed" +end try +``` -- Fixed linter CLI behavior to allow `--lint --fix` combination -- Removed unconditional linter run during normal execution -- Updated CLI help text to reflect new flag behavior -- Added support for combined flags (e.g., `--lint --fix --diff`) -- Improved reporting methods for better fixer summaries +## 📦 Standard Library -## Logging and Debugging +WFL includes a comprehensive standard library: -WFL includes structured logging and automatic debug report generation to help with troubleshooting. +### Core Functions +- `print(text)` - Output text +- `typeof(value)` - Get type of value +- `isnothing(value)` - Check if value is null -### Enhanced Logging System +### Math Module +- `abs(number)` - Absolute value +- `round(number)` - Round to nearest integer +- `floor(number)` - Round down +- `ceil(number)` - Round up +- `random()` - Random number 0-1 +- `clamp(value, min, max)` - Constrain value -- **Standardized Debug Output**: All debug messages use the `exec_trace!` macro -- **Clean Separation**: Program output is separate from debugging information -- **Centralized Control**: Debug verbosity controlled through configuration -- **Memory Optimized**: Efficient logging with minimal overhead +### Text Module +- `length(text)` - Get text length +- `touppercase(text)` - Convert to uppercase +- `tolowercase(text)` - Convert to lowercase +- `contains(text, search)` - Check if contains +- `substring(text, start, end)` - Extract substring -### Configuration +### List Module +- `length(list)` - Get list size +- `push(list, item)` - Add item to end +- `pop(list)` - Remove last item +- `contains(list, item)` - Check if contains +- `indexof(list, item)` - Find item position -These features can be configured in a `.wflcfg` file in the same directory as your script: +### Time Module +- `time.now()` - Current timestamp +- `time.sleep(seconds)` - Pause execution +- `time.format(timestamp, format)` - Format time -``` -# Enable structured logging (default: false) -logging_enabled = true +## ⚙️ Configuration -# Set log level: debug, info, warn, error (default: info) -log_level = debug +Create a `.wflcfg` file in your project directory: -# Enable automatic debug reports on errors (default: true) +```ini +# Execution settings +timeout_seconds = 60 +logging_enabled = false debug_report_enabled = true +log_level = info -# Set execution timeout in seconds (default: 60) -timeout_seconds = 120 - -# Code quality settings +# Code style settings max_line_length = 100 max_nesting_depth = 5 indent_size = 4 @@ -340,128 +283,97 @@ trailing_whitespace = false consistent_keyword_case = true ``` -### Configuration Validation - -WFL provides tools to validate and fix configuration files: - +Validate configuration: ```bash -# Check configuration files for issues +# Check for issues wfl --configCheck -# Check and automatically fix configuration issues +# Auto-fix problems wfl --configFix ``` -These commands validate `.wflcfg` files against expected settings and types. The `--configCheck` flag reports issues without making changes, while `--configFix` attempts to automatically correct problems. +## 🏗️ Architecture -Configuration files are searched in the following order: -1. Global configuration (environment variable `WFL_GLOBAL_CONFIG_PATH` or platform default) - - Linux/macOS: `/etc/wfl/wfl.cfg` - - Windows: `C:\wfl\config` -2. Local configuration (`.wflcfg` in the current directory) +WFL follows a traditional compiler architecture with modern enhancements: -Local settings override global ones for overlapping keys. - -### Logging - -When enabled, logs are written to both the console (info level and above) and to a `wfl.log` file (all levels). -Each log entry includes a timestamp, message, source location, and elapsed time. - -### Debug Reports - -When a runtime error occurs, WFL automatically generates a `