Stream: beginners

Topic: Read files with new Roc


view this post on Zulip gavr (Jun 16 2026 at 20:20):

Is there any way to read file right now?
I dont see file read inside Zig-template platform. Is there a way to try new basic cli and read file from it?
https://github.com/roc-lang/basic-cli/pull/423

view this post on Zulip Luke Boswell (Jun 17 2026 at 03:33):

No there isn't. I've intentionally kept that platform very slim -- it's purpose is to be simple and easy to fork and add features to.

The goal is to get a release of an updated basic-cli sometime soon. I've been working my way up the stack starting with the simplest platforms and getting a release of those working before I switch focus to helping with basic-cli again.

view this post on Zulip Anton (Jun 17 2026 at 09:40):

@gavr if you do anticipate any writing to the file during your program's execution, you can import it.

view this post on Zulip Anton (Jun 17 2026 at 09:42):

The goal is to get a release of an updated basic-cli sometime soon.

Yeah, it's still quite easy to encounter bugs in Roc when porting basic-cli so progress has been slow.

view this post on Zulip gavr (Jun 17 2026 at 13:09):

Anton said:

@gavr if you do anticipate any writing to the file during your program's execution, you can import it.

oh, thanks! yea, and I can do writing by printing to stdout + piping to file >> sas.txt

view this post on Zulip Anton (Jun 17 2026 at 13:14):

if you do anticipate any writing to the file during your program's execution

Oh sorry I just noticed, this should have been "if you do not anticipate any writing ...."

view this post on Zulip Anton (Jun 17 2026 at 13:15):

The import is only done once, so you can't write-read-write-read etc, only read once.

view this post on Zulip gavr (Jun 17 2026 at 13:35):

ya, I wanna do a little interpreter or just parser, so reading only once is ok


Last updated: Jul 23 2026 at 13:15 UTC