neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
Rust port of the Dart analyzer (dart analyze, language server), differential-tested against Dart SDK 3.13.3
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
dartr is a port of the Dart analyzer to Rust. The reference version is the
Dart SDK 3.13.3. It is one native binary with these commands:README 전문 보기 ↗[!NOTE] This project is a joke and an experiment. It tests how feasible it is today to "vibe port" a huge project from one language to another with AI coding agents. Do not rely on it for anything important.
dartr is a port of the Dart analyzer to Rust. The reference version is the Dart SDK 3.13.3. It is one native binary with these commands:
dartr analyze: the same diagnostics as dart analyze (errors, warnings,
lints, analyzer plugins), with the same options, output formats and exit codes.dartr format: a port of dart_style (dart format).dartr fix: the bulk fixes of dart fix (--dry-run, --apply, --code).dartr language-server: an LSP server. Dart-Code (VS Code) starts it through a
small shim; other editors can start it directly.dartr analysis-server or --protocol=analyzer: the legacy analysis server
protocol (partial).The aim is the same output as the Dart tools, produced faster. Correctness is
checked by comparing dartr with the real Dart analyzer on large corpora (Dart
SDK tests, Flutter, analyzer, a 1.5 million line application).
| Area | State |
|---|---|
| Scanner, parser, AST | At parity (token, event and AST dumps match the Dart analyzer on the corpora) |
| Element model, types, resolution, constants | At parity on Flutter, flutter_tools and analyzer |
| Error and warning verifiers | At parity on the SDK tests (a few known differences) |
| Lints | All rules ported; compared with dart analyze on the corpora |
dartr analyze | Same options, formats and exit codes as dart analyze. Same diagnostics on Flutter, flutter_tools, analyzer 9.0.0, a 1.56 million line application and 671 packages from the pub cache and the Flutter SDK (checked with tools/analyze_compare.py) |
dartr format | Same output as dart format on the dart_style test data and corpora |
dartr fix | Same output, exit codes and edits as dart fix on the fixture and on copies of the corpora; the pubspec fixes (missing_dependency) are not ported yet |
dartr language-server | Diagnostics, outline, closing labels, folding, selection ranges, document symbols, formatting; navigation (definition, type definition, implementation, references, document highlight), hover, signature help, semantic tokens, inlay hints, call and type hierarchy, workspace symbols. completion; code actions (quick fixes, assists, fix all, organize imports, sort members); rename; refactorings (extract method, local variable and widget, inline local and method, convert getter/method, move file); completion in pubspec.yaml, analysis_options.yaml and fix_data.yaml; document colors, document links, code lens, inline values; Flutter outline; files changed on disk are re-analyzed. analyzer plugins (diagnostics, fixes and assists). |
| Legacy protocol | All 59 requests and 22 notifications of the protocol, including errors, hover, navigation, search, completion, quick fixes, assists, refactorings, bulk fixes, Flutter outline and lsp.handle |
docs/PLAN.md has the plan and docs/TIMELINE.md the project history. This is
early software: if dartr and dart analyze differ, dartr is wrong. Please report it
(see "Report a difference").
dartr needs a Dart or Flutter SDK on the machine. It reads the dart:
libraries (dart:core and the others) from that SDK, so it does not contain them.
It uses the SDK of the first dart executable on PATH (symbolic links are
resolved; for a Flutter SDK it uses bin/cache/dart-sdk). The SDK version
should be 3.13.3: dartr copies the behavior of that version. Run dart --version
to check.
Supported platforms: macOS arm64 and Linux x86_64.
Homebrew:
brew install orestesgaolin/tap/dartr
GitHub Releases: download dartr-<version>-<target>.tar.gz for
aarch64-apple-darwin or x86_64-unknown-linux-gnu from
https://github.com/orestesgaolin/dartr/releases, check it against the .sha256
file, and extract it. bin/dartr is the binary. The archive also has
tools/shim/dartr_shim.dart (for VS Code), LICENSE and THIRD_PARTY_NOTICES.md.
From source (Rust stable, edition 2024):
cargo build --release -p dartr # target/release/dartr
dartr --version prints the dartr version and the pinned Dart SDK version.
dartr analyze # current package, like `dart analyze`
dartr analyze lib test/foo_test.dart
dartr analyze --format=json --fatal-infos
dartr format lib # like `dart format`
dartr format --output=none --set-exit-if-changed .
dartr fix --dry-run # like `dart fix`
Options, output and exit codes are those of dart analyze and dart format
(including --format=machine|json, --fatal-warnings, --fatal-infos,
--no-fatal-warnings, -o, --set-exit-if-changed). Run dartr analyze --help.
Analyzer plugins (plugins: in analysis_options.yaml): as in dart analyze,
the plugins are resolved with pub upgrade on first use, so the first run needs
network access. Plugins run out of process and need the Dart SDK.
dart.analyzerPath must point to tools/shim/dartr_shim.dart. The
shim starts dartr language-server with the same arguments. Set the environment
variable DARTR_BIN to the dartr binary, or put dartr next to the shim. With
Homebrew, the shim is at $(brew --prefix dartr)/libexec/dartr_shim.dart and
dartr is next to it. See docs/editor-setup.md.dartr language-server directly.flutter analyze and IntelliJ start <sdk>/bin/dart language-server and have
no setting for another server. They do not work with dartr yet.dart analyzedart analyze --format=json > dart.json; echo "dart: $?"
dartr analyze --format=json > dartr.json; echo "dartr: $?"
diff <(jq -S . dart.json) <(jq -S . dartr.json)
Use the same SDK version (3.13.3) for both. Differences in --format=machine
output or in the exit code count as differences.
Open an issue at https://github.com/orestesgaolin/dartr/issues with:
pubspec.yaml / analysis_options.yaml if they matter)
that shows it;dartr --version and dart --version;dartr language-server does not use a disk cache yet, so a warm dart language-server
can start faster on packages (1.4 s vs 0.9–3.7 s on flutter_tools, 1.9 s vs 1.3–4.2 s on analyzer,
4.2 s vs 2.0–6.1 s on Flutter; on the 1.56 million line application with jaspr_lints, dartr starts in
33.0 s vs Dart's 93.0 s cold and 40.3 s warm). Requests (hover, completion, definition, references) are as
fast as Dart's or faster (bench/lsp_bench.py, 2026-10-13).dartr analyze is similar to Dart's on packages (0.53 GB vs 0.37 GB on
flutter_tools, 0.59 GB vs 0.55 GB on analyzer, 0.83 GB vs 0.89 GB on Flutter) and lower on the 1.56
million line application (2.28 GB vs 3.90 GB), or 0.10 to 0.12 GB on packages with a warm --cache.
Language-server RSS after startup is about 2 times Dart's on packages (0.53 to 0.84 GB vs 0.26 to 0.36 GB)
and slightly lower on the application (3.06 GB vs 3.33 GB).dartr analyze and dart analyze (3.13.3) on the same machine, with the full pipeline (errors,
warnings, lints, analyzer plugins). Both report the same diagnostics on all four projects. Wall time
in seconds, mean of 3 runs, lower is better. By default dartr analyze runs without a disk cache;
it also has an optional disk cache (--cache / DARTR_CACHE_DIR). dart was measured twice: with
its normal disk cache (~/.dartServer), warmed by an earlier run, and with an empty cache.
---
config:
xyChart:
height: 360
themeVariables:
xyChart:
plotColorPalette: "#0175C2, #9CC8EA, #DEA584"
---
xychart-beta horizontal
%% -100 = no bar: one series per measurement gives each its own color
title "Large projects: wall time (s), lower is better"
x-axis ["app, dart warm", "app, dart empty", "app, dartr", "flutter, dart warm", "flutter, dart empty", "flutter, dartr"]
y-axis "seconds" 0 --> 86.3
bar [78.4, -100, -100, 7.77, -100, -100]
bar [-100, 77.6, -100, -100, 20.3, -100]
bar [-100, -100, 18.4, -100, -100, 1.82]
---
config:
xyChart:
height: 360
themeVariables:
xyChart:
plotColorPalette: "#0175C2, #9CC8EA, #DEA584"
---
xychart-beta horizontal
%% -100 = no bar: one series per measurement gives each its own color
title "Smaller packages: wall time (s), lower is better"
x-axis ["analyzer, dart warm", "analyzer, dart empty", "analyzer, dartr", "flutter_tools, dart warm", "flutter_tools, dart empty", "flutter_tools, dartr"]
y-axis "seconds" 0 --> 10.6
bar [2.32, -100, -100, 2.36, -100, -100]
bar [-100, 9.67, -100, -100, 8.59, -100]
bar [-100, -100, 0.881, -100, -100, 0.874]
Dark blue: dart analyze with a warm cache. Light blue: dart analyze with an empty cache.
Orange: dartr analyze (cold, default). "app" is a 1.56 million line Flutter application (pub workspace with
analyzer plugins).
| project | Dart lines | dart analyze, warm cache | dart analyze, empty cache | dartr analyze | dartr analyze, warm --cache | peak RSS (dart / dartr / warm --cache) |
|---|---|---|---|---|---|---|
| application (pub workspace, analyzer plugins) | 1,559,637 | 78.4 s (52.2 to 107.1) | 77.6 s | 18.4 s | 16.0 s (1.32 s without plugins) | 3,989 / 2,332 / 2,258 MB |
Flutter packages/flutter | 1,309,663 | 7.8 s (5.5 to 10.2) | 20.3 s | 1.82 s | 0.21 s | 907 / 855 / 122 MB |
analyzer 9.0.0 (pub) | 909,249 | 2.3 s (2.0 to 2.7) | 9.7 s | 0.88 s | 0.21 s | 566 / 606 / 117 MB |
flutter_tools | 455,099 | 2.4 s (1.6 to 2.7) | 8.6 s | 0.87 s | 0.25 s | 378 / 543 / 103 MB |
dartr is faster than dart analyze on all four projects, with or without a disk cache.
Cores: dart analyze runs the whole analysis in one isolate, so it uses one core (plus the Dart VM's
own garbage collector and compiler threads, about 1.2 cores in total). dartr analyzes libraries in parallel
on all cores. Most of the cold speed comes from that: on one thread dartr does about as much work as Dart (see
the thread-scaling section in docs/BENCHMARKS.md). dartr uses more CPU time
in total on a cold run (for example 13.4 s of user time on Flutter in a 1.82 s run).
Method: measured on 2026-10-13 with hyperfine (1 warm-up run, 3 measured runs) on an Apple M5 Pro with
15 cores (load average 4 to 6). Dart's warm-cache times vary more than dartr's. To repeat it:
bench/compare.sh (COLD=1 adds the empty-cache runs) and bench/memory.sh. The language server (editor
use) is measured separately with bench/lsp_bench.py.
dartr is licensed under the BSD 3-Clause License (LICENSE). It is a port of
code of the Dart project and uses test data and diagnostic messages from it; the
licenses and copyright lines of that code are in
THIRD_PARTY_NOTICES.md. dartr is not affiliated with or
endorsed by Google or the Dart team.