Files
Nim/doc
Jaremy Creechley adda34bcb8 add --genBif for semantic BIF output on non-IC builds (#26001)
## Summary

Adds `--genBif:on|off`, allowing regular compiler builds to generate
per-module semantic BIF artifacts in `nimcache`.

This reuses the semantic artifact format produced by incremental
compilation without enabling IC or changing the normal code-generation
and linking pipeline.

In comparison to `nim check --compress ...` this new flag `nim c
--genBif:on --compileOnly yourlib.nim` is considerably more useful for
tooling.

That produced full semantic proc declarations, Nim visibility,
signatures, overload disambiguators, and pragmas. For a proc that was
actually code-generated, it also recorded the exact backend name, for
example.

## Motivation

External tools such as language servers, debuggers, and binding
generators can benefit from resolved symbol and type information
produced during an ordinary build. Previously, these semantic BIF
artifacts were tied to the incremental compiler workflow.

## Details

With the option enabled:

```sh
nim c --genBif:on project.nim
```

the compiler writes semantic `.s.bif` files and their supporting
sidecars for each semantically checked module while continuing with the
requested backend normally.

The option:

- Works with non-IC builds.
- Does not enable incremental compilation.
- Does not change generated program behavior.
- Does not enable or introduce native ABI exports.
- Does not generate `.abi.nif` manifests.
- Is ignored for NimScript compilation.

The `genBif` name follows existing artifact-generation options such as
`genScript`, `genMapping`, and `genCDeps`.

## Testing

Added a focused C backend test that runs a regular build with
`--genBif:on` and verifies that semantic `.s.bif` artifacts are
generated.

A release-mode temporary compiler build and the focused Testament test
both pass.
2026-07-20 13:01:30 +02:00
..
2024-12-27 19:42:18 +01:00
2026-06-08 11:32:04 +02:00
2023-09-27 05:49:17 +02:00
2024-01-12 20:50:20 +08:00
2026-02-28 22:50:37 +01:00
2025-11-06 17:33:52 +01:00
2022-06-04 07:03:03 +02:00
2026-02-28 22:50:37 +01:00
2023-02-07 16:15:44 +08:00
2026-02-28 22:50:37 +01:00
2023-07-02 22:36:05 +02:00
2023-07-02 22:36:05 +02:00

============================
Nim's documentation system
============================

This folder contains Nim's documentation. The documentation
is written in a format called *Markdown*, a markup language that reads
like ASCII and can be converted to HTML automatically!