Ting IDE

A short offline guide · optional desktop editor and compiler

Getting started

Every tab edits a section of the same .ting source. Save writes that one file. Compile creates a separate .tingir program beside it.

  1. Click New. The starter already contains a fact type, an output type, a rule and a passing test.
  2. In General, give the module a name. Keep Program for a normal reasoning program.
  3. Visit Data, Rules and Tests to edit the example.
  4. Click Save and choose a location. Click Compile.
  5. Read Build feedback. Double-click a located error to visit its source.

Knowledge and Decisions are optional. Leave them empty until you need them. Each editing box omits its outer section heading and removes the outer two-space indentation. The IDE restores both when it saves.

General — identify your program

ControlWhat to enter
Module nameA stable name such as my_program or equipment.inspection. Use ASCII letters, digits and underscores; identifiers cannot start with a digit.
VersionThree numbers, such as 1.0.0. This is your module’s version.
Build asProgram for a complete reasoning plan; Library for reusable exported declarations; Tests only for a module that can be checked and tested but cannot be compiled for deployment.
LibrariesMap imported module names to source files and edit imports or exports. Most single-file programs do not need this.

The summary counts the document’s declarations. It is not a validation result. Use Full source to add documentation: paragraphs, comments or explicit language features.

Data — define the shapes of facts and results

Choose Fact types, Output types or Classifications in the drop-down. Define each type once. Every field is required and its value must have the declared type.

Example for the Fact types box:

schema Item:
  name: text required
  ready: boolean required

Example for the Output types box:

conclusion ReadyItem:
  name: text required

Supported scalar names are text, integer, float, boolean, bytes and null. A union can be written text | null required. Array syntax requires requires feature arrays in Full source; consult the bundled language manual.

Classifications are optional. For an existing Item fact type, class Ready applies_to Item declares a classification. Membership must be established explicitly; an Item is not automatically Ready. The IDE enables the classifications feature when this box gains a declaration.

Knowledge — facts included in every program session

Use this tab for fixed facts, such as reference thresholds. These are immutable seeds: editing them requires recompiling and starting a new engine.

seed example_item: Item:
  name: "fixed example"
  ready: true

The fact type must exist in Data or be imported. Every field must be supplied. The IDE adds the seed-facts feature when needed. Tests use this knowledge only when they explicitly include given seed.

Rules — when something is true, produce a result

Each rule has a unique name, a when block and a then block. A binding captures a field value; use refers to that binding later.

rule recognize_ready_item:
  when:
    match Item:
      name: bind name
      ready: true
  then:
    conclude ReadyItem:
      name: use name

This rule reports each ready Item by name. Use derive FactType: to produce another fact for further reasoning, or conclude OutputType: to report a typed result. All output fields must be present.

Insert example inserts editable syntax and gives its declaration a distinct name. It does not infer your data model. Adjust the referenced types and fields. Use Check to find incorrect references before running tests.

Decisions — name a reusable assessment

This tab is optional. It stores a decision request with a goal, candidate list, requirements and an evidence conclusion. Ordinary rules produce the supporting or opposing evidence.

decision ChooseItem:
  goal: "choose_item"
  candidates: ["first", "second"]
  requirements: ["ready"]
  evidence: Evidence
  closed: true
  policy: "unique-feasible-v1"

The corresponding Output type must be:

conclusion Evidence:
  goal: text required
  candidate: text required
  requirement: text required
  satisfied: boolean required
  reason: text required

Write rules that conclude Evidence for the named goal, candidate and requirement. satisfied supplies supporting or opposing evidence; reason records a reason code. Set closed: true only when the candidate domain is intentionally complete. Missing evidence does not prove a requirement is satisfied.

The IDE enables the decisions feature when needed. The compiled request is retrieved and assessed through Ting’s runtime API; Compile does not by itself choose a winner. See the separate offline language manual for complete decision examples and the meaning of selected, tied, missing, conflicting and incomplete outcomes.

Tests — examples with expected results

Each test starts in a fresh session. Supply facts under given and expected conclusions under expect. The expected collection must match exactly. firings is an optional exact rule-firing count.

test ready_item_is_reported:
  given:
    fact Item:
      name: "example"
      ready: true
  expect:
    conclusion ReadyItem:
      name: "example"
  firings: 1

