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!
modules yes, packages not yet! :smile:
OK, I'll use the Rust compiler for now and it'll be a nice exercise later to convert them :)
Richard Feldman said:
modules yes, packages not yet! :smile:
I'm confused on what a package is vs what a module is
You can import code you wrote but not code other people wrote :)
What does that look like in the source though? like whats the difference between import syntax?
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.
You can bundle the .roc files (modules) using thr cli, roc bundle
here is an example package from the snapshots https://github.com/roc-lang/roc/tree/main/test/snapshots/plume_package
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
@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?
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
Ah, I see it's got the error in there. We should fix that to use the proper syntax I thjnk.
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
Sorry for spelling and grammar here, on my phone and this keyboard is challenging
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