Stream: beginners

Topic: Packages in the new compiler


view this post on Zulip Niclas Ahden (Dec 23 2025 at 20:13):

Does the new compiler support modules and/or packages? I'm extracting a few Roc packages from the projects I've been working on. They're using the Rust compiler, but I thought it'd be fun to use the new compiler if possible. I tried but it seems it doesn't work yet, but I thought I'd ask!

view this post on Zulip Richard Feldman (Dec 23 2025 at 21:02):

modules yes, packages not yet! :smile:

view this post on Zulip Niclas Ahden (Dec 23 2025 at 21:06):

OK, I'll use the Rust compiler for now and it'll be a nice exercise later to convert them :)

view this post on Zulip nandi (Dec 23 2025 at 23:02):

Richard Feldman said:

modules yes, packages not yet! :smile:

I'm confused on what a package is vs what a module is

view this post on Zulip Hannes (Dec 24 2025 at 00:37):

You can import code you wrote but not code other people wrote :)

view this post on Zulip nandi (Dec 24 2025 at 00:40):

What does that look like in the source though? like whats the difference between import syntax?

view this post on Zulip Luke Boswell (Dec 24 2025 at 02:59):

A package is a collection of modules, you can import them from a URL. A platform is just a special package, that also includes the prebuilt binaries and a platform module.

view this post on Zulip Luke Boswell (Dec 24 2025 at 02:59):

You can bundle the .roc files (modules) using thr cli, roc bundle

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:00):

here is an example package from the snapshots https://github.com/roc-lang/roc/tree/main/test/snapshots/plume_package

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:03):

I think we still have a few issues lurking around using packages. I've just finished fixing enough to get basic wasm platforms working. I'd like to get a simple package working soon too, just to help flush out the issues. If anyone wants to poke at that and report bugs, that would be super

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:05):

@Richard Feldman that package includes a module using our older module header syntax... I am surprised that's passing in CI tbh. I expected it to throw an error on the older syntax. Am I correct i that?

view this post on Zulip nandi (Dec 24 2025 at 03:06):

Awesome thanks for the info. Some of this is a bit intimidating wrapping my head around since I'm so new to the project, but I'm having a blast learning everything

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:07):

Ah, I see it's got the error in there. We should fix that to use the proper syntax I thjnk.

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:08):

Also we could probably include multiple files. I remember this was one of the first snapshots we added to check our package syntax for parsing and canonicalisation, but now we should probably upgrade this to be a more realistic package so we can c
validate features higher in the stack

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:09):

Sorry for spelling and grammar here, on my phone and this keyboard is challenging

view this post on Zulip Luke Boswell (Dec 24 2025 at 03:10):

It's been on my todo list to make a really basic package with a bundled release and check its all working.


Last updated: Jan 12 2026 at 12:19 UTC