# Lux Weaknesses Discovered During Website Development This document tracks issues and limitations discovered while building the Lux website in Lux. ## Critical Issues ### 1. Module Import System Not Working **Description:** The `import` statement doesn't appear to work for importing standard library modules. **Example:** ```lux import html // Doesn't make html functions available ``` **Workaround:** Functions must be defined in the same file or copied. **Status:** Needs investigation --- ### 2. Parse Error in html.lux (Line 196-197) **Description:** When trying to load files that import the html module, there's a parse error. **Error Message:** ``` Module error: Module error in '
': Parse error: Parse error at 196-197: Unexpected token: \n ``` **Status:** Needs investigation --- ## Minor Issues ### 3. String.replace May Not Exist **Description:** The `escapeHtml` function in html.lux uses `String.replace`, but this function may not be implemented. **Workaround:** Implement character-by-character escaping. **Status:** Needs verification --- ### 4. FileSystem Effect Not Fully Implemented **Description:** For static site generation, we need `FileSystem.mkdir`, `FileSystem.write`, `FileSystem.copy` operations. These may not be fully implemented. **Workaround:** Use Bash commands via scripts. **Status:** Needs verification --- ### 5. List.concat May Have Issues **Description:** The `List.concat` function used in html.lux document generation may not handle nested lists correctly. **Status:** Needs verification --- ## Feature Gaps ### 6. No Built-in Static Site Generation **Description:** There's no built-in way to generate static HTML files from Lux. A static site generator effect or module would be helpful. **Recommendation:** Add a `FileSystem` effect with: - `mkdir(path: String): Unit` - `write(path: String, content: String): Unit` - `copy(src: String, dst: String): Unit` - `readDir(path: String): List` --- ### 7. No Template String Support **Description:** Multi-line strings and template literals (like JavaScript's backticks) would make HTML generation much easier. **Current Approach:** ```lux let html = "
" + content + "
" ``` **Better Approach (not available):** ```lux let html = `
${content}
` ``` **Status:** Feature request --- ### 8. No Markdown Parser **Description:** A built-in Markdown parser would be valuable for documentation sites. **Status:** Feature request --- ## Working Features These features work correctly and can be used for website generation: 1. **String concatenation** - Works with `+` operator 2. **Conditional expressions** - `if/then/else` works 3. **Console output** - `Console.print()` works 4. **Basic types** - `String`, `Int`, `Bool` work 5. **Let bindings** - Variable assignment works 6. **Functions** - Function definitions work --- ## Recommendations ### For Website MVP Since the module system isn't working, the website should be: 1. **Hand-written HTML** (already done in `dist/index.html`) 2. **CSS separate file** (already done in `static/style.css`) 3. **Lux code examples** embedded as text in HTML ### For Future Once these issues are fixed, the website can be: 1. **Generated from Lux** using the components and pages modules 2. **Markdown-based documentation** parsed and rendered by Lux 3. **Live playground** using WASM compilation --- ## Test Results | Feature | Status | Notes | |---------|--------|-------| | String concatenation | ✅ Works | `"<" + tag + ">"` | | Conditionals | ✅ Works | `if x then y else z` | | Console.print | ✅ Works | Basic output | | Module imports | ❌ Broken | Parse errors | | Html module | ❌ Blocked | Depends on imports | | FileSystem | ❓ Unknown | Not tested | --- ## Date Log | Date | Finding | |------|---------| | 2026-02-16 | Module import system not working, parse error at line 196-197 in html.lux |