For a negative case, use ready: false, an empty expect: block and firings: 0. Add a standalone given seed before given: when the test should include fixed Knowledge. Test fixtures are not deployed as live input facts.

Test runs the root file’s tests. Compile runs them before publication. Imported providers’ tests are not automatically run; open and test those libraries separately. Zero tests is reported explicitly and is not a claim of behavioral coverage.

Libraries — optional additional source files

  1. Open General → Libraries.
  2. Choose Add library file. Select a .ting file with role library. Its module name and path are filled in.
  3. In the Imports box, name its exact version and selected exported declarations.
  4. Click Apply, then Check.
from shared.types version "1.0.0":
  schema SharedFact

A provider exposes names through its Exports box, for example schema SharedFact. Add mappings for transitive imported modules as well. Merely placing a file in the same directory does not resolve an import. Module identities and exact versions must match.

Path mappings are remembered in local application settings for this source path. To move a project to another computer, bring its source libraries and reattach the mappings there. No hidden sidecar is needed for a self-contained source file. A fully linked program’s .tingir contains its selected definitions; a reusable compiled library may still require other providers during linking.

Open, save and return to your work

The custom Open dialog shows folders and .ting files on the left and a structure preview on the right. Select a file to see its module, role, size and declarations. Preview is bounded to 500 declaration names and does not run or semantically validate rules. A file with syntax errors can still be opened for repair.

Save writes the current source atomically. Save as chooses another path. The IDE checks whether an opened source has changed on disk and preserves your editing buffer if it detects a conflict. Use Save as to keep those edits or reopen the external version.

The last successfully opened or saved source reopens automatically on launch, along with its locally remembered library mappings. A missing or moved file produces a message in Build feedback and leaves a new starter available. Unsaved edits are protected by Save/Discard/Cancel prompts when switching files or closing.

The IDE reopens the saved file; it does not promise crash recovery of unsaved text. Save regularly. Use ting-ide --fresh to bypass automatic reopening, or ting-ide path/to/program.ting to open a particular file.

Compile and understand feedback

Toolbar actionEffect
CheckChecks source, bindings, types and imported modules without publishing output.
TestChecks the source and runs its embedded tests, using the current editor contents.
CompileSaves source when needed, checks it, runs tests, compiles and verifies staged output, then atomically publishes program.tingir beside program.ting.
StopTerminates the active build process. Cancelled and failed builds do not replace the previous output.

File reads and previews, validation, tests and compilation use background processes. The progress strip names the real stage currently running. It is an activity indicator, not an estimated percentage. The startup splash reports artwork, help, workspace construction and source restoration.

You can continue editing during a build. The result belongs to the snapshot submitted at the start. If newer edits exist, the IDE marks the result as belonging to an earlier snapshot; compile again to update it. Located diagnostics navigate only while their snapshot still matches.

The editor accepts UTF-8 source up to 8 MiB and 250,000 lines, with bounded source-graph and compiler limits. Files open in a worker; editing boxes are populated only when visited. Syntax coloring is omitted for boxes larger than 256,000 characters. Compiler and test execution budgets still apply. This keeps oversized work from silently becoming unbounded.

A .tingir program requires a compatible Ting Reasoner runtime. It is not a native executable. The IDE’s Test action exercises example sessions; an application supplies live facts and invokes the runtime API.

Full source, editing and shortcuts

Full source shows the complete file, including comments, features, imports and documentation. Apply refreshes the section tabs. If a file has duplicate or unsupported top-level section headings, the section editors become read-only until Full source repairs it. The IDE preserves unedited regions and does not silently discard unsupported text.

Right-click editing boxes for custom Undo, Redo, Cut, Copy, Paste, Select all and indentation actions. Right-click trees to copy or expand their contents. Hover over controls for concise explanations.

ShortcutAction
Ctrl+N / Ctrl+O / Ctrl+SNew / Open / Save
Ctrl+Shift+SSave as
F5 / F6 / F7Compile / Check / Test
Shift+F5Stop build
Ctrl+Shift+EFull source
Ctrl+FFind in current section
Tab / Shift+TabIndent / remove two-space indentation
F1Offline IDE guide

Drag the custom title bar to move a window, double-click it to maximize or restore, or drag any edge/corner to resize. Menus, controls and icons use the same light Ting palette throughout.