sUTL
Guide · 07 / 07

7. Larger transformations

The Studio examples show three useful scales of sUTL programming.

Reshaping a document

Paths embedded in a structural map are the simplest useful pattern:

{
  "person": {
    "fullname": "^$.name",
    "title": "Mr"
  },
  "address": {
    "line1": "^$.addr"
  }
}

This is analogous to a JSON template, but every value can be an arbitrary transform.

Interactive conformance example: JavaScript is required to edit and run it.

See the path-basic-2 example.

Transforming real data

The tweet example selects a screen name and text, recursively gathers several URL fields, and removes nulls through a library transform. It includes its original 2010 Twitter object as source data:

tweettransform

Interactive conformance example: JavaScript is required to edit and run it.

Constructing transforms

The sum and average examples demonstrate sUTL’s Lisp-like side: a transform can construct another transform, inspect it, and evaluate it. Start with:

fixedsum

Then compare the explicit scope form:

avgrefactor1

Interactive conformance example: JavaScript is required to edit and run it.

Working with the Studio catalogue

The catalogue contains:

  • 44 complete Studio bundles with source, transform, declaration, and library
  • expected results checked by the Python 3 and browser runners
  • archive timestamps and original iframe IDs
  • 12 curated guide examples
  • 19 explicit gaps where no archived Studio input has been found

The expected result makes each example executable and testable. Normative language behavior remains in the conformance corpus.

Where to go next

Use sUTL where code-as-data, immutable transformations, and portable JSON-shaped programs are an advantage. For new work, keep transforms small, test them against explicit source/result examples, use !! for higher-order scope, and compile named dependencies rather than relying on ambient libraries.

Next: Historical dialects and implementations.