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>
This commit is contained in:
2026-02-16 06:41:49 -05:00
parent 49ab70829a
commit 552e7a4972
10 changed files with 3046 additions and 269 deletions

224
website/lux-site/dist/index.html vendored Normal file
View File

@@ -0,0 +1,224 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lux - Functional Programming with First-Class Effects</title>
<meta name="description" content="Lux is a functional programming language with first-class effects. Effects are explicit. Types are powerful. Performance is native.">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>✨</text></svg>">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Serif+Pro:wght@400;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="static/style.css">
</head>
<body>
<!-- Navigation -->
<nav class="nav">
<a href="/" class="nav-logo">LUX</a>
<div class="nav-links">
<a href="/learn/" class="nav-link">Learn</a>
<a href="/docs/" class="nav-link">Docs</a>
<a href="/playground/" class="nav-link">Playground</a>
<a href="/community/" class="nav-link">Community</a>
</div>
<a href="https://github.com/luxlang/lux" class="nav-github">GitHub</a>
</nav>
<main>
<!-- Hero Section -->
<section class="hero">
<div class="hero-logo">
<pre class="logo-ascii">╦ ╦ ╦╦ ╦
║ ║ ║╔╣
╩═╝╚═╝╩ ╩</pre>
</div>
<h1 class="hero-title">
Functional Programming<br>
with First-Class Effects
</h1>
<p class="hero-tagline">
Effects are explicit. Types are powerful. Performance is native.
</p>
<div class="hero-cta">
<a href="/learn/getting-started/" class="btn btn-primary">Get Started</a>
<a href="/playground/" class="btn btn-secondary">Playground</a>
</div>
</section>
<!-- Code Demo Section -->
<section class="code-demo">
<div class="container">
<div class="code-demo-grid">
<div class="code-block">
<pre class="code"><code><span class="hljs-keyword">fn</span> <span class="hljs-function">processOrder</span>(
order: <span class="hljs-type">Order</span>
): <span class="hljs-type">Receipt</span>
<span class="hljs-keyword">with</span> {<span class="hljs-effect">Database</span>, <span class="hljs-effect">Email</span>} =
{
<span class="hljs-keyword">let</span> saved = <span class="hljs-effect">Database</span>.save(order)
<span class="hljs-effect">Email</span>.send(
order.customer,
<span class="hljs-string">"Order confirmed!"</span>
)
Receipt(saved.id)
}</code></pre>
</div>
<div class="code-explanation">
<h3>The type signature tells you everything</h3>
<ul>
<li>Queries the database</li>
<li>Sends an email</li>
<li>Returns a Receipt</li>
</ul>
<p class="highlight">No surprises. No hidden side effects.</p>
</div>
</div>
</div>
</section>
<!-- Value Props Section -->
<section class="value-props">
<div class="container">
<div class="value-props-grid">
<div class="value-prop card">
<h3 class="value-prop-title">EFFECTS</h3>
<p class="value-prop-desc">Side effects are tracked in the type signature. Know exactly what every function does.</p>
</div>
<div class="value-prop card">
<h3 class="value-prop-title">TYPES</h3>
<p class="value-prop-desc">Full type inference with algebraic data types. Catch bugs at compile time.</p>
</div>
<div class="value-prop card">
<h3 class="value-prop-title">PERFORMANCE</h3>
<p class="value-prop-desc">Compiles to native C via gcc. Matches C performance, beats Rust and Zig.</p>
</div>
</div>
</div>
</section>
<!-- Benchmarks Section -->
<section class="benchmarks">
<div class="container">
<h2>Performance</h2>
<p class="section-subtitle">fib(35) benchmark — verified with hyperfine</p>
<div class="benchmarks-chart">
<div class="benchmark-row">
<span class="benchmark-lang">Lux</span>
<div class="benchmark-bar-container">
<div class="benchmark-bar" style="width: 100%"></div>
</div>
<span class="benchmark-time">28.1ms</span>
</div>
<div class="benchmark-row">
<span class="benchmark-lang">C</span>
<div class="benchmark-bar-container">
<div class="benchmark-bar" style="width: 97%"></div>
</div>
<span class="benchmark-time">29.0ms</span>
</div>
<div class="benchmark-row">
<span class="benchmark-lang">Rust</span>
<div class="benchmark-bar-container">
<div class="benchmark-bar" style="width: 68%"></div>
</div>
<span class="benchmark-time">41.2ms</span>
</div>
<div class="benchmark-row">
<span class="benchmark-lang">Zig</span>
<div class="benchmark-bar-container">
<div class="benchmark-bar" style="width: 60%"></div>
</div>
<span class="benchmark-time">47.0ms</span>
</div>
</div>
<p class="benchmarks-note">
<a href="/benchmarks/">See full methodology →</a>
</p>
</div>
</section>
<!-- Testing Section -->
<section class="testing">
<div class="container">
<h2>Testing Without Mocks</h2>
<p class="section-subtitle">Swap effect handlers at test time. Same code, different behavior.</p>
<div class="code-demo-grid">
<div class="code-block">
<pre class="code"><code><span class="hljs-comment">// Production</span>
<span class="hljs-keyword">run</span> processOrder(order) <span class="hljs-keyword">with</span> {
<span class="hljs-effect">Database</span> -> postgresDb,
<span class="hljs-effect">Email</span> -> smtpServer
}</code></pre>
</div>
<div class="code-block">
<pre class="code"><code><span class="hljs-comment">// Testing</span>
<span class="hljs-keyword">run</span> processOrder(order) <span class="hljs-keyword">with</span> {
<span class="hljs-effect">Database</span> -> inMemoryDb,
<span class="hljs-effect">Email</span> -> collectEmails
}</code></pre>
</div>
</div>
</div>
</section>
<!-- Quick Start Section -->
<section class="quick-start">
<div class="container">
<h2>Get Started</h2>
<div class="code-block">
<pre class="code"><code><span class="hljs-comment"># Install via Nix</span>
nix run github:luxlang/lux
<span class="hljs-comment"># Or build from source</span>
git clone https://github.com/luxlang/lux
cd lux && nix develop
cargo build --release
<span class="hljs-comment"># Start the REPL</span>
./target/release/lux</code></pre>
</div>
<a href="/learn/getting-started/" class="btn btn-primary">Full Installation Guide →</a>
</div>
</section>
</main>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="footer-grid">
<div class="footer-brand">
<span class="footer-logo">LUX</span>
<p>Functional programming with first-class effects.</p>
</div>
<div class="footer-column">
<h4>LEARN</h4>
<ul>
<li><a href="/learn/getting-started/">Getting Started</a></li>
<li><a href="/learn/tutorial/">Tutorial</a></li>
<li><a href="/learn/examples/">Examples</a></li>
<li><a href="/docs/">Reference</a></li>
</ul>
</div>
<div class="footer-column">
<h4>COMMUNITY</h4>
<ul>
<li><a href="https://discord.gg/lux">Discord</a></li>
<li><a href="https://github.com/luxlang/lux">GitHub</a></li>
<li><a href="/community/contributing/">Contributing</a></li>
<li><a href="/community/code-of-conduct/">Code of Conduct</a></li>
</ul>
</div>
<div class="footer-column">
<h4>ABOUT</h4>
<ul>
<li><a href="/benchmarks/">Benchmarks</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="https://github.com/luxlang/lux/blob/main/LICENSE">License</a></li>
</ul>
</div>
</div>
<div class="footer-bottom">
<p>© 2026 Lux Language</p>
</div>
</div>
</footer>
</body>
</html>

