$ show MadAppGang/dingo
Dingo is a source-to-source transpiler for a custom language that extends Go with Rust-inspired features like sum types (enums), pattern matching, error propagation (`?`), safe navigation (`?.`), null coalescing (`??`), lambdas, tuples, and functional utilities (Option/Result). The transpiled output is clean, idiomatic Go with zero runtime overhead. The repository includes a full CLI tool (`dingo`) with build, run, fmt, lint, and update commands, as well as a language server (`dingo-lsp`) that wraps gopls as a proxy and uses source maps (`.dmap` binary format) for position translation. Editor integrations cover VS Code, Neovim, and JetBrains. The codebase is organized as a monolith with a modular plugin architecture for AST transformations. While actively developed and containing several well-crafted reusable components (source map binary format, error formatting with carets and suggestions, concurrent type cache, animated terminal mascot), the project shows signs of architectural fragmentation: duplicate parser implementations, a legacy preprocessor coexisting with a newer AST pipeline, multiple skipped tests, and known incomplete features tracked in TODOs. The scope is ambitious — many language features are implemented but the overall coherence suffers from incremental AI-assisted development patterns visible in the extensive ai-docs archive.
The LLM identified 4 files worth highlighting for reuse:
Binary source map format (DMAP v3) for mapping positions between Dingo source and generated Go output. Provides concurrent-safe reader/writer implementations with line-column and byte-offset mappings. Self-contained with no internal dependencies (only stdlib encoding/binary). Extractable for any toolchain needing compact position mapping (e.g., transpilers, preprocessors).
Rust compiler-style error message builder with line numbers, carets, annotations, and suggestions. Uses LRU file content cache and supports multiple annotation levels (error, warning, note, help). Self-contained with only stdlib dependencies (bufio, fmt, os, sync, unicode/utf8). Extractable for any CLI tool or language server needing human-friendly error output.
Animated mascot renderer for terminal output with composable frame configurations, layout manager, color schemes, and predefined states (Happy, Sad, Compiling, Success, etc.). Uses ANSI control sequences and lipgloss for styling. Self-contained with only stdlib and lipgloss dependencies. Extractable for any CLI tool wanting a character-based build status indicator.
Concurrent type loading cache with singleflight deduplication for Go packages. Uses sync.Map for fast lookups and singleflight to prevent duplicate concurrent loads. Self-contained with only stdlib and x/sync/singleflight dependencies. Extractable for any Go tool that needs safe concurrent type information caching (e.g., language servers, static analyzers).