News for hackers. Stuff that matters.
Re:Code Quality at Scale with AST Grep and LLMs by smb06 on Thursday October 17, 2024 @01:26PM (#41871662)
Hey folks - We (at a startup using AI for code-reviews) have implemented a code quality analysis system that combines Abstract Syntax Tree (AST) parsing with Large Language Models (LLMs).

Key aspects:

1. AST Grep for Pattern Matching: enables flexible, language-agnostic rules to identify complex code patterns. This leads to more sophisticated static analysis compared to regex-based linters.

2. Deterministic Grounding: We extract concrete code elements (variable names, function signatures, etc.) to constrain the LLM's output, ensuring syntactically valid suggestions within the project context. Using AST Grep results as input for an LLM, we provide contextual grounding that improves the relevance and accuracy of AI-generated suggestions.

3. Cross-Language Analysis: works across multiple programming languages, enabling the identification of architectural patterns, potential security issues, and performance bottlenecks that might escape traditional linting tools.

We have open-sourced a collection of AST Grep rules (https://github.com/coderabbitai/ast-grep-essentials) and are seeking community feedback on this approach to code analysis.

We're be most interested in hearing about real-world applications and edge cases. Performance comparisons with traditional static analysis tools and suggestions for expanding the rule set

Re:Code Quality at Scale with AST Grep and LLMs by herrington_d on Thursday October 17, 2024 @05:03PM (#41873763)
Thank you for sharing this! While AI excels at providing general advice, it often falls short on delivering contextual insights specific to your code. I’m thrilled to see that ast-grep can be effectively used alongside AI to add more value for developers. Great job!
Re:Code Quality at Scale with AST Grep and LLMs by entherhe on Friday October 18, 2024 @01:56AM (#41876694)
It reminds me of a platform for AST based code quality control called merico, https://devlake.apache.org/
Re:Code Quality at Scale with AST Grep and LLMs by daodaolee on Friday October 18, 2024 @03:04AM (#41877006)
looking forward