modular / modular/modular

[Feature Request] `--free-standing` option in command line to make embedded systems

Open
#3,370 0 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement mojo mojo-repo postponed
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?

An option in the compiler that make the binary not dependending of external operating system to work (--freestanding, or another name) which is present in C compilers (clang -ffreestanding -c my_program.c). In the context of C compilers, "freestanding" refers to a program that is compiled to run in a bare-metal environment or an embedded system, where there might not be full support for all standard libraries and functionalities expected in a "hosted" environment, like a complete operating system. In a freestanding environment, the only mandatory functionalities from the standard library are those defined in section 4 of the C standard specification, which include the minimum functionalities necessary for compiling programs. For example, functions like printf, malloc, or exit are not guaranteed to be available.

What is your motivation for this change?

Create a tiny operating system in Mojo as described here.
But developers that write other embbeded systems also will need if want code them in mojo.

Any other details?

No response

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 request concerns the Mojo compiler and a freestanding --freestanding-style option; start by locating compiler command-line option handling and review discussion #3334. Done means the compiler supports producing binaries without an external operating-system dependency for the intended embedded use case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.