TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Code Quality at Scale with AST Grep and LLMs

13 pointsby smb067 months ago

4 comments

smb067 months ago
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).<p>Key aspects:<p>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.<p>2. Deterministic Grounding: We extract concrete code elements (variable names, function signatures, etc.) to constrain the LLM&#x27;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.<p>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.<p>We have open-sourced a collection of AST Grep rules (<a href="https:&#x2F;&#x2F;github.com&#x2F;coderabbitai&#x2F;ast-grep-essentials">https:&#x2F;&#x2F;github.com&#x2F;coderabbitai&#x2F;ast-grep-essentials</a>) and are seeking community feedback on this approach to code analysis.<p>We&#x27;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
herrington_d7 months ago
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!
entherhe7 months ago
It reminds me of a platform for AST based code quality control called merico, <a href="https:&#x2F;&#x2F;devlake.apache.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;devlake.apache.org&#x2F;</a>
daodaolee7 months ago
looking forward