Files
Nim/compiler
Araq dcfa5573ca IC: wire the per-module backend into nifmake (Phase 2b, B5)
deps.nim's generateBackendBuildFile now emits the per-module pipeline instead
of one whole-program nifc rule: per-module cg -> merge -> per-module emit ->
link. The single nim_nifc command template carries the per-rule stage/module
switches in nifmake's (args) slot; backendCFile reconstructs each module's .c
path exactly as cgen.getCFile does (mangleModuleName of the source path for
main, the NIF suffix for deps) so the rules can declare outputs without loading
any backend module. The main module's cg depends on every other .c.nif (it
reads their init metas for NimMain), so it runs last; merge depends on all
.c.nif; each emit on merge; link on all .c.

Supporting changes:
- new `link` stage (nifbackend.generateLinkStage): registers every emitted .c
  and runs extccomp.callCCompiler once (parallel cc + link). Skips modules with
  no .c (extra members of system's closure whose code was emit-everywhere'd).
- loadBackendModules also loads system's transitive closure so every module in
  the dep graph is a resolvable cg/emit target (was: project closure + system
  only, leaving system-closure modules unfindable).
- cg always writes a .c.nif (even for code-less leaf modules) so every cg rule
  has its declared nifmake output.
- export getSomeNameForModule; deps.nim imports modulepaths/extccomp/cnif.

`nim ic` now builds via the per-module backend end to end. Validated: the int
diamond and a generic+exception program build and run byte-correct vs the
whole-program backend; koch ic thallo/tconverter/timp/tmiscs/tparseutils all
green (and a thallo binary's output matches the whole-program build).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 23:17:37 +02:00
..
2026-06-10 12:04:42 +02:00
2023-12-15 10:20:57 +01:00
2026-06-13 10:08:46 +02:00
2025-12-01 22:59:12 +01:00
2026-06-11 10:36:04 +02:00
2026-02-10 13:21:35 +01:00
2026-06-13 10:08:46 +02:00
2026-06-12 12:47:06 +02:00
2026-06-12 16:27:41 +02:00
2026-03-16 16:56:18 +01:00
2025-12-31 13:33:57 +01:00
2026-06-12 06:05:31 +02:00
2017-01-07 22:35:09 +01:00
2026-02-10 13:21:35 +01:00
2026-06-12 12:47:06 +02:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-06-13 10:16:29 +02:00
2026-06-07 19:55:56 +02:00
2025-11-25 12:49:23 +01:00
2026-04-02 07:19:43 +02:00
2024-12-27 19:42:18 +01:00
2026-06-11 10:36:04 +02:00
2026-06-13 10:08:46 +02:00
2026-04-02 07:19:43 +02:00
2025-12-11 18:22:38 +01:00
2026-04-02 07:19:43 +02:00
2026-06-13 10:08:46 +02:00
2026-06-11 10:36:04 +02:00
2021-01-12 09:36:51 +01:00
2026-06-12 16:27:41 +02:00
2026-06-13 10:08:46 +02:00
2026-01-09 13:10:04 +01:00
2026-06-11 10:36:04 +02:00
2026-06-10 12:04:42 +02:00
2026-06-10 12:04:42 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2026-06-09 16:12:38 +02:00
2026-02-10 13:21:35 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2026-02-10 13:21:35 +01:00
2026-06-10 12:04:42 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2026-06-10 12:04:42 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-06-13 10:08:46 +02:00
2026-06-13 10:08:46 +02:00
2026-06-10 12:04:42 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2024-03-16 08:35:18 +08:00
2025-12-29 13:52:22 +01:00
2025-12-31 13:33:57 +01:00
2026-06-13 10:08:46 +02:00
2026-06-13 10:08:46 +02:00
2026-06-09 16:12:38 +02:00
2023-12-25 07:12:54 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.