Codespine version 2: support many programming languages with tree-sitter and pprof
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- backend-api-design
Direzione di ricerca
Start by reading docs/GRAPHIFY_COMPARISON.md and research the profiling tools, output formats, pprof support, converters, and tree-sitter call resolution for Go, Python, Java, Rust, and Node.js. Post the findings as a table in a comment on this issue, including whether C and C++ should be added to the first language list. Done means the table addresses all five research questions for each language.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Goal
Build Codespine version 2: the same product as Codespine today, but for many programming languages instead of TypeScript only. Today Codespine reads TypeScript with ts-morph and reads runtime cost from V8 CPU profiles. Version 2 replaces both inputs with language-neutral ones.
Proposed approach
- Static analysis: use tree-sitter, a parser library that supports many languages, in place of ts-morph. Graphify uses tree-sitter for the same purpose (see
docs/GRAPHIFY_COMPARISON.md). - Runtime profiling: use the pprof profile file format, which many language runtimes and profiling tools can write, in place of V8 CPU profiles. Converters exist for profile formats that are not pprof.
Languages to support first
- Go
- Python
- Java
- Rust
- Node.js (already supported through V8 CPU profiles)
C and C++ do not appear in the first list. This must be checked: tree-sitter has grammars for both, and C and C++ programs can be profiled with system tools. See the research task below.
Important difference from TypeScript
ts-morph resolves a call site to the exact declaration through the TypeScript compiler. tree-sitter only parses syntax. It does not resolve names across files, imports, or types. Version 2 must decide how to resolve calls for each language, and must label an edge that is only a guess differently from an edge that is resolved exactly. This is the main design risk of this issue.
Research task (first step, before any code)
For each language in the list above, find out:
- Which profiling tool the language community uses.
- Which profile file format that tool writes.
- Whether that tool can write pprof directly.
- Which converter exists to turn the other profile formats into pprof.
- For tree-sitter: how good call resolution can be for that language.
The result should be a table in a comment on this issue. The result decides what Codespine version 2 must write itself, and what it can reuse as a library.
Possible outcome
Codespine version 2 would be a library that other products can embed, because it would then optimize code in any language. Two candidates for embedding are Heidrun Code and Heidrun Data.
Open questions
- Should Codespine version 2 live in this repository, or in a new repository?
- Which language is the second language to implement after TypeScript?
- Does Codespine version 2 keep ts-morph for TypeScript, because it resolves names exactly?
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 jeromeetienne/codespine
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jeromeetienne/codespine#233 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
jeromeetienne/codespine#232 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jeromeetienne/codespine#223 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
jeromeetienne/codespine#220 · 1 commento ·
-
pending projectsAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
jeromeetienne/codespine#213 · 1 commento ·
Tutte le issue di jeromeetienne/codespine
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
awslabs/visual-asset-management-system#1278 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
mifi/lossless-cut#3213 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
plasma-umass/scalene#1123 ·
I maintainer di solito rispondono entro 1 giorno