Stream: beginners

Topic: Roc projects structure


view this post on Zulip chuwy (Nov 02 2024 at 10:49):

Can someone please correct my understanding of existing project types in Roc (if it's wrong) and how to reuse code.

So far so good.

  1. What is the correct way to write a header? I see at least two options: roc-html and roc-parser
  2. How do I use a 3rd-party package from my package? I see some examples for apps, but not for packages. I tried package [Foo] { html: "https://github.com/Hasnep/roc-html/[something].tar.br" }, but if I import anything in html the build just hangs (compiler is getting several BuildTasks, last of them being Solve, then getting stuck in load_single_threaded loop, although load_multi_threaded seems to be busier)
  3. It seems to be a bug in compiler that I'm about to debug and report, but I'm curious if I'm doing anything wrong.
  4. Different packages have different folder structure. Is it correct that it doesn't matter as long as final tar.br has main.roc?

view this post on Zulip Anton (Nov 02 2024 at 11:09):

Interfaces. Are they still a thing?

interface has been renamed to module

view this post on Zulip Anton (Nov 02 2024 at 11:11):

What is the correct way to write a header? I see at least two options: roc-html and roc-parser

Like in roc-html is the most up to date way to do it

view this post on Zulip chuwy (Nov 02 2024 at 11:12):

Thanks! At least I was doing all the right way. I guess it means I just stumbled upon a bug in a compiler

view this post on Zulip chuwy (Nov 02 2024 at 11:13):

Presumably this one? https://github.com/roc-lang/roc/issues/6889

view this post on Zulip Anton (Nov 02 2024 at 11:16):

I'll take a look

view this post on Zulip Anton (Nov 02 2024 at 11:20):

Yes, that issue still reproduces and is likely what is causing your problem too, I've changed it's priority to high

view this post on Zulip chuwy (Nov 02 2024 at 11:21):

Thanks again! I'll post some more info there


Last updated: Jul 05 2025 at 12:14 UTC