Skip to route content
Implemented

Source and runtime reference

Run an exact Hara source revision in a named session.

A session is one identifiable runtime context with a generation, requested and actual backend, source revision, capabilities, events, diagnostics, and result records. The Playground keeps those facts beside the editor rather than treating execution as an unlabelled preview.

docs.live-example@2.1.0 learn.exercise@2.0.0 learn.project@2.0.0

Samples and repository source

Choose a sample or load exact repository coordinates.

A sample record names its source revision, backend, required capabilities, and current availability. Experienced users and agents may enter repository coordinates directly.

Load exact sourceRepository · branch · path · revision
Ready to load
Exact source available.A new session will be created; the current session will not be modified.
Recent sessionsBrowser-local until saved
  • 12 minutes ago
  • Yesterday
  • 3 days ago

Coding workspace

Source, result, diagnostics, and session facts share one workspace.

Dense and comfortable modes change spacing only. The control pane is optional and dismissible; runtime identity and capability facts remain available.

Primary surface · unified live session

One studio, five operational modes.

The editor stays primary while project navigation, controlled front matter, canvas output, and observations remain attached to the same session envelope.

Ready session:pg-7a91 gen 4 rev 9f3c2ab7 seq 148
main.hara
HaraUTF-8Ln 1, Col 1
latest · seq 148
{:status :ready
 :backend :interpreter
 :frames 2814
 :receipt "runtime:exec-2048"}
Console / observationsmonotonic sequence
  1. 146runtime.value:ribbon-count 12generation 4
  2. 147runtime.receiptexec-2048 committedsource 9f3c2ab7
  3. 148lifecyclereadyinterpreter
Ready session pg-7a91 generation 4 source 9f3c2ab7
backend interpreter · event 148 · receipt exec-2048

Density is presentation state. Session, source, backend, capability, diagnostic, and receipt facts remain unchanged.

Documentation and product embeds

The same live-example contract at two useful scales.

Inline examples keep the document primary. Expanded embeds can reveal files and sessions, but Canvas and 3D remain absent unless the exact example advertises them.

docs.live-example Transform one value documentation-sized · editable
Open in Playground ↗
(defn ribbon-field
  [{:keys [count width decay]
    :or   {count 12 width 0.42 decay 0.18}}]
  (canvas/field
    {:ribbons count
     :trail-width width
     :signal-decay decay
     :palette :hara/signal}))
Idle
{:status :idle
 :result nil}
session:embed-inline generation:1 source:9f3c2ab7 backend:interpreter
Capabilities unavailable

Run remains useful without a fabricated control pane.

This documentation example advertises evaluation, cancellation, and structured values. It does not advertise Canvas, 3D, filesystem mutation, or package publication.

eval.form
available
session.cancel
available
canvas.controls
unavailable
three-d.scene
unavailable
Expanded embed

Editable project example with optional live controls.

Open in Playground
example.haraeditable · source revision 9f3c2ab7
Ready session embed-2b10 generation 2
source 9f3c2ab7 · sequence 37

Sharing and embedding

A shared link records exact source coordinates.

Links include repository, branch, path, revision, requested backend, and editability. Runtime receipts remain references to runtime-owned facts.

Exact project linkPortable source reference
Embed mode
Generated integration code
<hara-live-example
  content-id="hara:docs:live-example:ribbon-field"
  repo="hara-lang/hara-playground"
  branch="main"
  path="samples/supersonic-live/main.hara"
  revision="9f3c2ab7"
  backend="interpreter"
  editable
  controls="sessions,files">
</hara-live-example>

The host may request controls and editability. The runtime response determines the actual backend, capabilities, source fence, and receipt.

Portable Hara publication form
{:schema hara.docs/live-example
 :schema-version "2.1.0"
 :content-id "hara:docs:live-example:ribbon-field"
 :source {:repo "hara-lang/hara-playground"
          :branch "main"
          :path "samples/supersonic-live/main.hara"
          :revision "9f3c2ab7"}
 :runtime {:backend :interpreter
           :capabilities [:eval :cancel :canvas :observations]}}
Private / unpublished

This project has no public route.

Only the owner and explicitly authorised collaborators can resolve the content identity. A copied URL does not grant access.

Stale link

Revision 72aa901 is no longer current.

The exact historical source remains available. Opening the latest revision requires an explicit replacement action.

Mobile and touch

Run first. Edit only when requested.

The initial Run action keeps the software keyboard closed. Text input focus is granted only by the explicit Edit control.

‹
Ribbon fieldinterpreter · ready
main.hararev 9f3c2ab7gen 4
Read-only until Edit
ResultReady
{:ribbons 12
 :frames 2814
 :status :ready}
1 diagnostic · inspect without page overflow

main.hara:18:7 Trail width was clamped to the supported preview range.

session pg-7a91 seq 148
Initial action

Run does not focus the editor.

Execution updates the result and status region while preserving the current viewport and closed keyboard.

Explicit input

Edit unlocks and focuses source.

The focus transition is intentional, user-triggered, and reversible by leaving edit mode.

Collapse order
  1. Optional Canvas and 3D controls disappear first.
  2. Files and Sessions move into a bottom sheet.
  3. Result follows the editor in document order.
  4. Diagnostics remain scrollable inside their own region.
Touch contract

Transport remains one-thumb operable.

Run, Cancel, Edit, and disclosure controls retain at least 44px touch height without forcing horizontal page overflow.

Ownership and adoption

The interface presents runtime state; it does not author runtime facts.

Visual Language

Workbench geometry, tabs, controls, responsive yielding, status presentation, focus treatment, and capability-aware slot composition.

Public Playground

Repository loading, project navigation, editor state, saved sessions, account behaviour, sharing policy, and application commands.

Docs embed

Surrounding explanation, live-example placement, read-only or editable request, expansion control, and open-in-Playground handoff.

Runtime

Session identity, generation, source revision, backend, capabilities, monotonic events, replacement, cancellation, disposal, observations, and receipts.

See the front-matter contract, the workbench reference, and V2-PLAYGROUND.md for the implementation boundary.