Skip to content

Add tree-sitter parsing for precise AST extraction #12

Description

@francomano

Problem

CoreBall v0.1 uses Python stdlib ast for Python and regex for JS/TS. This limits accuracy and language coverage. The competitive landscape (codegraph, graphsift, codescope) all use tree-sitter for precise, multi-language parsing.

Proposal

Integrate tree-sitter as the primary parser for all supported languages:

  • Python, JavaScript, TypeScript (current) - improve precision
  • Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin (new)
  • Tree-sitter grammars compile to WASM - no native build needed for Python

Benefits

  • 20+ languages from one parser backend
  • Precise AST extraction (functions, classes, methods, imports, calls)
  • Match competitor capabilities (codegraph supports 23 languages)
  • WASM grammars keep the zero-dependency promise

Acceptance criteria

  • tree-sitter integrated as optional parser backend
  • At least 5 new languages supported
  • Existing Python/JS/TS parsing preserved as fallback
  • Benchmark comparison vs current regex-based extraction

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions