I'm playing around with basic-webserver, and running glue-gen.sh
results in some syntax errors (which I have a fix for) and some failing assertions (which get commented out in the basic-webserver repo).
Any tips on how to find out what the size_of
those unions actually are, and how to fix the calculations?
assert_eq!()
is apparently invalid to use in a top-level const, so I'm not sure where to go from there
@Folkert de Vries knows a trick for that, but I forget what it is
ah ok, I managed to put an assert_eq in server.rs run_server()
, so I at least know what the number should be now
Just assert with == works for some types, numbers mostly
So assert with == doesn't tell you what the number actually was, if the assertion fails
ok noob question: is there a way to do a debug log
in roc code? RustGlue.roc is huge and I'd like to quickly introspect what's going on in the middle of it.
dbg someValue
That said, no idea if glue is wired up to support it.
for the assert, you can make a type error by doing something like assert!([0; 42] == [0; YOUR_VALUE])
oh nice
hm yeah looks like roc glue
doesn't show the dbg
s
they should be somewhere, but you may not get to see the stdout of that process
It would be really nice to fix this particular issue. That would mean we dont have to keep the glue for basic-webserver and basic-cli checked into the repo but can use the script to generate locally when doing platform dev.
you mean remove/adjust the failing asserts?
The glue bugs that generate invalid rust for those platforms.
Last updated: Jul 06 2025 at 12:14 UTC