Beagle,存储 AST 树的源代码管理系统
发布: (2026年3月8日 GMT+8 21:28)
2 分钟阅读
原文: Hacker News
Source: Hacker News
Beagle SCM
Beagle 是一种源代码管理系统,它存储 AST 树,而不是二进制块。
其总体思路是 代码的数据库,作为所有代码相关活动的中心以及所有相关数据(工单、CI 结果等)的存储。
后端存储几乎可以是任何键值数据库(目前使用 RocksDB)。
数据格式 AST BASON 带有 CRDT 的特性。
Beagle 仍处于早期阶段且属于实验性质。它自行托管;其余部分不作保证。使用风险自负。
进一步阅读
使用示例
# Initial POST of a project. We specify repo, project path.
# Absence of http: or ssh: makes it local to the store in $HOME/.be
$ be post //replicated.live/@gritzko/librdx
...
OK h ast/tree-sitter/point.h
OK h ast/tree-sitter/parser.h
OK c ast/tree-sitter/query.c
OK text ast/verilog/LICENSE
...million more lines...
# Inspect RocksDB inners just out of curiosity.
$ ls $HOME/.be/replicated.live/
# Inspect worktree/repo state
$ cat .be
//replicated.live/@gritzko/librdx
$ be
repo: replicated.live
project: /@gritzko/librdx
branches: *main
base files: 574, waypoints: 0
$ cd /some/other/dir
$ be get //replicated.live/@gritzko/librdx
...a million lines...
OK h rdx/test/YX.h
OK h rdx/test/ZE.h
OK sh rdx/test/http-test.sh
OK sh rdx/test/query-test.sh
OK sh scripts/ci-fast.sh
$ cd librdx
$ be
repo: replicated.live
project: /@gritzko/librdx
branches: *main
base files: 574, waypoints: 0