- Scheme 88.7%
- JavaScript 7.5%
- HTML 2.9%
- Makefile 0.8%
- CSS 0.1%
| phweb | Render coordinates on graph | |
| physics | Document Lorentz factor | |
| static | Restructure assets and use dist folder | |
| tests | Rename some matrix functions | |
| .gitignore | Restructure assets and use dist folder | |
| COPYING | Add README and license | |
| Makefile | Fix mkdir dist order | |
| manifest.scm | Rewrite testrunner in Scheme | |
| phweb.js | Render coordinates on graph | |
| phweb.scm | Fix Lorentz transformations | |
| README.org | Remove Bash from requirements list in README | |
| run_tests.scm | Print newline on test failure messages | |
Scheming Physics
What if we ran Scheme physics simulations on the Web? Thanks to Hoot, this is possible. This provides a Web interface for some physics relationships defined in Scheme.
Usage
Set up the environment:
guix shell -m manifest.scm
Build to WASM:
make
Launch the Web server:
make serve
Features
Scheming Physics provides functions for:
- Vector algebra
- Matrix algebra
- Unit conversions
- Lorentz transformations
Requirements
Testing
Run make test to run all tests. You must have all of the dependencies available as outlined above.
This will execute the tests both in the WASM and non-WASM environments. If you just want to run tests outside WASM (which is much faster) run make test-fast.
License
Some of this code is derived from the Hoot FFI demo which is licensed under Apache 2.0.
The rest is licensed under the GPL-3.0-or-later, as described below.
Copyright © 2026 Anna Liberty
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.