Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/a11ce/racket-p5
https://github.com/a11ce/racket-p5
art racket
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/a11ce/racket-p5
- Owner: a11ce
- License: mit
- Created: 2021-11-10T10:15:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-19T17:03:52.000Z (over 1 year ago)
- Last Synced: 2024-06-21T08:13:49.472Z (7 months ago)
- Topics: art, racket
- Language: Racket
- Homepage:
- Size: 26.4 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# racket-p5
Uses [soegaard](https://github.com/soegaard)'s [urlang](https://github.com/soegaard/urlang) compiler to give p5.js Racket-y syntax.
## Setup
Run `raco pkg install p5` or go to `File > Install Package...` in DrRacket and install p5.
## Usage
Start your file with `#lang p5`, then do your best to write p5 code with Racket syntax and it should mostly work how you expect. Also see `examples/`.
Running your program will display the compiled p5.js sketch.
### Options
Certain top-level expressions (prefixed with `^`) are recognized as language options. They are applied per source file.
- `(^output-file "filename.js")` writes the compiled JS to the specified path.
## How it works
`#lang p5` is a wrapper around urlang which:
- makes urlang think that p5 identifiers are bound
- adds the needed boilerplate so the user can focus on creating
- provides some extra options## Demos
- [space-draw](https://a11ce.com/racket-p5/examples/space-draw/space-draw.html)
- [Unknown Pleasures](https://a11ce.com/racket-p5/examples/unknown-pleasures/unknown-pleasures.html)---
All contributions are welcome by pull request or issue.