Stream: platform development

Topic: basic-cli


view this post on Zulip Rick Hull (Jan 23 2026 at 04:00):

I got migrate-zig-compiler built. but I have a FAQ entry: i now have libhost.a in the basic-cli directory. how do I use that in my roc-project dir?

view this post on Zulip Luke Boswell (Jan 23 2026 at 04:14):

If you use ./build.sh that will build the libraries in the platform/targets/ folder... so you should then be able to run an example, roc examples/hello_world.roc

view this post on Zulip Luke Boswell (Jan 23 2026 at 04:14):

You will note the examples use ../platform/main.roc instead of a URL -- they are using a relative path to the platform package instead of a URL release

view this post on Zulip Rick Hull (Jan 23 2026 at 11:16):

yes, but should I copy platform/targets into my project dir? As a general question, that I don't honestly know the answer to. I'm sure that would work, but it feels clunky. I've got my "roc project" on one hand, and the "basic-cli" platform on the other. Or does the basic-cli repo then subsume my project? (i doubt it). How do I connect the outputs of basic-cli to my roc project?

view this post on Zulip Rick Hull (Jan 23 2026 at 11:27):

This is more a question for #beginners > Platform basics to be clear. If someone asks, I'd like to know what to tell them. I also suspect I am missing something obvious or am harboring a misconception.

view this post on Zulip lozzy (Jan 23 2026 at 12:05):

In your roc file you reference the platform directory by relative path.

If you are hacking on a platform it's probably easier to have the roc files consuming that platform in the same directory/repository but if you are just using the locally built platform for another project and the platform's libhost.a won't change I don't see a need for that.

view this post on Zulip Rick Hull (Jan 23 2026 at 12:08):

ok, thanks, this is helpful. app [main!] { pf: platform "../basic-cli/platform/targets" } something like that?

view this post on Zulip lozzy (Jan 23 2026 at 12:14):

Should be app [main!] { pf: platform "../basic-cli/platform/main.roc" }, but yeah.

view this post on Zulip Rick Hull (Jan 23 2026 at 12:15):

ok, right! i'm hooking it up to the Roc API portion of the platform. thanks!

view this post on Zulip Rick Hull (Jan 23 2026 at 12:24):

I'm thinking now in terms of roc-init -- a project intended to help new devs get up and running on the new compiler. right now we have a main.roc that targets roc-platform-template-zig release. I am thinking about showing ~4~ workflows:

The first 3 would be trivial, just targeting platform release URLs. The final one would show how to get basic-cli going in a different dir, and then wiring to that via relative path. So I might have, instead of one roc-init/main.roc:

Within main! of each, the 3 templates would have some identical "hello world+" (prompt for name, read STDIN, say hi). But basic-cli.roc would have some nice example usage.

view this post on Zulip Rick Hull (Jan 23 2026 at 13:00):

I suspect the current roc-platform-template-c is not up to this task (last commit 2y ago)

view this post on Zulip nandi (Jan 23 2026 at 16:35):

c is just zig-- heh


Last updated: Feb 20 2026 at 12:27 UTC