Stream: beginners

Topic: packages pf


view this post on Zulip Slazaa (Dec 07 2023 at 15:40):

Hi, I'm a bit confused about what I should write for the packages pf

packages { pf: ??? }

view this post on Zulip Brendan Hansknecht (Dec 07 2023 at 16:09):

If you are new to roc, I would advise starting with the tutorial and using basic-cli.

In general, roc is always built on top of a platform. More details on platforms here: https://www.roc-lang.org/platforms

view this post on Zulip Brendan Hansknecht (Dec 07 2023 at 16:09):

please ask more questions if that isn't what you are looking for

view this post on Zulip Elias Mulhall (Dec 07 2023 at 18:10):

Curious how people feel about pf in general. I think it trips me up a bit every time I read it because "platform" is a single word so it feels weird to have a syllable level abbreviation. For basic-cli I like packages { cli: "..." }, but I realize that might not feel natural for all platforms.

view this post on Zulip Brendan Hansknecht (Dec 07 2023 at 18:17):

When I saw you use cli I immediately wanted to change all of my code to use it as well. Reads so much nicer (though does kinda hide which package is the platform)

view this post on Zulip Slazaa (Dec 07 2023 at 18:18):

Oh I thought the field needed to be called pf

view this post on Zulip Agus Zubiaga (Dec 07 2023 at 18:26):

Brendan Hansknecht said:

When I saw you use cli I immediately wanted to change all of my code to use it as well. Reads so much nicer (though does kinda hide which package is the platform)

I agree. Also, the new app header I'll soon be working on will have a special platform keyword indicating which package is the platform:

app [main]
    requires {
        cli: platform "https://…/basic-cli/…",
        json: "https://.../roc-json"
    }

So it should be clear even if you use a different name.

view this post on Zulip Norbert Hajagos (Dec 07 2023 at 18:27):

Oh, so I don't need to finish my sentence. I've written so far that: "Is there a way to disambiguate between a purly Roc package and a platform? I know there is no package manager right now, but is the syntax planned to be the same? Because ..."

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:31):

oh that's cool, I never thought of cli!

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:31):

what would it be for basic-webserver? web? :thinking:

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:32):

server?

view this post on Zulip Slazaa (Dec 07 2023 at 18:32):

wserv ?

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:41):

so imports [cli.File.{ readUtf8 }] feels reasonable, although imports [web.File.{ readUtf8 }] feels weird :big_smile:

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:42):

imports [server.File.{ readUtf8 }] feels more reasonable

view this post on Zulip Agus Zubiaga (Dec 07 2023 at 18:43):

web sounds like it would run on the browser

view this post on Zulip Elias Mulhall (Dec 07 2023 at 18:44):

If you're using Nea it could be nea :shrug:

This might partially depend on if the Roc community goes hard on the Elm philosophy that everything should have a very direct name, or if there are platforms with cute/colorful names.

Like in elixir Phoenix is a namespace for all code related to the web server. In context that's fine.

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:49):

Elias Mulhall said:

This might partially depend on if the Roc community goes hard on the Elm philosophy that everything should have a very direct name, or if there are platforms with cute/colorful names.

Like in elixir Phoenix is a namespace for all code related to the web server. In context that's fine.

I think in the context of platforms it's natural to have a variety of names because the main point of platforms is to provide a way to build applications for a particular use case in a particular way, and there will naturally be different approaches with different tradeoffs for the same (or similar) domains

view this post on Zulip Richard Feldman (Dec 07 2023 at 18:49):

and nea is a great example of that!


Last updated: Jul 06 2025 at 12:14 UTC