Skip to content

Commit a003623

Browse files
hyperpolymathclaude
andcommitted
feat: add playground/ scaffold
Placeholder PWA playground following the nextgen-languages convention. Includes README, public/index.html placeholder, and example programs (trefoil.tangle, figure_eight.tangle). Interactive playground not yet implemented — see playground/README.md for intended architecture (tangle-wasm + Deno + Monaco + ReScript SPA). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 74595f9 commit a003623

4 files changed

Lines changed: 71 additions & 0 deletions

File tree

playground/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Tangle Playground
2+
3+
A local PWA playground for the Tangle topological programming language.
4+
5+
## Status
6+
7+
**Scaffold.** The directory structure is in place. The interactive playground
8+
itself is not yet built.
9+
10+
## Intended architecture (pattern mirrors sibling language playgrounds)
11+
12+
- **Compiler backend:** `compiler/tangle-wasm/` compiled to WASM
13+
- **Runtime:** Deno or Bun serving the PWA shell + static assets
14+
- **UI:** ReScript + React SPA with Monaco editor
15+
- **Execution modes:**
16+
- `parse` — show AST
17+
- `typecheck` — show type errors + inferred types
18+
- `compile` — PlanarDiagram / TangleIR output
19+
- `eval` — step-through evaluator (PanLL timeline if available)
20+
- **Share-by-URL:** URL-encoded source for sharing snippets
21+
- **Examples:** `playground/examples/` — starter programs
22+
23+
## Directory layout
24+
25+
```
26+
playground/
27+
├── README.md (this file)
28+
├── public/ (static assets; PWA shell goes here when built)
29+
└── examples/ (starter .tangle programs)
30+
```
31+
32+
## Next steps to build this out
33+
34+
1. Write a minimal Deno server that serves `public/` + a `/run` endpoint
35+
2. Build tangle-wasm to WASM with `wasm-pack` or similar
36+
3. Add Monaco editor with Tangle syntax highlighting
37+
4. Add execution-mode tabs
38+
5. Add example loader wiring up `playground/examples/`
39+
40+
See sibling playgrounds for patterns:
41+
- `/var/mnt/eclipse/repos/nextgen-languages/eclexia/playground/`
42+
- `/var/mnt/eclipse/repos/nextgen-languages/betlang/playground/`
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- SPDX-License-Identifier: PMPL-1.0-or-later
2+
-- Example: figure-eight knot — alternating crossings on two strands
3+
4+
let fig8 = sigma_1 ; sigma_2_inv ; sigma_1 ; sigma_2_inv

playground/examples/trefoil.tangle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- SPDX-License-Identifier: PMPL-1.0-or-later
2+
-- Example: trefoil knot as three positive crossings in sequence
3+
4+
let trefoil = sigma_1 ; sigma_1 ; sigma_1

playground/public/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Tangle Playground (placeholder)</title>
7+
<style>
8+
body { font-family: system-ui, sans-serif; padding: 32px; max-width: 640px; margin: auto; }
9+
code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; }
10+
</style>
11+
</head>
12+
<body>
13+
<h1>Tangle Playground</h1>
14+
<p>This is a placeholder. The interactive playground is not yet built.</p>
15+
<p>See <code>playground/README.md</code> for the intended architecture and
16+
next steps.</p>
17+
<p>In the meantime, explore example programs in
18+
<code>playground/examples/</code> or the Tangle compiler at
19+
<code>compiler/</code>.</p>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)