Files
lux/website/lux-site/LUX_WEAKNESSES.md
Brandon Lucas 552e7a4972 feat: create Lux website with sleek/noble aesthetic
Website design:
- Translucent black (#0a0a0a) with gold (#d4af37) accents
- Strong serif typography (Playfair Display, Source Serif Pro)
- Glass-morphism cards with gold borders
- Responsive layout with elegant animations

Content:
- Landing page with hero, code demo, value props, benchmarks
- Effects-focused messaging ("No surprises. No hidden side effects.")
- Performance benchmarks showing Lux matches C
- Quick start guide

Technical:
- Added HTML rendering functions to stdlib/html.lux
- Created Lux-based site generator (blocked by module import issues)
- Documented Lux weaknesses discovered during development:
  - Module import system not working
  - FileSystem effect incomplete
  - No template string support

The landing page HTML/CSS is complete and viewable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 06:41:49 -05:00

3.9 KiB

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:

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 '<main>': 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<String>

7. No Template String Support

Description: Multi-line strings and template literals (like JavaScript's backticks) would make HTML generation much easier.

Current Approach:

let html = "<div class=\"" + className + "\">" + content + "</div>"

Better Approach (not available):

let html = `<div class="${className}">${content}</div>`

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