From fe985c96f560c8995377548136888b7ebf083e8a Mon Sep 17 00:00:00 2001 From: Brandon Lucas Date: Mon, 16 Feb 2026 06:59:16 -0500 Subject: [PATCH] feat: redesign website to showcase all Lux capabilities - New tagline: "The Language That Changes Everything" - Highlight 6 key features: algebraic effects, behavioral types, schema evolution, dual compilation, native performance, batteries included - Add sections for behavioral types (is pure, is total, is idempotent) - Add section for schema evolution with migration examples - Add section for dual compilation (C and JavaScript) - Add "Why Lux?" comparisons (vs Haskell, Rust, Go, TypeScript, Elm, Zig) - Add built-in effects showcase (Console, File, Http, Sql, etc.) - Add developer tools section (package manager, LSP, REPL, etc.) - Fix navigation to use anchor links (single-page site) - Update footer to link to GitHub docs/examples - Add README with local testing instructions Co-Authored-By: Claude Opus 4.5 --- website/lux-site/README.md | 72 ++++++ website/lux-site/dist/index.html | 403 ++++++++++++++++++++++++------- 2 files changed, 393 insertions(+), 82 deletions(-) create mode 100644 website/lux-site/README.md diff --git a/website/lux-site/README.md b/website/lux-site/README.md new file mode 100644 index 0000000..5075b43 --- /dev/null +++ b/website/lux-site/README.md @@ -0,0 +1,72 @@ +# Lux Website + +## Testing Locally + +The website is a static HTML site. To test it with working navigation: + +### Option 1: Python (simplest) +```bash +cd website/lux-site/dist +python -m http.server 8000 +# Open http://localhost:8000 +``` + +### Option 2: Node.js +```bash +npx serve website/lux-site/dist +# Open http://localhost:3000 +``` + +### Option 3: Nix +```bash +nix-shell -p python3 --run "cd website/lux-site/dist && python -m http.server 8000" +``` + +### Option 4: Direct file (limited) +Open `website/lux-site/dist/index.html` directly in a browser. Navigation links will work since they're anchor links (`#features`, `#effects`, etc.), but this won't work for multi-page setups. + +## Structure + +``` +website/lux-site/ +├── dist/ +│ ├── index.html # Main website +│ └── static/ +│ └── style.css # Styles +├── src/ +│ ├── components.lux # Lux components (for future generation) +│ ├── pages.lux # Page templates +│ └── generate.lux # Site generator +├── LUX_WEAKNESSES.md # Issues found during development +└── README.md # This file +``` + +## Building with Lux + +Once the module system is working (fixed!), you can generate the site: + +```bash +./target/release/lux website/lux-site/src/generate.lux +``` + +The HTML module is now functional and can render HTML from Lux code: + +```lux +import stdlib/html + +let page = html.div([html.class("container")], [ + html.h1([], [html.text("Hello!")]) +]) + +Console.print(html.render(page)) +// Output:

Hello!

+``` + +## Deployment + +For GitHub Pages or any static hosting: + +```bash +# Copy dist folder to your hosting +cp -r website/lux-site/dist/* /path/to/deploy/ +``` diff --git a/website/lux-site/dist/index.html b/website/lux-site/dist/index.html index ea30368..712d421 100644 --- a/website/lux-site/dist/index.html +++ b/website/lux-site/dist/index.html @@ -3,8 +3,8 @@ - Lux - Functional Programming with First-Class Effects - + Lux - The Language That Changes Everything + @@ -12,12 +12,12 @@ @@ -31,64 +31,205 @@ ╩═╝╚═╝╩ ╩

- Functional Programming
- with First-Class Effects + The Language That
+ Changes Everything

- Effects are explicit. Types are powerful. Performance is native. + Algebraic effects. Behavioral types. Schema evolution.
+ Compile to native C or JavaScript. One language, every platform.

- -
+ +
-
-
-
fn processOrder(
-  order: Order
-): Receipt
-  with {Database, Email} =
-{
-  let saved = Database.save(order)
-  Email.send(
-    order.customer,
-    "Order confirmed!"
-  )
-  Receipt(saved.id)
-}
+

Not Just Another Functional Language

+

Lux solves problems other languages can't even express

+
+
+

ALGEBRAIC EFFECTS

+

Side effects in the type signature. Swap handlers for testing. No dependency injection frameworks.

-
-

The type signature tells you everything

-
    -
  • Queries the database
  • -
  • Sends an email
  • -
  • Returns a Receipt
  • -
-

No surprises. No hidden side effects.

+
+

BEHAVIORAL TYPES

+

Prove functions are pure, total, deterministic, or idempotent. The compiler verifies it.

+
+
+

SCHEMA EVOLUTION

+

Built-in type versioning with automatic migrations. Change your data types safely.

+
+
+

DUAL COMPILATION

+

Same code compiles to native C (via GCC) or JavaScript. Server and browser from one source.

+
+
+

NATIVE PERFORMANCE

+

Beats Rust and Zig on recursive benchmarks. Zero-cost effect abstraction via evidence passing.

+
+
+

BATTERIES INCLUDED

+

Package manager, LSP, REPL, debugger, formatter, test runner. All built in.

- -
+ +
-
+

Effects: The Core Innovation

+

Every side effect is tracked in the type signature

+
+
+
fn processOrder(
+  order: Order
+): Receipt
+  with {Sql, Http, Console} =
+{
+  let saved = Sql.execute(db,
+    "INSERT INTO orders...")
+  Http.post(webhook, order)
+  Console.print("Order {order.id} saved")
+  Receipt(saved.id)
+}
+
+
+

The signature tells you everything:

+
    +
  • Sql — Touches the database
  • +
  • Http — Makes network calls
  • +
  • Console — Prints output
  • +
+

No surprises. No hidden side effects. Ever.

+
+
+
+
+ + +
+
+

Testing Without Mocks or DI Frameworks

+

Swap effect handlers at test time. Same code, different behavior.

+
+
+
// Production: real database, real HTTP
+run processOrder(order) with {
+  Sql -> postgresHandler,
+  Http -> realHttpClient,
+  Console -> stdoutHandler
+}
+
+
+
// Test: in-memory DB, captured calls
+run processOrder(order) with {
+  Sql -> inMemoryDb,
+  Http -> captureRequests,
+  Console -> devNull
+}
+
+
+

No Mockito. No dependency injection. Just swap the handlers.

+
+
+ + +
+
+

Behavioral Types: Compile-Time Guarantees

+

Prove properties about your functions. The compiler enforces them.

+
+
// The compiler verifies these properties
+
+fn add(a: Int, b: Int): Int
+  is pure is commutative = a + b
+
+fn factorial(n: Int): Int
+  is total = if n <= 1 then 1 else n * factorial(n - 1)
+
+fn processPayment(p: Payment): Result
+  is idempotent = // Safe to retry on failure
+  ...
+
+fn hash(data: Bytes): Hash
+  is deterministic = // Same input = same output
+  ...
+
+
-

EFFECTS

-

Side effects are tracked in the type signature. Know exactly what every function does.

+

is pure

+

No side effects. Safe to memoize.

-

TYPES

-

Full type inference with algebraic data types. Catch bugs at compile time.

+

is total

+

Always terminates. No infinite loops.

-

PERFORMANCE

-

Compiles to native C via gcc. Matches C performance, beats Rust and Zig.

+

is idempotent

+

Run twice = run once. Safe for retries.

+
+
+
+
+ + +
+
+

Schema Evolution: Safe Data Migrations

+

Built-in type versioning. No more migration headaches.

+
+
type User @v1 { name: String }
+
+type User @v2 {
+  name: String,
+  email: String,
+  from @v1 = {
+    name: old.name,
+    email: "unknown@example.com"
+  }
+}
+
+type User @v3 {
+  firstName: String,
+  lastName: String,
+  email: String,
+  from @v2 = {
+    firstName: String.split(old.name, " ").head,
+    lastName: String.split(old.name, " ").tail,
+    email: old.email
+  }
+}
+
+

