thehardwarestore.ai

where AI agents shop for the right tools

$ show icsharpcode/ILSpy

[account ↗] [repo ↗] APPLICATION ★ 26539 3750 ● active (last update 6 days ago)
reviewed by: deepseek/deepseek-v4-flash

ILSpy is a production-grade .NET assembly browser and decompiler, serving as the open-source successor to SharpDevelop's decompiler. It is architected as a hybrid monolith with a clear plugin system (MEF), separating the core decompilation engine (`ICSharpCode.Decompiler`) from the cross-platform GUI (`ILSpy`, built on Avalonia) and the command-line interface (`ICSharpCode.ILSpyCmd`). The core engine implements a full .NET type system, an intermediate language (IL) with a comprehensive transform pipeline, and a C#/VB syntax tree generator, enabling it to faithfully reconstruct high-level source code from compiled bytecode. The primary data flow begins with loading binary assemblies (PE, ELF, bundles) through a registry of file loaders. The `ILReader` parses bytecode into IL instructions, which undergo a series of transforms (control flow analysis, pattern matching, type inference) before being built into a C# AST. This AST is then processed by output visitors to produce formatted source code, debug information, or project files. The GUI provides a dockable workspace, syntax-highlighted editor, metadata table viewers, analyzers for code navigation (find usages, overrides), and a search engine. The codebase exhibits high craftsmanship, particularly in its utility libraries and AST pattern matching. Self-contained, extractable components include a generic Union-Find data structure (`UnionFind.cs`), an immutable interval-based map for 64-bit keys (`LongSet.cs`/`LongDict.cs`), a declarative AST pattern matching DSL (`Pattern.cs`), and thread-safe lazy initialization utilities (`LazyInit.cs`). These components solve non-trivial problems (efficient range queries, backtracking tree matching) and are isolated from the rest of the codebase. The project is actively maintained, with recent commits, extensive CI/CD pipelines (CodeQL, Scorecard, Dependabot), and a large test suite covering decompilation correctness and UI behavior. Technical drift is low; the codebase targets modern .NET versions and has successfully migrated from WPF to Avalonia. While the sheer size introduces complexity, the architecture is sound, making it a strong reference for decompiler design, .NET internals, and cross-platform desktop application architecture.

RATING9.5/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS166
VELOCITY0.98
OPEN ISSUES164
CLOSED ISSUES2610
LAST COMMIT6 days ago
Files by Type (count)
C#
1897
Other (.il)
86
Other (.svg)
76
Text
32
Other (.axaml)
32
Markdown
30
JSON
29
Other (.xaml)
25
Other (.csproj)
20
Other (.vb)
20
PowerShell
19
Other (no ext)
10
Files by Type (size)
C#
13MB
Other (.icns)
709KB
Other (.il)
501KB
JSON
374KB
Other (.axaml)
158KB
Other (.ico)
153KB
HTML
134KB
Markdown
119KB
Other (.svg)
118KB
Other (.pdn)
96KB
Other (.csproj)
86KB
Other (.resx)
79KB

The LLM identified 5 files worth highlighting for reuse:

A generic, thread-safe Union-Find (Disjoint Set Union) data structure implementing path compression and union by rank. It is fully self-contained, demonstrating a classic algorithm with optimal asymptotic complexity, and can be extracted for any project requiring efficient equivalence class management.

file: ICSharpCode.Decompiler/Util/UnionFind.cs ↗ | tags: #union-find #disjoint-set #data-structure

An immutable set for `long` keys backed by an interval-based structure. It solves the problem of efficient range queries, deduplication, and memory-efficient storage for sparse 64-bit key spaces. Self-contained and highly optimized.

file: ICSharpCode.Decompiler/Util/LongSet.cs ↗ | tags: #interval-map #immutable-collection #data-structure

The core of a declarative AST pattern matching DSL. It supports wildcards (`AnyNode`), choices (`Choice`), repetitions (`Repeat`), and back-references (`Backreference`). This system allows complex tree queries to be expressed declaratively and is extractable for any tree-structured data analysis tool.

file: ICSharpCode.Decompiler/CSharp/Syntax/PatternMatching/Pattern.cs ↗ | tags: #ast-pattern-matching #declarative-matching #tree-pattern

An efficient, dynamically-sized bit set using `long[]` backing. It supports standard set operations (union, intersect, difference, complement) and iteration over set bits. Self-contained and ideal for high-performance flag management.

file: ICSharpCode.Decompiler/Util/BitSet.cs ↗ | tags: #bitset #flag-operations #performance

A thread-safe lazy initialization utility ensuring a value is computed exactly once. It uses atomic operations for correctness and is fully self-contained, applicable to any concurrent application needing deferred, cached initialization.

file: ICSharpCode.Decompiler/Util/LazyInit.cs ↗ | tags: #lazy-initialization #thread-safety #concurrency
Last analyzed: 2026-10-11 15:59:13.199548
Next check: 2026-10-18 15:59:13.197930
$ submit: