Skip to content

docs: add a code example and checker findings to the landing page - #995

Open
crowecawcaw wants to merge 1 commit into
p-org:masterfrom
crowecawcaw:claude/landing-page-code-example-513kzv
Open

docs: add a code example and checker findings to the landing page#995
crowecawcaw wants to merge 1 commit into
p-org:masterfrom
crowecawcaw:claude/landing-page-code-example-513kzv

Conversation

@crowecawcaw

Copy link
Copy Markdown
Contributor

As a developer interested in P, the first thing I looked for was a code sample to see what the language looked like. The next thing I wanted to understand was what sort of issues it flags. The P docs have plenty of prose about both, but I didn't find an easy-to-understand example in the docs.

This PR adds a small example to the homepage so people interested in P can see what the language looks like and what the tooling does.

PR offered as an idea. Totally ok if maintainers decide to simply close it. If you all like the idea but not the example, I'm happy to swap it out for something else.

Testing the example by running it.

Screenshot 2026-08-03 at 9 57 34 AM

Show visitors real P code before anything else: a minimal Bank model
paired with the NoOverdraft safety spec it violates, beside the checker
output that finds the bug, placed below the toolchain diagram.

The model is deliberately tiny but has a real off-by-one: it checks that
the requested amount fits, then deducts the amount plus a $1 fee, so
withdrawing the full balance drives it to -1.

Both blocks are verified, not illustrative. The spec and model compile
with `p compile` (0 warnings, 0 errors) and `p check -tc tcWithdraw
-s 1000` reports the NoOverdraft violation on every seed tried; the
checker output shown is taken from a real run rather than invented.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JPYDKaGpiA9nLZji3wsiQh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant