MCPcopy Create free account
hub / github.com/codereport/jello

github.com/codereport/jello @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
53 symbols 150 edges 8 files ⚖ MIT 0 documented · 0% ● updated 13d ago★ 6619 open issues

Browse by type

⨍ Functions 49◇ Types & classes 4
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🟢🟡🔴 Jello 🔴🟡🟢

<a href="https://github.com/codereport/jello/issues" alt="contributions welcome">
    <img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" /></a>
<a href="https://lbesson.mit-license.org/" alt="MIT license">
    <img src="https://img.shields.io/badge/License-MIT-blue.svg" /></a>
<a href="https://www.python.org/">
    <img src="https://img.shields.io/badge/Python-3-ff69b4.svg"/></a>
<a href="https://github.com/codereport?tab=followers" alt="GitHub followers">
    <img src="https://img.shields.io/github/followers/codereport.svg?style=social&label=Follow" /></a>
<a href="https://GitHub.com/codereport/jello/stargazers/" alt="GitHub stars">
    <img src="https://img.shields.io/github/stars/codereport/jello.svg?style=social&label=Star" /></a>
<a href="https://twitter.com/code_report" alt="Twitter">
    <img src="https://img.shields.io/twitter/follow/code_report.svg?style=social&label=@code_report" /></a>

Description

A Python script for wrapping the Jellyfish (a fork of Jelly) executable so you can more easily play with the language.

Try the Jello playground →

image

Installation

Jellyfish is included as a Git submodule and installed into the same Python environment as Jello.

git clone --recurse-submodules https://github.com/codereport/jello.git
cd jello
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python src/jello.py

For an existing clone, run git submodule update --init --recursive before installing the requirements.

At the prompt, try 5 :: range. Enter q to quit.

Browser playground

The playground is a dark, monospace terminal with a Rust/WebAssembly evaluator and the pinned Python/Jellyfish interpreter through Pyodide. It starts with 4 :: range . sum div len, which returns 2.5. The expression bar sits above the evaluation session. It includes examples, evaluation traces, combinator diagrams, a searchable keyword reference, local command history, and shareable expression links. Stop cancels a calculation; each engine has a 10-second execution limit.

Rust runs first and displays its result, trace, and diagram immediately. Python runs afterward in a separate worker and verifies both the output and structured value. ✓ match appears when they agree, including exact large integers and nested list structure. Python timeouts or errors keep the Rust result visible with an unverified status; a mismatch shows both outputs. New evaluations cancel obsolete verification. Unsupported Rust operations or input types fall back to Python, and Rust download failures also leave Python available. If Python cannot load, Rust remains usable and Retry reloads Python verification.

Turn Live mode on in the settings gear to evaluate automatically after a 600 ms typing pause. Enabling it keeps only the most recent session entry; the expression appears in the input bar without repeating above the result. Accepting an autocomplete suggestion with Tab, Enter, or a click evaluates immediately, skipping the typing delay. With the dropdown closed, Tab also evaluates a pending edit while moving focus normally; Enter submits a complete expression immediately. Edits update one preview, and a newer expression supersedes a slow preview. Turn it off to return to manual evaluation with Enter or Run, where each new result includes its expression. Automatic previews do not fill command history; explicit runs are remembered. Shared links still wait for you to edit or run the expression.

The converted Jelly expression appears in larger type to the right of the expression bar and updates as you type. In live mode, Run is hidden; Stop remains available during a calculation. Manual sessions keep Run and the Jelly code alongside each result in their history.

The bottom-right corner shows the white Rust logo, Rust execution time, Python logo, Python total time, and verification status. It stays visible in live and presentation modes. Rust's time measures evaluation, including traces and diagrams, and excludes interpreter loading. Python's total measures the elapsed time from requesting Python evaluation until its reply arrives, including any loading wait, evaluation, traces, diagrams, and message delivery. Once Python is loaded, later runs only include the time needed for that request. Both exclude the typing delay and time spent running Rust first. Python fallback and retries use the same total timing. Hover over the Python comparison to see evaluation-only time too. The Rust logo comes from codereport/logos, with the original artwork attributed under CC-BY-4.0.

Press Shift+C to open the searchable challenge picker, including from the expression editor. You can also choose Browse challenges in settings. Search by problem title, number, contest, or program; use the arrow keys and Enter to select, or Escape to close. Each challenge loads a complete example with sample inputs and the solution from challenges.md. For example, Score of a String loads "hello" :: ord deltas abs sum, which returns 13. Live mode evaluates the new expression automatically; manual mode waits for Enter or Run.

The catalog combines challenges.md with sample inputs and expected Jello results at build time. Each picker entry shows Added YYYY-MM-DD after its LeetCode/PWC numbers and contest information; you can search by date too. These dates record when the problem first appeared in the catalog, recovered from Git history including the original leetcode.md, using the commit author's local date. Samples come from the linked LeetCode and Weekly Challenge problem pages; each picker entry has a Sample source link. Inputs follow the argument order expected by the Jello solution. When adding a challenge, record its Added date in challenges.md and add its sourced example to the data file too. Keep the original date when updating a solution. The build uses these saved dates and examples and needs no access to Git history or the problem sites.

The settings gear in the REPL toolbar saves your preferences in this browser: live mode, examples, keywords, theme, and presentation mode. Choose the original Terminal theme or Dracula. Presentation mode centers the REPL, increases the expression and result text size, and hides the surrounding UI. The gear stays available to exit presentation mode; your examples and keywords preferences are preserved. Hiding the keyword reference keeps autocomplete and syntax highlighting available. With examples and keywords both hidden, the regular REPL automatically fills the remaining window height without a page scrollbar. Long results and history scroll inside the evaluation session. Turning either reference section back on restores normal page scrolling, keeping the reference content accessible below or beside the REPL.

