Are multiline strings supported yet?
This code runs but prints nothing:
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/7iDKk44no3gF9Nrh2VyF8Y5yvy1jUBhrbhHURN1WQptB.tar.zst" }
import pf.Stdout
data =
"""
This is a multiline
string.
"""
main! = |_args| {
Stdout.line!(data)
Ok({})
}
For what it's worth, I initially got a compiler crash when the multiline string was too long (4000+ lines = my AoC day 1 input), and no output when the string was shorter. But then I recompiled the compiler and there's no longer a compiler crash, just no output.
yes, we changed the syntax - now it's
data =
\\This is a multiline
\\string.
(same as Zig's syntax)
Oh cool, like in Zig, love it.
Perhaps using """ should give a helpful warning / error
Fixed. However, although the program runs normally now, it ends with:
error(gpa): memory address 0x103200000 leaked:
Unable to print stack trace: Unable to open debug info: MissingDebugInfo
I'm trying to print the number of bytes in my input string:
[...]
main! = |_args| {
bytes = data.to_utf8()
len = bytes.len()
output = len.to_str()
Stdout.line!(output)
Ok({})
}
I get this runtime error:
thread 37216187 panic: incorrect alignment
???:?:?: 0x102a59233 in ??? (roc_run_994723065)
???:?:?: 0x102959e63 in ??? (roc_run_994723065)
???:?:?: 0x10290a7a3 in ??? (roc_run_994723065)
???:?:?: 0x1028e1d1f in ??? (roc_run_994723065)
???:?:?: 0x1028df6a7 in ??? (roc_run_994723065)
???:?:?: 0x1028df10b in ??? (roc_run_994723065)
???:?:?: 0x1028d8913 in ??? (roc_run_994723065)
???:?:?: 0x19fd42b97 in ??? (???)
???:?:?: 0x0 in ??? (???)
error: Child process /Users/ageron/Library/Caches/roc/73212f0613ff7600bbf5b003b36e3cfa/temp/roc-tmp-EMJa9WuLIKioAEl7KAWvrpfkyRJeNXN3/roc_run_994723065 killed by signal: 6
error: Child process aborted (SIGABRT)
Can you please share the full .roc code that does that
Which platform URL are you using
This is the latest (v 0.3) I just pushed earlier today
https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.3/98T93wthPgoBRLYtPTT4RBBsQunrfDG94gihPf1zYYmE.tar.zst
Sure, same as above:
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.1-test/7iDKk44no3gF9Nrh2VyF8Y5yvy1jUBhrbhHURN1WQptB.tar.zst" }
import pf.Stdout
data =
\\L4
\\R49
\\ ... (very long, 4000+ lines) ...
main! = |_args| {
bytes = data.to_utf8()
len = bytes.len()
output = len.to_str()
Stdout.line!(output)
Ok({})
}
Oh ok, thanks, I'll give this a try
Yes, this fixed the issue, thanks! There's still a memory leak though, but at least the program runs normally:
4373823488
error(gpa): memory address 0x104d20000 leaked:
Unable to print stack trace: Unable to open debug info: MissingDebugInfo
Could you upload the full .roc file somewhere so I can hunt down the leak
Sure:
https://gist.github.com/ageron/1f8fc1e302d772b23c2a5acc3b800f40
Fixed in https://github.com/roc-lang/roc/pull/8552
Cool, thanks @Luke Boswell
fyi I have a branch that fixes the ??? in the traces but I still need to review it thoroughly.
Last updated: Dec 21 2025 at 12:15 UTC