[Feature Request] `--free-standing` option in command line to make embedded systems
Review Mojo's priorities
- [X] I have read the roadmap and priorities and I believe this request falls within the 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