Press Ctrl+Space to focus the expression input and request the compact, scrollable keyword grid. The shortcut also works from the results or elsewhere on the page, while preserving other text fields and dialogs. It stays closed while typing, clicking, or focusing the input until requested. The grid includes every matching prefix after ::; request it after a space to browse all keywords. Once open, typing filters the matches. Each cell shows the keyword and its Jelly symbol, with its type available on hover. Click a suggestion, or use all four arrow keys to navigate the grid and Enter to select one. Left/right move between columns and up/down between rows, following the current layout without moving the expression cursor. Navigation stops at the grid edges. In live mode, Tab accepts the selected suggestion and closes the dropdown while keeping focus in the editor. In manual mode, Tab completes and cycles through matches while the grid is open. With the grid closed, Tab moves focus normally. Escape or leaving the input dismisses autocomplete until the next Ctrl+Space request, restoring left/right cursor movement and up/down command history. Press Space outside a text field or dialog to focus the expression input without inserting a space; inside the input, Space types normally. Syntax highlighting uses green for monads, cyan for dyads, purple for quicks, amber for nilads and input values, and gray for separators, including in the input and evaluation traces.

The first visit loads the Rust evaluator from this site and downloads the Python runtime and dependencies from jsDelivr and PyPI in the background. Rust results do not wait for Python to initialize. Pyodide is pinned to 0.27.7 (Python 3.12) for compatibility with Jellyfish. There is no application server; both engines execute in dedicated browser workers. Shared links load the expression for you to review and run. Terminal commands such as --find-by-example are not included.

To preview locally, initialize the submodule and install Rust using rustup, then run:

python3 scripts/build_site.py
python3 -m http.server 8000 --directory _site

Open http://localhost:8000. The build compiles rust/ with the pinned toolchain and locked dependencies into _site/jello-engine.wasm, packages Python sources into _site/runtime.zip, includes runtime licenses, and generates the wordbook from src/tokens.py. Edit the interface in web/, then rebuild. Generated files in _site/ and rust/target/ are not committed.

To run the browser and adapter tests:

npm ci
npx playwright install chromium
npm test
.venv/bin/python -m unittest discover -s tests -p 'test_*.py'

Set CHROMIUM_PATH to use an existing Chromium installation. Set PLAYGROUND_URL to test a deployed site instead of a local build. GitHub Actions tests both the terminal and browser versions before deploying the static site to GitHub Pages on pushes to main. The repository's Pages publishing source should be GitHub Actions.

Challenge tests

Challenge examples save 77 examples covering all 30 solutions: every numbered example from one original LeetCode or Weekly Challenge description per solution. Each entry links to its source, and examples keep the source's numbering and expected answers. Tests run offline and execute the current programs from challenges.md; expected answers come from the descriptions, independently of the interpreters. Inputs use Jello's argument order (challenge #15 takes capacity before apples).

./tests/test_challenges.py

To run only challenge #7, including its source examples and picker sample:

./tests/test_challenges.py --challenge 7

This checks Python/Jellyfish results, including list structure: [2] and 2 remain distinct even though Jelly displays both as 2. Source booleans map to Jelly's 0 and 1. Each failing subtest identifies the challenge, source example, URL, and runnable command. Solution failures remain ordinary failing assertions for review.

Run the executable from the repository root; it uses .venv/bin/python automatically. Passing examples appear as green dots and failures as red Fs. The final summary counts passed, failed, errored, and skipped example checks and lists failing challenge numbers. Failures return a nonzero exit status. Redirected output stays plain; set NO_COLOR=1 to disable terminal colors too.

The full test_*.py command above also runs every source example through native Rust and Wasm, comparing their output and lossless typed values with Jellyfish for the same inputs, then checking the source's expected answer. Add sourced examples to this file when adding a solution; keep the picker's single default example in data/challenge_inputs.json.

Rust evaluator

The Rust evaluator implements the Jellyfish operations used by all 30 challenge examples, with Python comparisons covering varied inputs, large integers, floating-point arithmetic, Unicode, nested arrays, and diagrams in both native and Wasm builds. Install Rust using rustup to run its tests; rust-toolchain.toml pins the toolchain and WebAssembly target. Rust supports arbitrary-precision integers and finite 64-bit floats, including fractional division, mixed arithmetic, square roots, rounding, and numeric comparisons. The default average expression runs in Rust and is verified by Python. Float verification compares the exact binary values, including signed zero, as well as the displayed output. Complex and non-finite results, random operations, dynamic evaluation, Python-specific input syntax, and unsupported numeric operations use Python. Arrays and reductions remain eager, with allocation, recursion, operation, and output limits. There are no range-sum shortcuts or operation-fusion optimizations.

cargo build --locked --release --manifest-path rust/Cargo.toml
.venv/bin/python -m unittest discover -s tests -p 'test_rust.py'
.venv/bin/python scripts/build_wasm.py

Links

Jelly(fish) Links

Livestreams

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 43
Method 6
Class 4

Languages

Python100%

Modules by API surface

src/jello.py13 symbols
src/draw.py13 symbols
src/utils.py11 symbols
src/grid.py7 symbols
src/arity_notation.py5 symbols
src/test.py2 symbols
src/algorithm.py2 symbols

For agents

$ claude mcp add jello \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page