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/pseudoscript: Pseudocode-syntax AffineScript — first-language for CS pedagogy that compiles and runs

BranchesTags
Open more actions menu

Latest commit

 

History

63 Commits
63 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.github
.github
 
 
.machine_readable
.machine_readable
 
 
LICENSES
LICENSES
 
 
bin
bin
 
 
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
 
 
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
 
 
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
 
 
REQUIRES_INITIALISATION.adoc
REQUIRES_INITIALISATION.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
 
 
justfile
justfile
 
 
llm-warmup-dev.adoc
llm-warmup-dev.adoc
 
 
llm-warmup-user.adoc
llm-warmup-user.adoc
 
 
mise.toml
mise.toml
 
 
selur-compose.toml
selur-compose.toml
 
 
setup.sh
setup.sh
 
 
stapeln.toml
stapeln.toml
 
 

Repository files navigation

PseudoScript

License: MPL-2.0

Pseudocode-syntax AffineScript. The pseudocode you wrote in your algorithms textbook actually compiles and runs.

What it is

PseudoScript is AffineScript with its pseudo face pre-selected. If you learned algorithms from CLRS, Sedgewick, or any first-year course, you already know the syntax: function name(…​) do … end, set x to expr, output expr, if condition then … else … end if, for x in list do … end for, is / is not, and / or / not, yes / no. 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, while reporting errors in beginner-friendly vocabulary rather than compiler jargon.

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

  • Examples that match common textbook pseudocode (CLRS, Sedgewick, etc.)

  • Documentation aimed at CS students and educators

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

  • Tutorial materials suitable for an intro algorithms course

Hello

examples/hello.affine:

-- face: pseudoscript

effect IO {
  fn println(s: String) -> ();
}

function main() -{IO}-> () do
    set greeting to "Hello, PseudoScript!"
    output greeting
end

function … do … end, set x to …, output x, is / is not, yes / no — all lower to canonical AffineScript and produce the same typed-wasm output as every other face. Errors come back in the vocabulary your textbook taught you ("`x` has not been defined. Declare it with set x to …​ or as a function parameter.") rather than compiler-jargon.

Install

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

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

Use

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

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

# Or via the justfile:
just run examples/hello.affine
just preview examples/hello.affine    # show the canonical lowering

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

Different faces, same cube

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

  • AffineScript — the canonical face

  • RattleScript — indentation / scripting style

  • JaffaScript — JavaScript / TypeScript-style

  • LucidScript — PureScript / Haskell-style

  • CafeScripto — CoffeeScript-style

  • PseudoScript — pseudocode-style (this repo)

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

Why PseudoScript

The catchment is smaller than RattleScript or JaffaScript by raw headcount, but unusually defensible. CS pedagogy is pseudocode-first by tradition; the gap between "what the textbook says" and "what compiles" has been there for fifty years. Every CS textbook on Earth uses pseudocode for examples, yet there’s no other language where the pseudocode you wrote in week 1 actually executes — Scratch is graphical-only, conventional scripting languages are closer but still impose their own keywords and ceremony. PseudoScript closes that gap, giving students a way to:

  1. Write the algorithm exactly as the textbook describes it.

  2. Get type errors in pedagogy-friendly language ("the if branch produces X but the else branch produces Y — both branches must produce the same type") instead of compiler jargon.

  3. Compile to typed-wasm and actually see the algorithm run.

  4. Migrate to a more conventional face (Rattle, Jaffa) once they’re comfortable with programming-as-distinct-from-pseudocode.

Status

Alpha. The face transformer is implemented in affinescript/lib/pseudocode_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

Pseudocode-syntax AffineScript — first-language for CS pedagogy that compiles and runs

github.com/hyperpolymath/pseudoscript

Topics

affine-typesaffinescriptcomputer-science-educationepistemic-computingepistemic-infrastructureequivalence-aware-computinghyperpolymathjustlanguage-designmulti-syntax-languageopen-sourceprogramming-languagepseudocodereproducible-researchresearch-softwareresource-safe-wasmteachingtype-theorytyped-provenanceveridical-computing

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.