Functional Weave
Code in Python

Install the fune CLI

fune finds functions, builds them into your project in TypeScript, Python or Rust, and publishes your own. It is one Node.js package with no dependencies.

Current version 0.1.0, 279 KB · sha512-vRHnhlO/GzkWaK5+HR8gdNNUqr2M5X8yrWA/0eBV6GA6C7SV6cnBUENblmSGbLrRZv7cZCFBiG5PSsHv1slI5Q== · fune-0.1.0.tgz

1. Install

You need Node.js 22.6 or newer. Then:

npm install -g https://functionalweave.com/install/fune.tgz
fune --version

Or run it without installing, with npx:

npx --yes --package https://functionalweave.com/install/fune.tgz fune search "add vat to a price"

To upgrade, run the same npm install -g again. To remove it: npm uninstall -g @functionalweave/fune.

Building a project needs only Node. Running a function's test vectors (fune verify) also uses the language's own toolchain: python3 for Python, cargo for Rust, and tsc (optional) to check TypeScript signatures.

2. Use a function in a project

cd my-app
fune init                          # fune.project: language, registry
fune search "split an amount into equal parts"
fune add money.allocate            # pins it in fune.project and builds it

Then name it where you use it, in one line, and run fune build:

import { allocate } from "#fune/money.allocate@^1";            // TypeScript
from fune.money.allocate import allocate  # money.allocate@^1    # Python
fune!(money.allocate@^1);                                          // Rust

fune build writes fune.lock and the code into .fune/build; fune check is the CI gate. fune hook wires the build into your project's own.

3. Start from a suite

A suite is a named set of functions for one kind of app — accounting, user accounts, an online shop — in build order, with the gaps it leaves for you. Add all of a suite's functions at once:

fune suites                        # every suite
fune suite auth                    # one, as a plan with each one-line reference
fune suite add auth --core-only    # require its functions, then build

4. Sign in

Reading the registry needs no account. To publish, create an account, confirm your email, then:

fune login                         # approve the code in your browser
fune whoami

fune login --password asks for your username and password in the terminal instead. On CI, make a token in your settings and set FUNE_TOKEN, or run fune login --token "$FUNE_TOKEN".

Publishing happens under a namespace: create an organisation and claim the prefix your ids will start with (acme for acme.text.shout). Namespaces explains who may publish what.

5. Publish a function

fune new acme.text.shout           # acme.text.shout/1.0.0: function.fune, impl/, vectors.json
# write the signature, the implementations and at least 8 vectors, then:
fune validate acme.text.shout/1.0.0
fune verify acme.text.shout/1.0.0  # every vector, in every language installed here
fune publish acme.text.shout/1.0.0 --wait

The upload is pending until the registry has run its tests in a sandbox, in every language it ships. --wait waits for the verdict; without it, fune status acme.text.shout@1.0.0 asks later. It ends published (installable with fune add acme.text.shout), rejected with the sandbox's report (fix it and publish the same version again), or needs review (a publisher's first versions are approved by a person). Published versions never change: a fix is a new version.

The full guide — the manifest, types, vectors, groups, dependencies — is Publishing.

6. Publish a suite

Bundle the functions an app of yours needs as a suite of your own, so other projects (and AI agents) can start from it:

fune suite new acme.billing-app    # acme.billing-app.suite
# list sections of core and optional functions, then:
fune suite validate acme.billing-app.suite
fune suite publish acme.billing-app.suite
# and in any project:
fune suite add acme.billing-app

A suite's id starts with a namespace your organisation owns, and every function it lists must be on the registry (published, or uploaded and still being verified; a rejected one is refused). It has no code, so there is no sandbox: it is live as soon as it is accepted. Publishing the same id again replaces it; fune suite unpublish removes it.