Stream: ideas

Topic: new app header


view this post on Zulip Anton (Jul 04 2023 at 10:43):

In response to this topic.

For apps, instead of:

app [main] packages [Stdout from "https://…"]

main =
    Stdout.line "Hello, World!"

I would prefer:

app
    exposes [main]
    imports [Stdout from "https://…"]

main =
    Stdout.line "Hello, World!"

view this post on Zulip Hannes (Jul 05 2023 at 02:50):

I was going to say something similar to this, when I read the word packages I read it as a verb, like "this app packages these things" instead of the noun like "these are the packages to import". Maybe that's because I was used to the current Roc syntax and expected it to read like a sentence, I could probably just get used to a noun like in most languages manifest files.

view this post on Zulip Hannes (Jul 05 2023 at 02:57):

I'm not sure about the word exposes for an app, I know what you mean - that it's exposed to the platform - but I think that would be overloading the meaning of the word too much.

view this post on Zulip Brian Carroll (Jul 05 2023 at 10:36):

Yeah especially when it's on a single line, it looks like it's supposed to be read aloud as an English sentence: "app 'main' packages standard out". And in that sentence, "packages" is a verb.

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:02):

combining some ideas from other threads: what if it was this?

Screen-Shot-2023-07-19-at-12.01.44-AM.png

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:04):

to expand that a bit:

app [main]
    imports
        [Stdout] from platform "https://…/basic-cli/…"
        [JsonDecode] from "https://…/json/…"
        [CodePt, Segment] from "https://…/unicode/…"

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:04):

so from platform would be what denotes which one is the platform

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:05):

it could also have brackets around the imports:

app [main]
    imports [
        [Stdout] from platform "https://…/basic-cli/…",
        [JsonDecode] from "https://…/json/…",
        [CodePt, Segment] from "https://…/unicode/…",
    ]

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:06):

but I really don't like the first impression that [[ makes on hello world:

app [main] imports [[Stdout] from platform "https://…/basic-cli/…"]

view this post on Zulip Richard Feldman (Jul 19 2023 at 04:06):

and it doesn't feel like the brackets are adding a lot of important clarity to the multiline version to me

view this post on Zulip Luke Boswell (Jul 19 2023 at 06:35):

Do we need the indents for any particular reason?

view this post on Zulip Luke Boswell (Jul 19 2023 at 06:39):

I think this also looks nice

app [main]
imports
    [Stdout] from platform "https://…/basic-cli/…"
    [JsonDecode] from "https://…/json/…"
    [CodePt, Segment] from "https://…/unicode/…"

main = ...

view this post on Zulip Anton (Jul 19 2023 at 12:09):

I prefer with the indent and without the brackets around the imports

view this post on Zulip Richard Feldman (Jul 19 2023 at 13:04):

I like the indentation because it's continuing the app declaration as opposed to starting a new standalone declaration


Last updated: Jun 16 2026 at 16:19 UTC