GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hyperpolymath/jaffascript: JavaScript/TypeScript-syntax AffineScript — affine resource guarantees + typed-wasm output for JS/TS-shaped code

BranchesTags
Open more actions menu

Latest commit

 

History

84 Commits
84 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.devcontainer
.devcontainer
 
 
.github
.github
 
 
.machine_readable
.machine_readable
 
 
LICENSES
LICENSES
 
 
bin
bin
 
 
build/just
build/just
 
 
container
container
 
 
docs
docs
 
 
examples
examples
 
 
features
features
 
 
scripts
scripts
 
 
session
session
 
 
src
src
 
 
tests
tests
 
 
tools/invariant-path
tools/invariant-path
 
 
verification
verification
 
 
www/.well-known
www/.well-known
 
 
.affinescript-pin
.affinescript-pin
 
 
.editorconfig
.editorconfig
 
 
.envrc
.envrc
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.guix-channel
.guix-channel
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.tool-versions
.tool-versions
 
 
0-AI-MANIFEST.a2ml
0-AI-MANIFEST.a2ml
 
 
ARCHITECTURE.adoc
ARCHITECTURE.adoc
 
 
AUDIT.adoc
AUDIT.adoc
 
 
CHANGELOG.adoc
CHANGELOG.adoc
 
 
CODE_OF_CONDUCT.adoc
CODE_OF_CONDUCT.adoc
 
 
Containerfile
Containerfile
 
 
EXPLAINME.adoc
EXPLAINME.adoc
 
 
GOVERNANCE.adoc
GOVERNANCE.adoc
 
 
Justfile
Justfile
 
 
LICENSE
LICENSE
 
 
MAINTAINERS
MAINTAINERS
 
 
MAINTAINERS.adoc
MAINTAINERS.adoc
 
 
PROOF-NEEDS.adoc
PROOF-NEEDS.adoc
 
 
PROOF-STATUS.adoc
PROOF-STATUS.adoc
 
 
QUICKSTART-DEV.adoc
QUICKSTART-DEV.adoc
 
 
QUICKSTART-MAINTAINER.adoc
QUICKSTART-MAINTAINER.adoc
 
 
QUICKSTART-USER.adoc
QUICKSTART-USER.adoc
 
 
READINESS.adoc
READINESS.adoc
 
 
README.adoc
README.adoc
 
 
ROADMAP.adoc
ROADMAP.adoc
 
 
SECURITY.adoc
SECURITY.adoc
 
 
TEMPLATE-STANDARDS-AUDIT.adoc
TEMPLATE-STANDARDS-AUDIT.adoc
 
 
TEST-NEEDS.adoc
TEST-NEEDS.adoc
 
 
TOPOLOGY.adoc
TOPOLOGY.adoc
 
 
contractile.just
contractile.just
 
 
coordination.k9
coordination.k9
 
 
eclexiaiser.toml
eclexiaiser.toml
 
 
jaffa.just
jaffa.just
 
 
jaffascript_chora.deed
jaffascript_chora.deed
 
 
llm-warmup-dev.adoc
llm-warmup-dev.adoc
 
 
llm-warmup-user.adoc
llm-warmup-user.adoc
 
 
manifest.scm
manifest.scm
 
 
mise.toml
mise.toml
 
 
selur-compose.toml
selur-compose.toml
 
 
setup.sh
setup.sh
 
 
stapeln.toml
stapeln.toml
 
 

Repository files navigation

License: MPL-2.0

JavaScript / TypeScript-syntax AffineScript. Write code that looks like JS or TS, get affine resource guarantees and typed-wasm output.

What it is

JaffaScript is AffineScript with its jaffa face pre-selected. If you write JavaScript or TypeScript, you already know most of the syntax. The compiler checks that your resources (files, sockets, tokens, handles) are used exactly as many times as you declare — and proves it at compile time. No null pointer exceptions. No use-after-free. No silent data races. No GC overhead.

This repo is a brand surface only. The compiler, type checker, borrow checker, and codegen all live in affinescript. This repo carries:

  • Examples idiomatic to JS / TS developers

  • Documentation aimed at the web-development community

  • A jaffa shim CLI that aliases affinescript --face jaffa

  • Tutorial and migration guides for moving TypeScript codebases into a strongly-typed, affine-typed, WASM-targeting world

Hello

examples/hello.affine:

// face: jaffascript

function main() -{IO}-> () {
  const greeting = "Hello, JaffaScript!";
  println(greeting);
}

function, const, ===, null/undefined, import { x } from "module" — all lower to canonical AffineScript and produce the same typed-wasm output as every other face.

Install

opam install affinescript
git clone https://github.com/hyperpolymath/jaffascript
cd jaffascript

The affinescript binary does the work. The bin/jaffa shim in this repo just defaults the --face flag.

Use

# Direct, via affinescript:
affinescript eval --face jaffa examples/hello.affine
affinescript compile --face jaffa examples/hello.affine -o hello.wasm

# Or via the jaffa shim (same thing):
./bin/jaffa eval examples/hello.affine
./bin/jaffa compile examples/hello.affine -o hello.wasm

# Or via the `jaffa` just module (jaffa.just):
just jaffa run examples/hello.affine
just jaffa preview examples/hello.affine    # show the canonical lowering

Source files use the canonical .affine extension. The face is selected by the pragma on the first comment line, or by the --face jaffa flag.

Different faces, same cube

JaffaScript is one of six established faces over the AffineScript core:

  • AffineScript — the canonical face

  • RattleScript — Python-style

  • JaffaScript — JavaScript / TypeScript-style (this repo)

  • LucidScript — PureScript / Haskell-style

  • CafeScripto — CoffeeScript-style

  • PseudoScript — pseudocode-style

All six share the canonical .affine extension and lower to the same AST. Errors are reported in face-appropriate vocabulary.

Why JaffaScript

JavaScript and TypeScript are the dominant languages of the web. TypeScript adds structural typing on top of dynamic JS, which catches a lot of bugs but doesn’t help with: ownership, resource leaks, effect tracking, formal proofs, or portable native compilation. JaffaScript is a JS-shaped on-ramp to a language that adds all of those — without forcing you to abandon brace syntax, arrow functions, or import { x } from "module".

For a TypeScript developer migrating in, the steps are:

  1. Rename .ts files to .affine and add at the top.

  2. Replace import { … } from "module" (TS) with the same syntax in canonical AffineScript form.

  3. Replace null/undefined with () (canonical unit) in semantics-relevant positions.

  4. Keep writing === — the face transforms === → == automatically.

  5. Compile to typed-wasm; the output runs in browsers, Node, Deno, Wasmtime, and any WASI runtime.

Status

Alpha. The face transformer is implemented in affinescript/lib/js_face.ml. Known limitations are tracked in the affinescript faces README under “Known transformer gaps”.

License

This project is licensed under the Mozilla Public License, v. 2.0. See the LICENSE file for details. Documentation is licensed CC-BY-SA-4.0.

SPDX-License-Identifier: CC-BY-SA-4.0

About

JavaScript/TypeScript-syntax AffineScript — affine resource guarantees + typed-wasm output for JS/TS-shaped code

github.com/hyperpolymath/jaffascript

Topics

affinescripteffect-typedepistemic-computingepistemic-infrastructureequivalence-aware-computingfacehyperpolymathjavascriptjustlanguage-designmulti-syntax-languageopen-sourceprogramming-languagereproducible-researchresearch-softwareresource-safe-wasmtype-theorytyped-provenanceveridical-computingwebassembly

Resources

Readme
MPL-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.