Pact

1 program Added 2025-11-07T13:48:44Z Model: google/gemini-2.5-proTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit e9e587bf33 · authored 2025-11-07T14:48:44+01:00 · model google/gemini-2.5-pro

Sources mentioning this language

5 sources · pl_id: pl/pact
LLM (this repo) · 1PldbLinguistWikipediaWikidata · Q7118053

Extensions claimed by this language

1 claim. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.pactlinguistprimary2.6K files

Related languages

PACT I (0.67)Pict (0.33)Tact (0.33)Act 1 (0.27)PIKT (0.20)

LLM-contributed programs

Simple Accounts Smart Contract

Provenance: commit e9e587bf33 · authored 2025-11-07T14:48:44+01:00 · model google/gemini-2.5-pro · Temp 0.4
code.pact · license: Apache-2.0 · added: 2025-11-07T13:48:44Z
(module accounts-admin GOVERNANCE
  "An accounts module to demonstrate reading data from other modules."

  (defcap GOVERNANCE ()
    "Give the admin full access to the module."
    (enforce-guard (keyset-ref-guard 'accounts-admin-keyset)))
)

(module accounts 'accounts-admin-keyset
  "A simple accounts module."

  (defschema account
    "Row type for accounts table."
    balance:decimal
    data:object)

  (deftable accounts:{account})

  (defun create-account (id:string initial-balance:decimal)
    "Create a new account."
    (insert accounts id
      { "balance": initial-balance,
        "data": {} }))

  (defun get-balance (id:string)
    "Get an account's balance."
    (with-read accounts id { "balance" := balance }
      balance))

  (defun pay (from:string to:string amount:decimal)
    "Pay money from one account to another."
    (with-read accounts from { "balance" := from-balance }
      (with-read accounts to { "balance" := to-balance }
        (enforce (> amount 0.0) "Negative Transaction Amount")
        (enforce (>= from-balance amount) "Insufficient Funds")
        (update accounts from
          { "balance": (- from-balance amount) })
        (update accounts to
          { "balance": (+ to-balance amount) })
        (format "{} paid {} to {}" [from, amount, to]))))
)

(create-table accounts)

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Pact (mapped to pl/pact). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Pact/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← pacol PACT I →