Rewatch: in-process bsc prototype
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- ocaml
- Ambito
- build-system, compilers, performance
Direzione di ricerca
Inizia con la reimplementazione di OCaml Rewatch da #8653 e traccia il modo in cui viene invocato l’eseguibile bsc per i passaggi di analisi e compilazione, incluse le build di stdlib e dei test. Documenta gli artefatti e lo stato condiviso coinvolti, quindi definisci un benchmark di prototipo sequenziale e una raccomandazione concreta su quale dovrebbe essere l’obiettivo di un’implementazione successiva.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Based on the OCaml rewatch reimplementation from #8653, we can prototype integrating the compiler directly into the rewatch executable to avoid having to spawn a bsc binary for each compilation step.
@cristianoc fed the prompt below into Fable, and I fed the same one into Astra.
I'll post the responses we got as separate comments. These can serve as a basis for further discussion.
We are porting Rewatch to OCaml as a drop-in for the Rust version. Next I want to see whether in-process bsc is worth it: stop spawning a bsc process per module, and ideally stop writing cmj/cmt (and maybe cmi) to disk at all.
Do not implement yet. Think this through with me.
Context:
- A lot of build time is process creation and artifact I/O, not typechecking.
- Integration might be >2x. I want a dirty prototype that measures that, even if it is incorrect and single-threaded.
- The compiler has lots of global/shared mutable state (Clflags, Config.load_path, Env cache, Ident, Js_config, typechecker mutation, etc.). There are essentially no tests that reuse one compiler process across modules.
- Getting rid of global state is probably much easier than the Rewatch port, but only if we know what to reset/isolate.
- No multicore required for the prototype. Sequential in-process with no cm* writes may already be faster.
- A real compiler service / parallel-from-one-process comes later.
Please:
- Survey how bsc is invoked today (parse vs compile), what it reads/writes (ast, cmi, cmj, cmt, js), and which globals would leak across compilations.
- Propose the smallest prototype that can give a real speedup signal on stdlib + tests (or a real project). What can stay on disk? What must be in memory? What must be reset between modules?
- Argue whether that prototype is the right next step, or whether something else is better (reset-and-reuse API, keep writing cmi only, compiler service still spawning-free but still on disk, etc.).
- Explicitly list what is likely to go well, what is likely to go wrong, and how we would get fooled by a misleading benchmark.
- Recommend a concrete goal we could later implement with /goal.
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 55
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rescript-lang/rescript
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
rescript-lang/rescript#8647 ·
-
rescript-lang/rescript#8632 · 1 assegnatario ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
rescript-lang/rescript#8624 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rescript-lang/rescript#8596 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
rescript-lang/rescript#8573 · 1 reazione ·
Tutte le issue di rescript-lang/rescript
Issue simili
-
Use zstd compression? ApertaNeeds Design Priority: Wishlist
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
elementary/flatpak-platform#253 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/hone-maven-plugin#1060 ·
-
0.kind: build failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Update Vish to 1.1.5 Apertapackage-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oSoWoSo/vOid_Community_repOsitory#144 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100