Port selected upstream OCaml type checker improvements (post 4.06)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- ocaml
- 領域
- compilers
調査の方向性
Start by reading the compiler sources under compiler/ml and compare the listed upstream changes with the specific behavior you want to port. The issue asks for each candidate to be a separate PR with tests and a changelog fragment; choose one candidate and use its stated files, such as includecore/includemod for diff-based inclusion errors. Done means the selected improvement is ported and covered by tests, with a changelog fragment.
索引モデルが issue の本文から書いたものです。
説明
The type checker and pattern-match compiler in compiler/ml are a 4.06-era fork of OCaml. They have diverged a lot since then. Upstream has made several improvements in the meantime that would help ReScript users directly. This issue tracks the ones worth porting by hand. A full resync is not a goal.
Candidates, by value
- Diff-based inclusion errors (4.13,
Diffing). Signature mismatches name the record field or variant constructor that was added, removed, swapped or renamed, and the same goes for functor arguments. Today we print "Their kinds differ" or "Fields number N have different names"..resimismatches are common, and the change stays mostly withinincludecore/includemod. It needs a port by hand, because of our own error cases (Field_optional,Runtime_annotation,Not_undefined, …). - Shapes (4.14).
.cmtfiles record where each definition comes from, through functor applications,includeand module aliases. This would remove the analysis limitation for cross-file references through applied functors (see #9084). It is also the basis for project-wide find-references. Requires a cmt format change. - Matching on mutable fields under guards (upstream ocaml/ocaml#7241, unsound). We are affected: a failed guard that changes a mutable field can make
switchtake a case that does not match. Repro and details in #9129. Upstream fixed it in OCaml 5.3 (ocaml/ocaml#13138, ocaml/ocaml#13152). - Warning names (4.12). Accept names like
+unused-varnext to numbers in-wand inrescript.json. Cheap to add, and warning configs become readable. -
Parmatchimprovements. These can be picked one at a time. Counterexamples mention guarded clauses ("some guarded clause may match this value"). Unused cases inside or-patterns are detected more precisely. Refutation is faster. - Structured unification traces (
Errortrace, 4.14/5.0). These separate unification, equality and moregen failures, which gives more precise "not compatible" explanations. We have already rewritten many messages (error_message_utils), so the gain is smaller and touches more code. - Type scopes (4.08–4.11). Escape checks for locally abstract types and first-class modules would use a separate scope instead of levels. This is invasive (
ctype/typecore), so only worth it if escape bugs come up. - GADT soundness fixes (injectivity, 4.12, and others). Port these when a bug report needs one. GADTs are rare in ReScript code.
Out of scope
- Abstract
type_expr(4.14) and thewith_local_levelrefactor (5.1): a lot of churn, no user-visible gain. - Upstream error rendering (
Location.report): we have our owncode_frame. - Lambda/Simplif optimisations and Flambda: the JS backend has its own
Lampasses. - Language features that don't fit ReScript: binding operators, labeled tuples, effects, unboxed layouts and modes,
with module type. - Alerts (
[@alert]): would only be nice to have unless there is demand for categories beyond@deprecated.
Each checked item should be its own PR with tests and a changelog fragment where users can see the change.
- 主要言語
- OCaml
- スター
- 7.5k
- フォーク
- 484
- 平均マージ
- 20時間 43分
- マージ済み PR(30日)
- 263
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rescript-lang/rescript のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
rescript-lang/rescript#9139 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rescript-lang/rescript#9151 ·
メンテナーはふだん 1 日以内に返信
-
Printed @as names of fields and constructors turn non-ASCII letters into other characters対応中かも @cknitt が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
rescript-lang/rescript#9142 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
rescript-lang/rescript#9122 ·
メンテナーはふだん 1 日以内に返信
-
Dev dependencies interacting対応中かも @CarlOlson が 4 日前に担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 25/100
rescript-lang/rescript#9089 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rescript-lang/rescript の issue をすべて見る
似ている issue
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9087 ·
メンテナーはふだん 1 日以内に返信
-
confirmed generated by fuzzer llvm:codegen miscompilation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
llvm/llvm-project#237380 ·
メンテナーはふだん 1 日以内に返信
-
area:observer area:trace-tape found-by:code-review kind:docs-drift
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
InauguralSystems/EigenScript#2212 ·
メンテナーはふだん 1 日以内に返信
-
bug medium priority openmp tokenizer wrong result
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信