paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Object Graph Programming

对象图编程
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 2/10 · 论文属于语言设计与DSL,聚焦用Cypher声明式查询整个对象堆,不涉及机器学习/Agentic程序、静态分析、浮点程序分析或贝叶斯程序分析,与用户核心研究方向几乎无交集;仅作为程序状态查询的工程实现有间接参考价值。引用 2 inbox
Aditya Thimmaiah, Leonidas Lampropoulos, Christopher Rossbach, Milos Gligoric
crossref: 2026-09-12

AI 速览

一句话:提出对象图编程 OGO,用 Cypher 声明式查询直接读写整个对象堆,并为 Java 实现两种原型。

现有集合查询(如 LINQ)只能以集合为数据源,难以声明式访问整个对象堆和运行时状态,反射与全状态断言也较繁琐。本文提出对象图编程(OGO):将堆建模为对象图,节点是对象,边是对象间关系;采用 Cypher 作为查询语言,把整个对象图视作单一集合,用于查询集合、内省运行时状态和编写访问全程序状态的断言。作者为 Java 实现两个原型:把对象图转译为 Neo4j 数据库执行 Cypher 查询,以及自研内存图查询引擎直接查询对象堆。最后用 OGO 重写大型开源项目中的数百条语句,报告经验与性能。

问题
现有集合查询(如 LINQ)难以对完整对象堆与运行时状态进行声明式访问,反射式内省和全状态断言也较繁琐。
方法
将对象堆建模为对象图(对象为节点、关系为边),采用 Cypher 作为查询语言,把整个对象图视作单一集合,并实现 Java 原型:转译为 Neo4j 与内存图查询引擎。
评估
用 OGO 重写大型开源项目中的数百条语句,报告改写经验以及两种原型的性能。
原文摘要(Abstract)

We introduce Object Graph Programming (OGO), which enables reading and modifying an object graph (i.e., the entire state of the object heap) via declarative queries. OGO models the objects and their relations in the heap as an object graph thereby treating the heap as a graph database: each node in the graph is an object (e.g., an instance of a class or an instance of a metadata class) and each edge is a relation between objects (e.g., a field of one object references another object). We leverage Cypher, the most popular query language for graph databases, as OGO's query language. Unlike LINQ, which uses collections (e.g., List) as a source of data, OGO views the entire object graph as a single "collection". OGO is ideal for querying collections (just like LINQ), introspecting the runtime system state (e.g., finding all instances of a given class or accessing fields via reflection), and writing assertions that have access to the entire program state. We prototyped OGO for Java in two ways: (a) by translating an object graph into a Neo4j database on which we run Cypher queries, and (b) by implementing our own in-memory graph query engine that directly queries the object heap. We used OGO to rewrite hundreds of statements in large open-source projects into OGO queries. We report our experience and performance of our prototypes.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11290,
  title = {Object Graph Programming},
  author = {Aditya Thimmaiah and Leonidas Lampropoulos and Christopher Rossbach and Milos Gligoric},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3623319}
}