docs: add a code example and checker findings to the landing page - #995
Open
crowecawcaw wants to merge 1 commit into
Open
docs: add a code example and checker findings to the landing page#995crowecawcaw wants to merge 1 commit into
crowecawcaw wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.