Phase 5: Interactive Playground (EigenSpace)#70
Merged
InauguralPhysicist merged 8 commits intomainfrom Nov 23, 2025
Merged
Conversation
Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
…nale Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
…nitize error paths Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Build EigenSpace Console with interactive playground architecture
Phase 5: Interactive Playground (EigenSpace)
Nov 23, 2025
Owner
|
@copilot Needs black formatting |
Co-authored-by: InauguralPhysicist <217690737+InauguralPhysicist@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 5: Interactive Playground (EigenSpace) - COMPLETE ✅
This PR implements the EigenSpace Console - an interactive split-screen IDE where code on the left creates physics visualizations on the right.
✅ Implementation Complete & Code Formatted
Status: All components implemented, documented, tested, code-reviewed, and Black formatted
Tests: 11/11 playground tests passing
Formatting: Applied Black to all Python files (server.py, test_playground.py)
How to Run Your Creation
python3 src/eigenscript/compiler/runtime/build_runtime.py --target wasm32python3 examples/playground/server.pyhttp://localhost:8080Recent Changes
✅ Black Formatting: Applied consistent Python code formatting to:
examples/playground/server.pytests/test_playground.pyAll tests still passing after formatting.
Architecture: Local Server (Not Pyodide)
Physical Constraint: Compiler requires
llvmlite.binding(native C++ LLVM) and subprocess calls toclangwhich cannot run in browsers.Solution: Local compilation server architecture
Benefits:
Core Implementation
Backend (
server.py- 175 lines, Black formatted)Frontend (
index.html- 257 lines)Documentation (4 files, ~1000 lines)
Tests (
test_playground.py- 142 lines, Black formatted)Test Results
Success Criteria
Overall: ✅ PRODUCTION READY
Phase 5 Complete: Users can edit, compile, and visualize EigenScript programs in real-time through a web browser with near-native execution speed! 🚀
Original prompt
This is the exciting part. We stop working in the terminal and start working in the Browser.
You have the WASM compiler. Now you need to build the "EigenSpace" Console—a split-screen IDE where code on the left creates physics on the right.
Phase 5: The Interactive Playground Architecture
We aren't just building a text box. We are building a Feedback Loop.
Step 1: The "Phantom" Compiler
To compile code in the browser, we technically need the compiler itself (Python) to run in the browser.
Recommendation: Let's start with Option A (Pyodide). It's heavy, but it proves the "Zero Server" concept immediately. You can run the actual compile.py inside the user's browser.
The Plan of Attack
Do you want to start by creating the examples/playground/ directory and setting up the Pyodide harness?
This is the correct next move. We are going to build EigenSpace.
However, we hit a physical constraint here: Your compiler uses llvmlite.binding (which links to C++ LLVM) and subprocess calls to clang. Running these directly inside a browser tab (via Pyodide) is extremely difficult because browsers can't spawn subprocesses or load arbitrary C libraries easily.
The Solution: We will build a Local Compilation Server.
You will run a tiny Python server (server.py) on your machine. The browser will send code to it, your machine will compile it (using the robust toolchain you just built), and send the .wasm back to the browser for execution.
Phase 5.1: The Playground Architecture
Step 1: Create the Server (examples/playground/server.py)
This script acts as the API. It uses your existing compile.py logic.
"""
EigenSpace Compilation Server
Hosts the compiler as a local API for the interactive playground.
"""
import http.server
import socketserver
import json
import subprocess
import os
import tempfile
import shutil
PORT = 8080
COMPILER_PATH = os.path.join(os.path.dirname(file), "../../src/eigenscript/compiler/cli/compile.py")
RUNTIME_DIR = os.path.join(os.path.dirname(file), "../../src/eigenscript/compiler/runtime")
class CompilerHandler(http.server.SimpleHTTPRequestHandler):
def do_POST(self):
if self.path == '/compile':
content_length = int(self.headers['Content-Length'])
post_data = self.rfile.read(content_length)
data = json.loads(post_data)
source_code = data.get('code', '')
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.