#How eLucid8 fits together
What you need to know to go from an idea to a running program, and which page to read for each step. For the language itself, see the tutorial.
#One model
You write a program. An engine answers questions about it, in your browser, on your computer or on a server, and every engine gives the same answers. A view is a question you can move. What a value is belongs to the program; which values a view draws and how they look (palette, region, zoom) belong to the view, and never change an answer. A deployment says where a program's data comes from and where its results go. A service is an engine that stays on while data arrives; an app is views and controls in a window, and what a person does there becomes data.
- program: equations that define values over named dimensions, in a
.el8file. - engine: answers questions about a program, computing only what each answer needs and reusing what it computed before; the playground and the
elucid8command each hold one. - question: a value at a point or over a region,
heat[step = 24]; also called a query. - view: a question drawn as a picture, two dimensions make the picture, one may be played, the rest are held; moving in the view moves the question. On the home page,
shade(the smoothed escape count) is an equation of the program, asked and explained like any value; the colours are the view's palette. - deployment:
deploy.json, where each input comes from (a file, a database, a program) and where each output goes. - service:
elucid8 serve, an engine that stays on: data and questions arrive while it runs, and each answer reuses what earlier ones computed. - app:
elucid8 window, views and controls in a window; what the person does arrives as rows of an input, turn by turn, and the window only draws.
An engine runs in three places: in your browser (the home page, the playground); on your computer (the elucid8 command: run answers and stops, serve stays on, window opens an app, playground opens the playground (macOS, Windows and Linux), and repl and mcp ask in other ways); on a server (elucid8 serve --http, and the hosted MCP server at elucid8-lang.org/mcp).
#The big picture
flowchart LR
W["write and try it<br/>in the playground"] --> S["save it in My programs<br/>(signed in)"]
S --> D["Download:<br/>a zip of the program and its data"]
D --> R["elucid8 run<br/>answer queries, then stop"]
D --> V["elucid8 serve<br/>keep answering"]
D --> A["elucid8 window<br/>an app"]
#Each word, and where to learn it
| word | what you use | where to learn it |
|---|---|---|
| program | A program, in the notation v0.2, defines values over named dimensions (time, space, steps, sensors). Every answer is data, eod (end of data) or an error that names where it started, with a timestamp: the time of the newest data it was computed from, in milliseconds. Streams at different rates meet through asof, hold and window, which choose data by its timestamp. input("name", t : inf), an input that names its dimensions (t : inf: as many as its data has; t : 1000: exactly 1,000), is data that comes from outside the program; input("name") is one value. A program compiles to one versioned JSON file, the plan (plan.json), which every eLucid8 engine runs. | Tutorial, Values and timestamps |
| engine | The playground in your browser: write a program, give it data (type or paste a table), ask a question and see why each value was computed: the demand tree, pictures and Play over time; everything runs in the page. The elucid8 command, for macOS, Linux and Windows: run answers the queries and stops, check checks everything without computing, info lists what a program needs; no browser, nothing else to install. The playground on your computer, elucid8 playground (macOS, Windows and Linux): your own data of any size, every version kept in folders. | Playground Tutorial, Deploy tutorial, The playground on your computer |
| question | You ask for a value at a point, running[t = 4], or over a region, running[t = 0..5], and only what that answer needs is computed: in the playground, asked by itself when a program opens or changes, and by Run query; --query on the command, a query request to a service. | Tutorial |
| view | A question drawn as a picture: the playground's Visualize tab, the Player in a browser, a picture in an app. Each dimension has a role (across, down, played over time), and moving in the view asks for other points. | Playground Tutorial, The long-running service |
| deployment | deploy.json binds each input to a file (CSV, JSON lines, Apache Parquet or Apache Arrow), a program that serves its rows, or a data service: a program outside eLucid8, such as an AI model or a web API, that answers when asked at a point, model[amount = x], with its deadline and what to try again as its settings. Download, in the playground, gives a zip with everything needed to run a program outside the browser: the plan, its data, a deploy.json with your query, and a README. | Deploy tutorial, Data services |
| service | elucid8 serve keeps a program loaded, takes new data as it arrives, and answers queries as they come, reusing what earlier queries computed; its own page in a browser is the Player. | The long-running service |
| app | elucid8 window opens a program's views and controls in a window on your screen; the pointer, keys and a clock arrive as rows of an input. | Programs in a window |
#Words used in these pages
The documentation, the guides for AI tools and the site use these words in one sense each:
- playground: where you write and try programs, in your browser (the site's Play page, elucid8-lang.org/play) or on your computer (
elucid8 playground). Inside it, the Play button plays a picture over time. - service: an engine that stays on,
elucid8 serve. A program outside eLucid8 that answers an input when asked (an AI model, a web API) is a data service, always with "data". - app: a program with views and controls in a window, opened by
elucid8 window. The playground on your computer is itself an app written in eLucid8. - the Player: a service's own page, at
/playeronelucid8 serve --http, opened in any browser: a view of the service's values, followed live as data arrives. - view: a question drawn as a picture, in the playground, the Player, an app or the home page.
- the phone viewer: what a program's link opens on a phone, read-only: its answers and pictures, Why? and Play.
#Ways to run a program
The elucid8 command runs a program in several ways. Each uses the same program and deployment and gives the same answers; what differs is where the questions come from and where the answers go.
| way | what it is | questions come from | answers go to |
|---|---|---|---|
elucid8 run | computes once, then stops | the deployment's queries and outputs | files, or the terminal |
elucid8 serve | a long-running service | requests on standard input, or over HTTP with --http | replies, subscriptions, the Player in a browser, Grafana, your own programs |
elucid8 window | an app in a window on your screen | the pointer, keys and a clock, sent to the program as rows of an input | the pixels in the window |
elucid8 repl | a prompt for asking a running service | you, typing queries | your terminal |
elucid8 mcp | tools for an AI assistant | the assistant's tool calls | the assistant; its show starts a service and opens the Player |
serve and window side by side. elucid8 serve is a service: other programs, scripts and browsers ask it for values, it takes new data as it arrives, and it runs with or without a screen, on your computer or a server. elucid8 window runs the same engine in one process, with no HTTP and no browser: what you do in the window becomes rows of an input, and the window draws the values its deployment names, which is what makes drawing and games quick. A click or a key in a window is the same as new rows sent to a service, and its picture is the same as asking for the value at the newest turn, so the same program can also run under serve and be shown in the Player.
Learn more: Deploy tutorial (run), The long-running service (serve, and repl), Programs in a window (window), Using eLucid8 with AI coding agents (mcp).
#One answer everywhere
The playground, the elucid8 command and the service are different engines. You can rely on them agreeing because:
- Speed options never change answers. Caches, tiles, kernels and memory management decide how fast an answer comes, never what it is.
- Arithmetic is pinned down. Sums and means are exact (the exact value, rounded once), and
exp,logandtanhcome from one maths library, so results are designed to agree to the last bit on every machine and browser; this is checked on macOS, Linux, Windows and Chrome. - Every engine is checked. Hundreds of thousands of answers are compared, engine against engine, every time eLucid8 changes.
#A program's journey
Write it in the playground. For example, a running sum and a ratio that fails where the data is 0:
-- A running sum, and a ratio that fails where x is 0. x = input("x", t : inf) running = x fby.t (running + next.t x) ratio = running / xGive the input
xthe tablet,valuewith rows 0,3 · 1,1 · 2,4 · 3,0 · 4,5 · 5,9. Queryrunningat t = 4: the answer is 13 (3 + 1 + 4 + 0 + 5).runningat t = 5 is 22, andratioat t = 3 is Error: division by zero, because x is 0 there. Press Why? beside an answer to see every demand behind it.Save it. Sign in and press Save as my program. It appears in My programs, where you can open it again, share it or delete it.
Download it. Press More ▾, then Download (or Download beside the program in My programs). Changes made since the last save go into the zip without being saved. The zip holds
plan.json,data/x.csv(your table),deploy.json(which file is which input, and your query) and a README.Run it on your computer. Install the
elucid8command withpip install elucid8, or download it from the Download page and put it in the unzipped folder. In that folder, runelucid8 run plan.json --config deploy.json(./elucid8 run plan.json --config deploy.jsonfor the file in the folder). It prints the same 13. The Deploy tutorial goes step by step, including the one-time steps macOS needs.Use your own data. Replace
x.csvwith your data and run again: change t = 4 to 50 andrunningat t = 5 becomes 67. Each file's version is a fingerprint of its contents, so a run records exactly which data it used.Keep it running.
elucid8 serve plan.json --config deploy.jsonanswers queries one per line for as long as it runs, from what earlier queries computed. See The long-running service.
#Saving and sharing
- Sign in (GitHub, Google or an email address) to save programs in My programs and share a read-only link.
- Private programs are visible only to you. Unlisted ones can be opened by anyone with the link, read-only; anyone signed in can press Save a copy to keep their own version.
- A saved program keeps its text, its data, its query and the versions of eLucid8 it was saved with.
- Download (a zip of the program and its data) needs you to be signed in, and is offered for a program in My programs: More ▾ › Download in the playground, or Download in My programs. Changes since the program's last save are included without saving them.
- Signed out, Save as file gives the program's text as a
.el8file, and Copy a link to this draft puts the program and its data in a link; nothing is stored.
#Where eLucid8 runs
The same program and deploy.json run unchanged from a Raspberry Pi to a cloud server, with the same answers to the last bit. What changes is speed, memory, and which way of running suits the place. The elucid8 command is built for macOS (Apple silicon and Intel), Linux (x86-64 and ARM64) and Windows (x86-64); the playground runs in any modern browser.
| where | the elucid8 you use | run | serve | window | repl | mcp | how you see results |
|---|---|---|---|---|---|---|---|
| Raspberry Pi (3, 4, 5 or Zero 2 W, 64-bit Raspberry Pi OS) | Linux ARM64 | yes | yes | the desktop build | yes | yes | the Player in a browser, on the Pi or across your network; files for other tools |
| A Mac | macOS | yes | yes | yes | yes | yes | the window, the Player, notebooks, charts |
| A Windows PC | Windows x86-64 | yes | yes | yes | yes | yes | the window, the Player, notebooks, charts |
| A Linux desktop | Linux x86-64 or ARM64 | yes | yes | the desktop build | yes | yes | the Player, notebooks, charts |
| A server or virtual machine | Linux x86-64 or ARM64 | yes | yes, with --http, a token and HTTPS in front | no screen | from anywhere that can reach it | yes | the Player in users' browsers, Grafana, files and databases |
| A container (Docker, Kubernetes) | Linux, in the image from Running eLucid8 as a service | yes | yes | no | from outside | rarely | as for a server |
| Python and notebooks (Jupyter, Colab, scripts) | the elucid8 package, pip install elucid8, with the command inside | elucid8.run | elucid8.Service | no | no | no | DataFrames (pandas, Polars, pyarrow), to_xarray, the Player in a notebook cell |
| A web browser, on a computer, tablet or phone | the playground at elucid8-lang.org | in the page | no | no | no | no | the playground's pictures, charts and Why?; on a phone, the examples and your entries, their answers and pictures, Why? and Play |
| AI assistants | elucid8 mcp on your computer, or the hosted server at elucid8-lang.org/mcp | yes | through show | no | no | yes | the assistant's answers; show opens the Player |
| A phone or tablet app | none on the device: the app asks an elucid8 serve running elsewhere over HTTP | no | elsewhere | no | no | no | in the app |
"The desktop build": on Linux, elucid8 window opens with the desktop build from the Download page, which needs WebKitGTK 4.1 (Programs in a window).
#In the cloud
In the cloud, eLucid8 runs as a Linux program on a virtual machine, or as a container. Either way it is elucid8 serve --http behind HTTPS, with a token (Running eLucid8 as a service):
| provider | virtual machines | containers |
|---|---|---|
| Amazon Web Services | EC2, on x86-64 or ARM (Graviton) | ECS and Fargate, EKS, App Runner |
| Google Cloud | Compute Engine, on x86-64 or ARM (Tau T2A, Axion) | Cloud Run, GKE |
| Microsoft Azure | Virtual Machines, on x86-64 or ARM (Ampere) | Container Apps, AKS |
- Keep one instance.
elucid8 serveholds its caches and the data it has been sent in memory. Run one instance per deployment; don't let a platform start several copies, or scale to zero and drop what it held. - Give it its token as a secret. Use AWS Secrets Manager, Google Secret Manager or Azure Key Vault, mounted as the file
--token-filenames. - Read and write cloud data through connectors: Amazon S3 and services compatible with it, BigQuery, Snowflake and Databricks as inputs, and Kafka and MQTT (Connecting eLucid8 to your data).
- The container on this page is checked with Docker. The cloud services above run containers and Linux programs in the same way, but have not each been tried.
#How results are drawn
| how | where | what draws it |
|---|---|---|
elucid8 window on macOS | Apple silicon and Intel | a native window, its pixels drawn with Metal |
elucid8 window on Windows | x86-64 | a native window, drawn with GDI |
elucid8 window on Linux | the desktop build, x86-64 and ARM64 | a native window under X11 or Wayland |
| The Player | any modern browser, from elucid8 serve --http | the browser, updated live as data arrives |
| The playground | any modern browser | the page itself |
| Charts | anywhere | a Vega-Lite file (--format vega-lite), drawn by Vega, Altair or Jupyter |
| Arrays and tables | anywhere | Zarr and NumPy files for matplotlib, xarray, Plotly, napari and hvPlot; Arrow and Parquet for pandas, Polars and DuckDB (Seeing your results) |
| Dashboards | a server | Grafana, reading values from elucid8 serve's /values |
| The terminal | anywhere elucid8 repl runs | small charts of text characters (spark) |
Not built: a build for 32-bit ARM (older Raspberry Pis), a build for Windows on ARM, running inside a phone app with no connection, and the web embed (your program on any web page).
#What you can use today
- The playground in your browser, with views over any number of dimensions, Why? beside every answer, and saving, sharing and copying programs.
- Download: a program as a ready-to-run zip, with its plan, its data and a configuration with your query.
- The
elucid8command for macOS, Linux and Windows, installed withpip install elucid8, or from the Download page as a file or with a one-line install command. It reads CSV, JSON-lines, Parquet and Arrow files, and writes results as JSON lines, CSV, whole grids (frames), NumPy.npzfiles, Apache Arrow tables, Apache Parquet files, Zarr stores and Vega-Lite charts (Seeing your results), and the outputs the program names (output("report") = e). elucid8 window, apps in a window of their own, andelucid8 playground, the playground on your computer (macOS, Windows and Linux).elucid8 serve: queries, shared caches, a memory budget, new data arriving, subscriptions (answers sent when data changes), reload, time limits and cancellation, over standard input or HTTP from several clients;elucid8 repl, a query prompt for a running service.- The Python package, on PyPI, with DataFrames in and out, and connectors for databases, object stores, Kafka, MQTT and HTTP (Connecting eLucid8 to your data).
elucid8 mcp, so that AI assistants compile and run programs on your computer, and a hosted MCP server at https://elucid8-lang.org/mcp (Using eLucid8 with AI coding agents).- Timestamps on every value, choosing data by its timestamp (
asof,hold,window,latest,after), and service calls timed by the data they are sent.