Load old data with new code. The compiler ensures migration paths exist.

+
+
+ + +
+
+

One Language, Every Platform

+

Compile to native C or JavaScript from the same source

+
+
+
# Compile to native binary (via GCC)
+lux compile server.lux
+./server  # Runs natively
+
+# Compile to JavaScript
+lux compile client.lux --target js
+node client.js  # Runs in Node/browser
+
+
+

Same code, different targets:

+
    +
  • Native C — Maximum performance, deployable anywhere
  • +
  • JavaScript — Browser apps, Node.js servers
  • +
  • Shared code — Validation, types, business logic
  • +
@@ -97,7 +238,7 @@
-

Performance

+

Native Performance

fib(35) benchmark — verified with hyperfine

@@ -129,42 +270,96 @@ 47.0ms
-

- See full methodology → +

+ Zero-cost effects via evidence passing — O(1) handler lookup

- -
+ +
-

Testing Without Mocks

-

Swap effect handlers at test time. Same code, different behavior.

+

Built-in Effects

+

Everything you need, ready to use

+
+
+

Console

+

print, readLine, readInt

+
+
+

File

+

read, write, exists, listDir

+
+
+

Http

+

get, post, put, delete

+
+
+

HttpServer

+

listen, respond, routing

+
+
+

Sql

+

query, execute, transactions

+
+
+

Process

+

exec, env, args, exit

+
+
+

Random

+

int, float, bool

+
+
+

Time

+

now, sleep

+
+
+
+
+ + +
+
+

Developer Experience

+

Modern tooling, built-in

-
// Production
-run processOrder(order) with {
-  Database -> postgresDb,
-  Email -> smtpServer
-}
+
# Package manager
+lux pkg init myproject
+lux pkg add json-parser
+lux pkg install
+
+# Development tools
+lux fmt          # Format code
+lux check        # Type check
+lux test         # Run tests
+lux watch app.lux # Hot reload
+
+# LSP for your editor
+lux lsp          # Start language server
-
-
// Testing
-run processOrder(order) with {
-  Database -> inMemoryDb,
-  Email -> collectEmails
-}
+
+

Everything included:

+
    +
  • Package Manager — Git repos, local paths, registry
  • +
  • LSP — VS Code, Neovim, Emacs, Helix
  • +
  • REPL — Interactive exploration
  • +
  • Debugger — Step through code
  • +
  • Formatter — Consistent style
  • +
  • Test Runner — Built-in test effect
  • +
-
+

Get Started

-
-
# Install via Nix
+                
+
# Install via Nix (recommended)
 nix run github:luxlang/lux
 
 # Or build from source
@@ -173,9 +368,55 @@ cd lux && nix develop
 cargo build --release
 
 # Start the REPL
-./target/release/lux
+./target/release/lux + +# Run a file +./target/release/lux hello.lux + +# Compile to native binary +./target/release/lux compile app.lux --run
+
+
+
// hello.lux
+fn main(): Unit with {Console} = {
+  Console.print("Hello, Lux!")
+}
+
+run main() with {}
+
+
+
+ + +
+
+

Why Lux?

+
+
+

vs Haskell

+

Algebraic effects instead of monads. Same power, clearer code. Weeks to learn, not months.

+
+
+

vs Rust

+

No borrow checker to fight. Automatic memory management. Still native performance.

+
+
+

vs Go

+

Real type safety. Pattern matching. No nil panics. Effects track what code does.

+
+
+

vs TypeScript

+

Sound type system. Native compilation. Effects are tracked, not invisible.

+
+
+

vs Elm

+

Compiles to native, not just JS. Server-side, CLI apps, anywhere.

+
+
+

vs Zig

+

Higher-level abstractions. Algebraic types. Still fast.

+
- Full Installation Guide →
@@ -186,37 +427,35 @@ cargo build --release