anoma / juvix

A language for intent-centric and declarative decentralised applications
https://docs.juvix.org
GNU General Public License v3.0
457 stars 53 forks source link

Request for `juvix init` to additionally create a default `<ProjectName>.juvix` file #3094

Open mauricewbr opened 1 month ago

mauricewbr commented 1 month ago

Feature request description I would like to propose that juvix init additionally creates a Juvix module according to the specified project name. As of now, the command creates the Package.juvix file but requires a developer to create the <ProjectName>.juvix module manually in order to compile the project.

Alternatives An alternative way (but arguably worse) would be a separate juvix template command which creates a default Juvix module file. I personally feel like the juvix init command should initialize an existing directory with all files necessary to build the project immediately.

paulcadman commented 1 month ago

hi @mauricewbr - thanks for the report.

Do you have any preferences on what code should be present in the <ProjectName>.juvix file?

One suggestion:

module ProjectName;

import Stdlib.Prelude open;

main : IO := printStringLn "Hello World";

In general I think we want several template git repositories for common Juvix project types, including a template repository for an Anoma application.

mauricewbr commented 1 month ago

I think the "Hello World" default is totally fine! Also agree on having multiple templates that could correspond to some app examples / tutorials in the docs.