cloudwego / cloudwego/abcoder

Feature Request: Add Multi-language Parser Support to ABCoder

Aperta
#64 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
C-feature-request E-help-wanted
Lingua principale
Go
Stelle
390
Fork
57
Merge medio
2g 21h
PR unite (30g)
1

Descrizione

## 1. Summary

This proposal outlines the plan to extend `abcoder` to support multiple programming languages. Currently, `abcoder`'s capabilities are limited to Go/Rust/C/Pyhon, which restricts its use in polyglot environments. By adding multi-language support, we can significantly broaden the tool's applicability and enhance its utility for a wider range of projects.

## 2. Motivation

The primary motivation for this feature is to make `abcoder` a more versatile and powerful tool for code analysis and transformation. Many modern software projects are built using multiple languages, and a tool that can seamlessly handle this diversity is essential. Supporting multiple languages will enable developers to:

* Analyze and understand complex, multi-language codebases.
* Perform consistent code quality checks and enforce standards across different languages.
* Automate refactoring and code generation tasks in polyglot projects.
* Facilitate cross-language interoperability and integration.

## 3. Detailed Design

To achieve multi-language support, we will implement a flexible and extensible parser architecture. The key components of this design are:

* **Pluggable Parser Interface**: We will define a standardized interface for language parsers. This will allow new parsers to be integrated into `abcoder` as plugins, without requiring changes to the core system. Each parser will be responsible for transforming source code into a Universal Abstract Syntax Tree (UniAST).

* **Universal Abstract Syntax Tree (UniAST)**: The UniAST will serve as a common, language-agnostic representation of the code's structure. We will need to ensure that the UniAST is expressive enough to capture the semantics of all supported languages. This may involve extending the existing UniAST definition to accommodate new language constructs.

* **Language-Specific Parsers**: We will develop individual parsers for each supported language. These parsers will implement the pluggable parser interface and handle the specifics of parsing their respective languages. The initial set of languages to be supported will be determined based on community demand and strategic importance.

## 4. In-Progress Languages

| Language | Status | Assignee |
| --- | --- | --- |
| Go | Done | @AsterDY |
| Rust | Done | @AsterDY |
| C | Done | @Hoblovski |
| Python | In Progress | @Hoblovski |
| Java | Done | @Huabuxiu |
| TypeScript/JavaScript | Done | @angrychow |
| C++ | Not Started | |

## 5. Reference

Some related docs can be found here: https://github.com/cloudwego/abcoder/tree/main/docs

We welcome feedback and suggestions from the community on these and any other aspects of this proposal.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla documentazione correlata in docs/ e fai un inventario dei parser dei linguaggi esistenti e del design di UniAST descritto nell’issue. Determina l’interfaccia concreta del parser e l’ambito dei linguaggi prima dell’implementazione; il lavoro è completato quando i linguaggi concordati sono integrati tramite l’architettura estensibile e il loro codice può essere rappresentato da UniAST.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, cpp, go, java, javascript, python, rust, typescript
Ambito
compilers, devtools
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.