Stream: compiler development

Topic: spooky action at a distance


view this post on Zulip Brendan Hansknecht (Dec 01 2023 at 16:56):

I may just be missing something, but this bug is super strange: https://roc.zulipchat.com/#narrow/stream/358903-Advent-of-Code/topic/2023.20Day.201/near/405345841

Basically, we have a small string. It is split into a list of small strings (this is all just copying, no references or modifications). Then when joining that list back together( again, just copying small strings). Then somehow, the original string changes despite not being used at all in the joining process.

Sounds to me like we may be writing to the wrong offset of the stack somewhere. Really strange.

An Overly defensive printout with extra prints in zig builtins

Like if this was happening with seamless slices, it would make sense to me, but this is all small strings.

view this post on Zulip Brian Carroll (Dec 01 2023 at 22:17):

Weird!
Is this entirely confined to Zig code or is there any Roc code?
Do optimizations make a difference?

view this post on Zulip Brendan Hansknecht (Dec 01 2023 at 22:22):

I tested both with and without --optimize, no change.

Lines starting with [#UserApp] are dbg messages from roc. Non-prefixed lines are from zig. I was unable to see the change from the zig side. Which makes sense given zig does not have access to the variable when it theoretically changes.


Last updated: Jul 06 2025 at 12:14 UTC