Examples

Example Technique procedures

To give a sense of the flavour of the language, here are a small selection of Technique source files.

Systems and Operations

One of the original use cases behind this work was wanting to document the procedures used in systems administration and network operations. This example shows a simple list of such tasks:

local_network :

# Local Network Connectivity

Establish that the local network environment is functioning.

    1.  Check physical network interface { exec(
        ```bash
            ip addr
        ```
        ) } and look for eth0 being marked UP.
    2.  Check local network connectivity
    3.  Check local DHCP is working
    4.  Check local DNS responding
    5.  Verify reachability of local network gateway

NetworkProbe.tq

Recipes

Preparing a meal during the holidays is also a list of tasks, but often more than one person needs to do things concurrently:

roast_turkey(i) : Ingredients -> Turkey

# Roast Turkey

    @chef
        1.  Set oven temperature { oven(180 °C) ~ temp }
        2.  Place bacon strips onto bird
        3.  Put bird into oven
        4.  Set timer for roasting { timer(3 hr) ~ t }
        5.  Record temperature
            {
                [
                    "Roast temperature" = temp
                ]
            }

    @assistant
        -   Set the table

ChristmasTurkey.tq

Instructions

This from a set of instructions guiding staff on what to do when an incident occurs:

% technique v1
! CC BY 4.0; © 2020 Athae Eredh Siniath, and Others

emergency_procedure : Incident -> Calm

# Instructions

Don't Panic!

In the event of an incident, clear thinking is key. Challenge yourself to form
more than one hypothesis, and generate multiple options. The first solution
you think of is rarely the best one.

As you consider options available, think of our values. Never forget the needs
of our customers and the trust they have placed in us.

    1.  <ensure_safety>
    2.  <communicate>
    3.  { repeat <incident_action_cycle> }

ensure_safety : Available -> Ready

# Safety First

Ensure your physical environment is free from danger, take measures to
maximize digital security, and establish reliable connectivity.

    -   Ensure physical and digital safety
    -   Establish connectivity

DontPanic.tq

Larger Processes

Finally, an example showing using Technique to describe a much larger procedure — in this case the entire process of doing systems engineering on a software project. This pushes the limits of what the language is for, but nevertheless illustrates that Technique can be used for very large structures as well as very detailed ones:

III. Implementation

design_and_build : Requirements -> System

# Engineering Design, Build, and Verification

    4.  Engineering Design <engineering_design>(requirements) ~ designs
    5.  Software Development
        { foreach design in designs }
            a.  <implement>(design) ~ component
    6.  Integration Testing
        { foreach (design, component) in zip(designs, components) }
            a.  <integration_testing>(design, component)

engineering_design : Requirements -> [Design]

# Engineering Design

Given a set of requirements the engineering profession can undertake detailed
analysis and turn the _idea_ into a technical _design_ for how the problem
will be approached and what is actually to be built.

implement : Design -> Component

# Build and Test

    1.  Prototypes and explorations <prototypes>(design)
    2.  Software Development <build_software>
    3.  Local Testing and Experimentation <local_experiments>

SystemsEngineeringProcess.tq

Detailed examples can be found in the examples/ and tests/ directories of the main repository. Documents written in Technique have file extension *.tq.