// readme

libc

A standard C library binding for the Mojo programming language.

Every C header is exposed as a Mojo sub-package β€” libc.math, libc.string, libc.unistd, libc.sys.socket, … β€” so external_call boilerplate lives in one place and your code reads like the C it replaces.

  • Mojo: >=1.1.0,<2
  • Platforms: linux-64, osx-arm64
  • License: MIT

Install

pixi add --from https://conda.modular.com/max --channel mojo-force libc
from libc.math import sqrt
from libc.unistd import getpid

def main():
    print(sqrt(2.0), getpid())

Development

The project uses pixi; magic/mojoproject.toml are gone.

pixi install              # default environment (Mojo toolchain)
pixi run test             # run the test suite
pixi run package          # build dist/libc.mojoc
pixi run format           # apply mojo format
pixi run format-check     # fail if the tree is not formatted
pixi run check-prototypes # fail if a call does not match the C prototype
pixi run check-release    # fail if the version is not the same everywhere it is said
pixi run check-channels   # fail if the docs name a conda…