Skip to content

Interactive REPL

Start Elide's REPL with elide repl to evaluate JavaScript, TypeScript, Python and WebAssembly interactively and share values between languages.

On this page

The REPL evaluates code line by line and shares values between languages.

Terminal
bash
elide repl

elide with no arguments in a terminal also starts it. Languages: JavaScript, TypeScript, Python and WebAssembly.

One REPL session — JavaScript values used from Python
js ❯ const x = 5
js ❯ x
5
js ❯ /py
py ❯ import json; json.dumps({"x": x})
'{"x": 5}'
                                        
─────────────────────────────────────────────────────────────────────
py ❯                                  

─────────────────────────────────────────────────────────────────────
session demo0001  •  py  •  v1.6.0                              seq 5

Commands

CommandEffect
/js, /ts, /py, /wasmSwitch language. With an argument, evaluate it once in that language.
/lang NAMESwitch language.
/export NAMEShare a value with the other languages.
/import NAMEBind a shared value in the current language.
/history [N]Show recent entries.
/resetDelete saved history.
/clearClear the screen.
/helpList commands.
/exitLeave the REPL.

Share values

text
const x = 41
/export x
/py
/import x
print(x + 1)
utf-8 · text · Lines: 5
text
42
utf-8 · text · Lines: 1

Sharing works without --interop.

Tern notebook sessions

With the Tern plugin installed and its embedded SDK configured, choose Open REPL from the command palette. Use the language picker or Ctrl+L to switch languages. Enter evaluates a cell; Shift+Enter inserts a newline.

Each session is one notebook. JavaScript and Python share live values automatically: enter const y = {"hi": 5} in JavaScript, switch to Python, and enter y.hi to get 5. Changes to the shared object remain visible in both languages.

Declarations produce no result block. Objects appear as expandable JSON trees, and language headings appear when the cell language changes. Switching preserves each language’s draft and history.

The picker shows languages supported by the configured SDK. CEL evaluates shared data snapshots. Pkl evaluates modules and makes the result available as _. Kotlin accepts module declarations. TypeScript and WebAssembly execution adapters are not yet available in the embedded notebook.

Serving in Tern

The Tern plugin also provides Serve directory or script. Enter a directory to serve static files on an available loopback port, or a script to launch with the configured runtime. Each server runs independently of notebook kernels.

The native dashboard shows the actual bound URL, readiness, uptime, observed requests and bounded logs. Click a request for structured status and timing details; use Stop or Restart to control the server. Closing the dashboard stops its server. JavaScript servers using Elide.serve provide bind and request events; server APIs without that instrumentation currently provide logs and process controls only. A trace waterfall and OTLP inspection are not yet available.

Was this page helpful?