modular / modular/modular

[Feature Request] `mojo new`

Open
#5,756 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement mojo Needs Triage
Dominant language
Mojo
Stars
29.8k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Review Mojo's priorities
What is your request?

Add a tool which generates mojo project boilerplate for both pixi and bazel, to aid in project setup and reduce friction for new users.

What is your motivation for this change?

Bazel is a very good build system, and nicely handles things like cross compilation, testing, and integrating non-Mojo dependencies. However, it is also non-trivial to set up, especially for those unfamiliar with it, and especially if cross compilation is desired. Even pixi currently requires users to know to add a mojo conda channel or to pixi add modular. This introduces a lot of extra friction for new users who just want to try out Mojo, and for users intending to write reusable libraries makes testing compilation more difficult. Providing a tool to generate a "minimum viable Bazel config" with some opinionated defaults for Mojo for use in libraries or larger projects, or a pixi config for new users, should help lower the barrier to entry and reduce confusion while also removing the need for experienced users to remember conda repo URLs or go back to introductory documentation to get the command.

Any other details?

Ideally, the Bazel template should be set up with the assumption that it will be used in libraries which may need to rely on C code, and thus may need to compile per-target versions of C libraries, so clang-based cross compilation for targets supported by Mojo is desirable, as well as tools for talking to external C/C++ build systems.

There may be a bit of a bootstrap issue unless this tool is separated out from the mojo binary. Perhaps a self-contained python program or a statically linked binary would be better. The intent is not to resurrect magic but to a similar distribution solution may be necessary.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name existing files, tests, or a command entry point. Start by locating how CLI commands and current Pixi or Bazel project setup are organized, then define the supported templates and bootstrap approach. Done means mojo new can generate usable project boilerplate for both Pixi and Bazel, including the requested cross-compilation and C/C++ integration considerations.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, cli, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.