Stream: beginners

Topic: Types of roc files


view this post on Zulip Ryan Barth (Jun 30 2024 at 23:23):

What are all the different types of roc files? So far I have seen

I have seen documentation for app, platform, and module. What is interface for? Are there more?

view this post on Zulip Sam Mohr (Jun 30 2024 at 23:26):

https://www.roc-lang.org/tutorial#modules

view this post on Zulip Sam Mohr (Jun 30 2024 at 23:26):

Interface is the old name for Module

view this post on Zulip Sam Mohr (Jun 30 2024 at 23:32):

Hosted is the file type to talk between Roc and the host language (e.g. Rust), but it will be deprecated soon in favor of a leaner solution using module params.

view this post on Zulip Ryan Barth (Jun 30 2024 at 23:33):

Interesting I have not hit a hosted file yet with all the platform stuff I have been looking at

view this post on Zulip Sam Mohr (Jun 30 2024 at 23:34):

https://github.com/roc-lang/basic-cli/blob/main/platform/Effect.roc

view this post on Zulip Ryan Barth (Jun 30 2024 at 23:36):

Ah ok, I actually have seen that file but didn't register the different module type

view this post on Zulip Sam Mohr (Jun 30 2024 at 23:37):

We look at all of the Roc Effect declarations in that file and link them to the platform's functions based on their name, for example stdoutLine: https://github.com/roc-lang/basic-cli/blob/4ec1f2191f367403bd2d4e84b9798f04a59f01d6/platform/src/lib.rs#L413


Last updated: Jul 05 2025 at 12:14 UTC