> ## Documentation Index
> Fetch the complete documentation index at: https://docs.muna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Language Coverage

> Python language and library features supported by the compiler.

export const OperatorTable = () => {
  const groupAndSortOperators = operators => {
    if (!operators) return [];
    const operatorMap = operators.reduce((acc, operator) => {
      const module = operator.name.split(".")[0];
      if (!acc[module]) acc[module] = [];
      acc[module].push(operator);
      return acc;
    }, {});
    const sortedOperatorMap = Object.entries(operatorMap).sort(([a], [b]) => a.localeCompare(b));
    const result = sortedOperatorMap.map(([module, ops]) => [module, ops.sort((a, b) => a.kind.localeCompare(b.kind) || a.name.localeCompare(b.name))]);
    return result;
  };
  const [operators, setOperators] = useState(null);
  const operatorMap = useMemo(() => groupAndSortOperators(operators), [operators]);
  useEffect(() => {
    (async () => {
      const response = await fetch("https://api.muna.ai/v1/operators");
      const data = await response.json();
      setOperators(data);
    })();
  }, []);
  return <div className="">
      {operatorMap.map(([module, ops]) => <div key={module}>
          <h3>
            <code className="!text-indigo-500">
              {module}
            </code>
          </h3>
          <table>
            <thead>
              <tr>
                <th></th>
                <th>
                  Name
                </th>
              </tr>
            </thead>
            <tbody>
              {ops.map((operator, index) => <tr key={index}>
                  <td>
                    <Icon icon={operator.kind === "method" ? "cube" : "function"} />
                  </td>
                  <td>
                    <code className="!text-sm">
                      {operator.name}
                    </code>
                  </td>
                </tr>)}
            </tbody>
          </table>
        </div>)}
    </div>;
};

## Writing the Function Body

The function body can contain arbitrary Python code. Given that the Muna compiler is currently a
proof of concept, it has limited coverage for Python language features. Below is a list of Python
language features that we either partially support, or do not support at all:

<AccordionGroup>
  <Accordion title="Functions" icon="function">
    | Statement | Status | Notes |
    | :- | :-: | :- |
    | Recursive functions | 🔨 | Recursive functions **must** have a return type annotation. |
    | Lambda expressions | 🚧 | Lambda expressions [can be invoked](https://github.com/muna-ai/compiler/blob/main/predictors/language/lambda.py), but cannot be used as objects. |
  </Accordion>

  <Accordion title="Literals" icon="quote-right" iconType="solid">
    | Collection | Status | Notes |
    | :- | :-: | :- |
    | List literals | 🚧 | List must contain primitive members (e.g. `int`, `str`). |
    | Dictionary literals | 🚧 | Dictionary must contain primitive members (e.g. `int`, `str`). |
    | Set literals | 🚧 | Set must contain primitive members (e.g. `int`, `str`). |
    | Tuple literals | 🚧 | Tuple must contain primitive members (e.g. `int`, `str`). |
  </Accordion>

  <Accordion title="Classes" icon="cube">
    Tracing through classes is not yet supported.
  </Accordion>

  <Accordion title="Exceptions" icon="triangle-exclamation" iconType="solid">
    | Statement | Status | Notes |
    | :- | :-: | :- |
    | `raise` statements | 🔨 | |
    | `try..except` statement | 🔨 | |
  </Accordion>
</AccordionGroup>

<Note>
  Over time the list of unsupported language features will shrink and eventually, will be empty.
</Note>

## Library Coverage

We are adding support for popular libraries, across tensor frameworks, scientific computing, and more:

<Accordion title="Supported Libraries" icon="landmark">
  Below are libraries currently supported by our compiler:

  <OperatorTable />
</Accordion>

<Tip>
  If you need a specific library to be supported by the Muna compiler, [reach out to us](mailto:hi@muna.ai).
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.