Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds doc with suggestions for stdlib dev. #1028

Merged
merged 3 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
'/guide/': [
{
title: 'Guide',
children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs']
children: ['', 'intro', 'getting-started', 'ffi', 'emacs', 'shell', 'env-vars', 'package-manager', 'docker', 'macos', 'nix', 'r7rs', 'hacking-on-the-stdlib']
}
],
'/tutorials/': [
Expand Down
33 changes: 33 additions & 0 deletions doc/guide/hacking-on-the-stdlib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Hacking on the Standard Library

Gerbil is a growing project and your contributions are welcome!

When working on modifications to the standard library, it's common to encounter errors
such as:

```
*** ERROR IN gx#core-expand-import%__% --
*** ERROR IN "file.ss"@1.9
--- Syntax Error: Cannot find library module
... form: :std/my/module
```
This typically because the `gxi` or `gxc` being used is looking at the installed
standard library which will not contain your changes. To address this, run your
environment with the `build.sh` script after building.

Example build:

```shell
./build.sh
```

To test your local changes rebuild the stdlib and then use the locally built `gxi` with
the following commands:

```shell
./build.sh stdlib
./build.sh env gxi ../your-test-file.ss
```
**NOTE:** the execution environment when using `./build.sh env` is in the `src/` folder
in the root of the Gerbil repo. Absolute paths work as normal, but relative paths must
be adjusted for `PWD` change.
Loading