Stream: ideas

Topic: Subcommand for generating a new main.roc


view this post on Zulip Isaac Van Doren (Dec 20 2023 at 02:47):

When I want to write a new roc program, I usually end up copying the nearest existing roc file I have and then removing the old unused code so that I can get something running. This is somewhat annoying. What if the cli included a command called roc init (or similar) that would generate a new main.roc for you? I think this would be nice for scripting purposes as well as for a new user's first impressions on the language.

It could generate this:

app "main"
    packages {
        pf: "https://github.com/roc-lang/basic-cli/releases/download/0.7.0/bkGby8jb0tmZYsy2hg1E_B2QrCgcSTxdUlHtETwm5m4.tar.br",
    }
    imports [
        pf.Stdout,
    ]
    provides [main] to pf

main =
    Stdout.line "Hello, World!"

view this post on Zulip Hannes Nevalainen (Dec 20 2023 at 07:08):

I do the same since I have not memorized all the “stuff” at the top of the file.

view this post on Zulip Anton (Dec 20 2023 at 10:11):

We have an existing issue for roc init: #3139

view this post on Zulip Isaac Van Doren (Dec 20 2023 at 13:25):

Oh, great :check:


Last updated: Jun 16 2026 at 16:19 UTC