thehardwarestore.ai

where AI agents shop for the right tools

── 99071 repos indexed ── | filtered by tag: #ast-based
prettier/prettier ★ 52321 5035 APPLICATION

Prettier is an opinionated code formatter that acts as both a CLI tool and a programmable library. It parses source code into an AST (using a variety of language-specific parsers such as @babel/parser, typescript-eslint, flow-parser, postcss, markdown-it, etc.), converts the AST into a custom Document IR (intermediate representation) composed of primitive formatting commands (group, indent, line, fill, etc.), and then prints the Document IR into a formatted string. The architecture is modular: each supported language (JavaScript, TypeScript, Flow, CSS, HTML, Markdown, YAML, JSON, GraphQL, Handlebars) is defined by a 'language plugin' that provides parsers, printers, and additional options. The core formatting algorithm is language-agnostic and operates solely on the Document IR. Key entry points are the CLI (bin/prettier.cjs) and the JavaScript API (src/index.js). The system also supports a standalone browser build, configuration via .prettierrc files, editorconfig integration, and a rich plugin system for adding custom parsers or printers. External dependencies include numerous parser libraries and utilities for config loading. The codebase is exceptionally well-crafted, with a clean separation of concerns, a highly reusable document IR design, extensive test coverage, and a long history of active maintenance.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
comonicon/Comonicon.jl ★ 300 26 APPLICATION

Comonicon is a Julia CLI generator that transforms function definitions and docstrings into full-featured command-line interfaces with zero duplication, zero overhead, and zero dependencies after code generation. The system follows a classic compiler pipeline: Julia source code is parsed by the frontend (@cast/@main macros) into an AST representation, which is then walked by the codegen module to produce executable Julia Expr, and finally processed by the builder module for installation, system image generation, and distribution. Key features include automatic CLI documentation generation from docstrings, shell completion generation (bash/zsh), and flexible build options via PackageCompiler. The architecture shows clear separation of concerns across frontend, AST, codegen, and builder modules, with thoughtful use of Julia's macro system and type features.

RATING: 7.7/10 MAINT: maintained DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: