Skip to content

Document compiler contracts and refresh contributor guides - #8598

Open
cristianoc wants to merge 8 commits into
object-stage0from
docs/compiler-documentation
Open

Document compiler contracts and refresh contributor guides#8598
cristianoc wants to merge 8 commits into
object-stage0from
docs/compiler-documentation

Conversation

@cristianoc

Copy link
Copy Markdown
Collaborator

Stacked on #8597. Documentation only: no behavior change (full test battery and checkformat pass; the two expected-file changes track fixture comments that render inside error snippets).

Code-level contracts

  • ctype.mli, btype.mli, subst.mli, types.mli: caller contracts for instantiation (instance, instance_poly ~fixed, instance_label), the object-field filters, enlargement, subtyping, copy sessions (with_copy_session, copy_type_desc), mutability cells, and for_saving independence.
  • Implementation comments at the owning definitions: trail vs copy-session ownership and the two logging rules, Tsubst mark visibility across nested sessions vs per-session mutability duplication, the representative behavior of dup_mutability, the pre-tail-unification openness sample in unify_fields, the rewritten copy header (level rule, ?partial, ?env records-only), and the two coercion paths at the typecore call site.
  • The polymorphic scheme discipline (use-sites instantiate; introduction sites type at a fixed instance and verify generality) documented at type_object_field_value / object_field_use_type and in the type-checker guide, including why type_label_exp's PR#4862 retry stays label-specific.

Guides and discoverability

  • 新建 area guides: compiler/ml/README.md (type checker), compiler/syntax/README.md (parser/printer/JSX), compiler/core/README.md (Lambda/JS backend), rewatch/README.md, plus refreshed analysis/README.md and tools/README.md. AGENTS.md and CONTRIBUTING.md link every guide, so each maintained document has an incoming link from the repository entry path.
  • Compiler-facing JSX transformation notes move to compiler/syntax/JSX.md; docs/JSXV4.md becomes a short pointer preserving established external links. docs/Syntax.md, docs/Formatter.md (moved), docs/TYPING.adoc, and docs/reactive_reanalyze_design.md (with its context7.json entry) are retired after auditing; stale scratch documents under compiler/core, compiler/ext, compiler/depends, and analysis/reanalyze are removed.
  • Test comments that referenced the working design document are now self-contained.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PCtQiaDijUqA2fujQXvKUw

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ddd41b7c9

ℹ️ 关于 Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread compiler/core/destruct_exn.md
@cristianoc

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 1176ff9b35

ℹ️ 关于 Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.33%. Comparing base (29c907b) to head (2a5d740).

Additional details and impacted files
@@              Coverage Diff               @@
##           object-stage0    #8598   +/-   ##
==============================================
  Coverage          76.33%   76.33%           
==============================================
  Files                476      476           
  Lines              63253    63253           
==============================================
  Hits               48284    48284           
  Misses             14969    14969           
Files with missing lines Coverage Δ
analysis/reanalyze/src/dead_value.ml 85.58% <ø> (ø)
compiler/ml/btype.ml 88.59% <ø> (ø)
compiler/ml/ctype.ml 64.88% <100.00%> (ø)
compiler/ml/subst.ml 83.43% <ø> (ø)
compiler/ml/typecore.ml 86.07% <ø> (ø)
🚀 新建 features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8598

@rescript/belt

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@8598

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8598

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8598

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8598

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8598

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8598

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8598

commit: 2a5d740

@cristianoc
cristianoc force-pushed the docs/compiler-documentation branch 2 times, most recently from cb5a2f7 to 268fa9b 比较 August 29, 2026 17:49
cristianoc and others added 8 commits August 29, 2026 21:13
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
The guide refresh unintentionally changed the contributor workflow to
creating the pull request before its changelog entry; keep the original
policy text.

Signed-Off-By: Cristiano Calcagno <ccrisccris@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCtQiaDijUqA2fujQXvKUw
Removing the speculative destruct_exn.md design note left this docstring
pointing at a deleted file. The note's surviving conclusion - one cannot
soundly ask whether an arbitrary value is an exception, and try/catch
never needs to - now lives in the comment itself.

Signed-Off-By: Cristiano Calcagno <ccrisccris@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCtQiaDijUqA2fujQXvKUw
Signed-off-by: Cristiano Calcagno <cristianoc@users.noreply.github.com>
@cristianoc
cristianoc force-pushed the docs/compiler-documentation branch from 268fa9b to 2a5d740 比较 August 29, 2026 19:17
@cristianoc
cristianoc requested a review from cknitt August 29, 2026 19:46
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant