lukewilliamboswell / roc-wasm4 Goto Github PK
View Code? Open in Web Editor NEWBuild wasm4 games using Roc
Home Page: https://lukewilliamboswell.github.io/roc-wasm4/
License: Universal Permissive License v1.0
Build wasm4 games using Roc
Home Page: https://lukewilliamboswell.github.io/roc-wasm4/
License: Universal Permissive License v1.0
I cloned the repo and typed: zig build run
but get this:
glenn@glenn-MacM2Pro ~/src/github.com/lukewilliamboswell/roc-wasm4 (main) $ zig build run
/Users/glenn/src/github.com/lukewilliamboswell/roc-wasm4/build.zig:19:33: error: no field named 'path' in union 'Build.LazyPath'
.root_source_file = .{ .path = "build_roc.zig" },
^~~~
/usr/local/zig-macos-aarch64-0.13.0-dev.267+793f820b3/lib/std/Build.zig:2133:22: note: union declared here
pub const LazyPath = union(enum) {
^~~~~
referenced by:
runBuild__anon_8350: /usr/local/zig-macos-aarch64-0.13.0-dev.267+793f820b3/lib/std/Build.zig:2079:37
main: /usr/local/zig-macos-aarch64-0.13.0-dev.267+793f820b3/lib/compiler/build_runner.zig:300:29
remaining reference traces hidden; use '-freference-trace' to see all reference traces
glenn@glenn-MacM2Pro ~/src/github.com/lukewilliamboswell/roc-wasm4 (main) $ zig version
0.13.0-dev.267+793f820b3
A Google search was not terribly helpful for a zig newbie, unfortunately.
Any ideas how to fix this?
Hello -
Having a great time writing my Real-Time-Strategy game in roc-wasm4! However, when my update
function makes multiple roc_alloc
calls, the ensuing frame "glitches", showing garbage on parts of the screen.
Below is a profile showing the issue. Most frames generated are "clean" like the two on the left. You can see the "glitch" in the right-most frame -- there's noise over the game's text at the bottom of the screen.
This always happens after update
runs this A* search function (which, in turn, triggers a number of roc_alloc
calls). Here is a zoomed-in version of the update
call from the previous screenshot. As you can see, the recursion is fairly deep but not at all wide -- the vast majority of time is spent in the bit_set_ArrayBitSet.isSet
call.
I've also found the glitching:
roc_alloc
calls update makes.Should I simply get better at managing allocations? Or is this potentially a bug in roc-wasm4
, roc
, wasm4
, zig
or wasm
?
This program runs successfully, but if I comment out either the unused import or the unused def, the build fails.
app "drum"
packages {
w4: "platform/main.roc",
}
imports [
w4.Task.{ Task },
# w4.W4,
]
provides [main, Model] to w4
Program : {
init : Task Model [],
update : Model -> Task Model [],
}
Model : {}
main : Program
main = { init, update }
init : Task Model []
init =
Task.ok {}
update : Model -> Task Model []
update = \model ->
Task.ok model
# unused = "foo"
$ zig build -Dapp=foo.roc run
── UNUSED DEFINITION ───────────────────────────────────────────────── foo.roc ─
unused is not used anywhere in your code.
29│ unused = "foo"
^^^^^^
If you didn't intend on using unused then remove it so future readers
of your code don't wonder why it is there.
────────────────────────────────────────────────────────────────────────────────
0 errors and 1 warning found in 13 ms.
run roc: error: the following command exited with error code 1:
roc check /Users/isaacvando/Desktop/projects/roc-drum-machine/foo.roc
Build Summary: 0/5 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run w4 transitive failure
└─ zig build-lib cart Debug wasm32-freestanding transitive failure
└─ run roc transitive failure
└─ run roc failure
error: the following build command failed with exit code 1:
/Users/isaacvando/Desktop/projects/roc-drum-machine/zig-cache/o/c173747dba52ae0f3be002aa3cb112b9/build /Users/isaacvando/Desktop/projects/zig/build/zig /Users/isaacvando/Desktop/projects/roc-drum-machine /Users/isaacvando/Desktop/projects/roc-drum-machine/zig-cache /Users/isaacvando/.cache/zig -Dapp=foo.roc run
I am using the most recent version of the platform, roc from Jan 12, and apple silicon.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.