Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/generate-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
uses: roc-lang/setup-roc@main
with:
version: nightly-new-compiler
nightly-tag: nightly-2026-July-14-c9147c2
- name: Build host object
run: zig build
- name: Generate docs
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ jobs:
version: ${{ env.ZIG_VERSION }}

- name: Install Roc
uses: roc-lang/setup-roc@v0.2.0
uses: roc-lang/setup-roc@main
with:
version: ${{ env.ROC_VERSION }}
nightly-tag: nightly-2026-July-14-c9147c2

- name: Capture Roc version
id: roc_version
Expand All @@ -55,7 +56,7 @@ jobs:
} >> "$GITHUB_OUTPUT"

- name: Build host object
run: zig build -Doptimize=ReleaseSafe
run: zig build -Doptimize=ReleaseSmall

- name: Bundle platform
id: bundle
Expand Down Expand Up @@ -118,9 +119,10 @@ jobs:
version: ${{ env.ZIG_VERSION }}

- name: Install Roc
uses: roc-lang/setup-roc@v0.2.0
uses: roc-lang/setup-roc@main
with:
version: ${{ env.ROC_VERSION }}
nightly-tag: nightly-2026-July-14-c9147c2

- name: Install Python
uses: actions/setup-python@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
uses: roc-lang/setup-roc@main
with:
version: nightly-new-compiler
nightly-tag: nightly-2026-July-14-c9147c2

- run: roc version

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ If hot reloading stops working, press `R` in the WASM-4 runtime to reload the ca
Package the platform as a Roc archive with:

```shell
zig build -Doptimize=ReleaseSafe
zig build -Doptimize=ReleaseSmall
ROC=roc ./bundle.sh
```

Expand Down Expand Up @@ -114,4 +114,4 @@ zig build -Doptimize=ReleaseSmall
roc build examples/snake.roc --opt=size
```

If the cart is too large, you can try lowering the dynamic memory space with `-Dmem-size=<bytes>`. The default is `40960` bytes.
If the cart is too large, you can try lowering the dynamic memory space with `-Dmem-size=<bytes>`. The default is `32768` bytes.
7 changes: 4 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ pub fn build(b: *std.Build) void {
// Build options exposed as the `config` module to allocator.zig / host.zig.
// ---------------------------------------------------------------------

// Full mem size on WASM-4 is 58976, but we have to leave room for code + constants.
// Was u16 in the old build; widened to u32 for headroom.
// WASM-4 gives programs 58976 bytes after its reserved hardware range. The
// final module also needs room there for stack and Roc static data, so the
// default allocator arena intentionally leaves several KiB free.
const mem_size = b.option(
u32,
"mem-size",
"the amount of space reserved for dynamic memory allocation",
) orelse 40960;
) orelse 32768;

// Enable this if you hit any sort of memory corruption. Costs performance.
const zero_on_alloc = b.option(
Expand Down
2 changes: 1 addition & 1 deletion ci/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ echo "Zig: $(zig version)"
if [ "$SKIP_ZIG_BUILD" = "1" ]; then
echo "Skipping zig build because SKIP_ZIG_BUILD=1"
else
zig build
zig build -Doptimize=ReleaseSmall
fi

# zig tests
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.roc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app [main] { w4: platform "https://github.com/lukewilliamboswell/roc-wasm4/releases/download/0.6/ADeKYHzDvyXSEZjj4wG3qRLTFRYiiEWLuVMPD5S8uBF3.tar.zst" }
app [main] { w4: platform "../platform/main.roc" }

import w4.W4

Expand Down
14 changes: 14 additions & 0 deletions examples/rocci-bird-rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[build]
target = "wasm32-unknown-unknown"

[target.wasm32-unknown-unknown]
rustflags = [
"-C", "link-arg=--import-memory",
"-C", "link-arg=--initial-memory=65536",
"-C", "link-arg=--max-memory=65536",
"-C", "link-arg=--allow-undefined",
"-C", "link-arg=--no-stack-first",
"-C", "link-arg=--global-base=6592",
"-C", "link-arg=-z",
"-C", "link-arg=stack-size=14752",
]
1 change: 1 addition & 0 deletions examples/rocci-bird-rust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
7 changes: 7 additions & 0 deletions examples/rocci-bird-rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/rocci-bird-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "rocci-bird-rust"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
Loading
Loading