Language

What makes Program different.

Program is a reactive language that takes care of the hard parts: concurrency, updates and wiring, so you describe what you want to see and the runtime makes it happen.

Program uses a novel two-way data binding and reverse computation system to avoid event handlers, letting you read locally while it deals with global updates.

Every keyword, in one program

Every keyword in the language, in one short program: a module holding a record, a tagged union, a function with native implementations, and a function that wires up state, a write-back and a return. Each keyword has its own page under keywords.

MODULE App
  TYPE Profile
    FIELD Text name
    FIELD Maths.Integer age

  TYPE Status
    OPTION App.Profile active
    OPTION Text pending

Data records and tagged unions give you full type safety.

  FUNCTION Text Greet
    INPUT Text name
    NATIVE js    "return 'Hi ' + name;"
    NATIVE dart  "return 'Hi ' + name;"
    NATIVE swift "return \"Hi \" + name"

Provide native implementations in any of the supported target languages.

  FUNCTION Text Welcome
    INPUT BINDING App.Profile profile
    HOLE Text row
      INPUT Text line

Functions can be defined with inputs that can have two-way data binding, and holes that the caller fills in.

    STATE Maths.Integer count = 0
    STATE LOCKED Network.Web.Response saved = null

State can live anywhere within the call stack, and can start off locked if it is going to be set asynchronously.

    REVERSE App.Profile submit
      LET Network.Web.Response response = Network.Web.Client.Post profile
      SET saved = response

Use reversibility instead of event handlers, for effortless composable interaction.

    LET Text label = Maths.Integer.ToString count
    = label

Start here

Module reference

The standard library, grouped into four categories. Browse them all in the modules.