707
website/lux-site/dist/static/style.css vendored Normal file
View File

@@ -0,0 +1,707 @@
/* ============================================================================
Lux Website - Sleek and Noble
Translucent black, white, and gold with strong serif typography
============================================================================ */
/* CSS Variables */
:root {
/* Backgrounds */
--bg-primary: #0a0a0a;
--bg-secondary: #111111;
--bg-glass: rgba(255, 255, 255, 0.03);
--bg-glass-hover: rgba(255, 255, 255, 0.06);
--bg-code: rgba(212, 175, 55, 0.05);
/* Text */
--text-primary: #ffffff;
--text-secondary: rgba(255, 255, 255, 0.7);
--text-muted: rgba(255, 255, 255, 0.5);
/* Gold accents */
--gold: #d4af37;
--gold-light: #f4d03f;
--gold-dark: #b8860b;
--gold-glow: rgba(212, 175, 55, 0.3);
/* Borders */
--border-subtle: rgba(255, 255, 255, 0.1);
--border-gold: rgba(212, 175, 55, 0.3);
/* Typography */
--font-heading: "Playfair Display", Georgia, serif;
--font-body: "Source Serif Pro", Georgia, serif;
--font-code: "JetBrains Mono", "Fira Code", monospace;
/* Spacing */
--container-width: 1200px;
--section-padding: 6rem 2rem;
}
/* Reset */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
background: var(--bg-primary);
color: var(--text-primary);
font-family: var(--font-body);
font-size: 18px;
line-height: 1.7;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Typography */
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-heading);
font-weight: 600;
color: var(--gold-light);
letter-spacing: -0.02em;
line-height: 1.2;
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
p {
margin-bottom: 1rem;
color: var(--text-secondary);
}
a {
color: var(--gold);
text-decoration: none;
transition: color 0.3s ease;
}
a:hover {
color: var(--gold-light);
}
/* Container */
.container {
max-width: var(--container-width);
margin: 0 auto;
padding: 0 2rem;
}
/* ============================================================================
Navigation
============================================================================ */
.nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5rem 2rem;
max-width: var(--container-width);
margin: 0 auto;
position: sticky;
top: 0;
z-index: 100;
background: rgba(10, 10, 10, 0.9);
backdrop-filter: blur(10px);
border-bottom: 1px solid var(--border-subtle);
}
.nav-logo {
font-family: var(--font-heading);
font-size: 1.75rem;
font-weight: 700;
color: var(--gold);
letter-spacing: 0.1em;
}
.nav-links {
display: flex;
gap: 2.5rem;
}
.nav-link {
font-family: var(--font-body);
font-size: 1rem;
color: var(--text-secondary);
transition: color 0.3s ease;
}
.nav-link:hover {
color: var(--gold);
}
.nav-github {
font-family: var(--font-body);
font-size: 0.9rem;
color: var(--text-muted);
padding: 0.5rem 1rem;
border: 1px solid var(--border-subtle);
border-radius: 4px;
transition: all 0.3s ease;
}
.nav-github:hover {
color: var(--gold);
border-color: var(--gold);
}
/* ============================================================================
Hero Section
============================================================================ */
.hero {
min-height: 90vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
padding: 4rem 2rem;
background:
radial-gradient(ellipse at top, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
var(--bg-primary);
}
.hero-logo {
margin-bottom: 2rem;
}
.logo-ascii {
font-family: var(--font-code);
font-size: 2rem;
color: var(--gold);
line-height: 1.2;
text-shadow: 0 0 30px var(--gold-glow);
}
.hero-title {
margin-bottom: 1.5rem;
}
.hero-tagline {
font-size: 1.35rem;
color: var(--text-secondary);
max-width: 600px;
margin-bottom: 3rem;
}
.hero-cta {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
justify-content: center;
}
/* ============================================================================
Buttons
============================================================================ */
.btn {
font-family: var(--font-heading);
font-size: 1rem;
font-weight: 600;
padding: 1rem 2.5rem;
border-radius: 4px;
text-decoration: none;
transition: all 0.3s ease;
display: inline-block;
cursor: pointer;
border: none;
}
.btn-primary {
background: linear-gradient(135deg, var(--gold-dark), var(--gold));
color: #0a0a0a;
}
.btn-primary:hover {
background: linear-gradient(135deg, var(--gold), var(--gold-light));
color: #0a0a0a;
transform: translateY(-2px);
box-shadow: 0 4px 20px var(--gold-glow);
}
.btn-secondary {
background: transparent;
color: var(--gold);
border: 1px solid var(--gold);
}
.btn-secondary:hover {
background: rgba(212, 175, 55, 0.1);
color: var(--gold-light);
}
/* ============================================================================
Code Demo Section
============================================================================ */
.code-demo {
padding: var(--section-padding);
background: var(--bg-secondary);
border-top: 1px solid var(--border-subtle);
border-bottom: 1px solid var(--border-subtle);
}
.code-demo-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
align-items: center;
}
.code-block {
background: var(--bg-code);
border: 1px solid var(--border-gold);
border-radius: 8px;
overflow: hidden;
}
.code {
padding: 1.5rem;
margin: 0;
overflow-x: auto;
}
.code code {
font-family: var(--font-code);
font-size: 0.95rem;
color: var(--text-primary);
line-height: 1.6;
}
.code-explanation h3 {
margin-bottom: 1.5rem;
}
.code-explanation ul {
list-style: none;
margin-bottom: 1.5rem;
}
.code-explanation li {
padding: 0.5rem 0;
padding-left: 1.5rem;
position: relative;
color: var(--text-secondary);
}
.code-explanation li::before {
content: "•";
position: absolute;
left: 0;
color: var(--gold);
}
.code-explanation .highlight {
font-size: 1.1rem;
color: var(--gold-light);
font-style: italic;
}
/* ============================================================================
Value Props Section
============================================================================ */
.value-props {
padding: var(--section-padding);
}
.value-props-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
}
.value-prop {
text-align: center;
padding: 2.5rem 2rem;
}
.value-prop-title {
font-size: 0.9rem;
letter-spacing: 0.15em;
margin-bottom: 1rem;
color: var(--gold);
}
.value-prop-desc {
font-size: 1.1rem;
color: var(--text-secondary);
}
/* ============================================================================
Cards
============================================================================ */
.card {
background: var(--bg-glass);
border: 1px solid rgba(212, 175, 55, 0.15);
border-radius: 8px;
backdrop-filter: blur(10px);
transition: all 0.3s ease;
}
.card:hover {
background: var(--bg-glass-hover);
border-color: rgba(212, 175, 55, 0.3);
}
/* ============================================================================
Benchmarks Section
============================================================================ */
.benchmarks {
padding: var(--section-padding);
background: var(--bg-secondary);
border-top: 1px solid var(--border-subtle);
border-bottom: 1px solid var(--border-subtle);
}
.benchmarks h2 {
text-align: center;
margin-bottom: 0.5rem;
}
.section-subtitle {
text-align: center;
color: var(--text-muted);
margin-bottom: 3rem;
}
.benchmarks-chart {
max-width: 600px;
margin: 0 auto;
}
.benchmark-row {
display: grid;
grid-template-columns: 60px 1fr 80px;
gap: 1rem;
align-items: center;
margin-bottom: 1rem;
}
.benchmark-lang {
font-family: var(--font-code);
font-size: 0.9rem;
color: var(--text-secondary);
}
.benchmark-bar-container {
height: 24px;
background: var(--bg-glass);
border-radius: 4px;
overflow: hidden;
}
.benchmark-bar {
height: 100%;
background: linear-gradient(90deg, var(--gold-dark), var(--gold));
border-radius: 4px;
transition: width 1s ease;
}
.benchmark-time {
font-family: var(--font-code);
font-size: 0.9rem;
color: var(--gold-light);
text-align: right;
}
.benchmarks-note {
text-align: center;
margin-top: 2rem;
}
.benchmarks-note a {
font-size: 0.95rem;
color: var(--text-muted);
}
.benchmarks-note a:hover {
color: var(--gold);
}
/* ============================================================================
Testing Section
============================================================================ */
.testing {
padding: var(--section-padding);
}
.testing h2 {
text-align: center;
margin-bottom: 0.5rem;
}
.testing .code-demo-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
margin-top: 2rem;
}
@media (max-width: 768px) {
.testing .code-demo-grid {
grid-template-columns: 1fr;
}
}
/* ============================================================================
Quick Start Section
============================================================================ */
.quick-start {
padding: var(--section-padding);
text-align: center;
}
.quick-start h2 {
margin-bottom: 2rem;
}
.quick-start .code-block {
max-width: 600px;
margin: 0 auto 2rem;
text-align: left;
}
/* ============================================================================
Footer
============================================================================ */
.footer {
padding: 4rem 2rem 2rem;
background: var(--bg-secondary);
border-top: 1px solid var(--border-subtle);
}
.footer-grid {
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr;
gap: 3rem;
margin-bottom: 3rem;
}
.footer-brand {
max-width: 300px;
}
.footer-logo {
font-family: var(--font-heading);
font-size: 1.5rem;
font-weight: 700;
color: var(--gold);
letter-spacing: 0.1em;
display: block;
margin-bottom: 1rem;
}
.footer-brand p {
font-size: 0.95rem;
color: var(--text-muted);
}
.footer-column h4 {
font-size: 0.8rem;
letter-spacing: 0.1em;
color: var(--text-muted);
margin-bottom: 1rem;
}
.footer-column ul {
list-style: none;
}
.footer-column li {
margin-bottom: 0.5rem;
}
.footer-column a {
font-size: 0.95rem;
color: var(--text-secondary);
}
.footer-column a:hover {
color: var(--gold);
}
.footer-bottom {
text-align: center;
padding-top: 2rem;
border-top: 1px solid var(--border-subtle);
}
.footer-bottom p {
font-size: 0.9rem;
color: var(--text-muted);
}
/* ============================================================================
Documentation Layout
============================================================================ */
.doc-layout {
display: grid;
grid-template-columns: 250px 1fr;
min-height: calc(100vh - 80px);
}
.doc-sidebar {
position: sticky;
top: 80px;
height: calc(100vh - 80px);
overflow-y: auto;
padding: 2rem;
background: var(--bg-secondary);
border-right: 1px solid var(--border-subtle);
}
.doc-sidebar-section {
margin-bottom: 2rem;
}
.doc-sidebar-section h4 {
font-size: 0.75rem;
letter-spacing: 0.15em;
color: var(--text-muted);
margin-bottom: 0.75rem;
}
.doc-sidebar-section ul {
list-style: none;
}
.doc-nav-link {
display: block;
padding: 0.4rem 0;
font-size: 0.95rem;
color: var(--text-secondary);
transition: color 0.2s ease;
}
.doc-nav-link:hover {
color: var(--gold);
}
.doc-nav-link.active {
color: var(--gold-light);
font-weight: 600;
}
.doc-content {
padding: 3rem;
max-width: 800px;
}
.doc-content h1 {
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border-gold);
}
/* ============================================================================
Responsive Design
============================================================================ */
@media (max-width: 1024px) {
.code-demo-grid {
grid-template-columns: 1fr;
}
.value-props-grid {
grid-template-columns: 1fr;
}
.footer-grid {
grid-template-columns: 1fr 1fr;
}
.doc-layout {
grid-template-columns: 1fr;
}
.doc-sidebar {
position: static;
height: auto;
}
}
@media (max-width: 768px) {
.nav {
flex-direction: column;
gap: 1rem;
}
.nav-links {
gap: 1.5rem;
}
.hero {
min-height: 80vh;
padding: 3rem 1.5rem;
}
.logo-ascii {
font-size: 1.5rem;
}
.hero-cta {
flex-direction: column;
width: 100%;
max-width: 300px;
}
.btn {
width: 100%;
text-align: center;
}
.footer-grid {
grid-template-columns: 1fr;
text-align: center;
}
.footer-brand {
max-width: none;
}
}
/* ============================================================================
Syntax Highlighting
============================================================================ */
.hljs-keyword { color: var(--gold); }
.hljs-type { color: #82aaff; }
.hljs-string { color: #c3e88d; }
.hljs-number { color: #f78c6c; }
.hljs-comment { color: var(--text-muted); font-style: italic; }
.hljs-function { color: var(--gold-light); }
.hljs-effect { color: var(--gold-light); font-weight: 600; }
/* ============================================================================
Animations
============================================================================ */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.hero > * {
animation: fadeIn 0.8s ease forwards;
}
.hero > *:nth-child(1) { animation-delay: 0.1s; }
.hero > *:nth-child(2) { animation-delay: 0.2s; }
.hero > *:nth-child(3) { animation-delay: 0.3s; }
.hero > *:nth-child(4) { animation-delay: 0.4s; }