密歇根大学教授打造类 Python 语言 Jac:专为 AI Agent 设计的统一语言与运行时
英文标题:🔶 Michigan prof creates Python-like Jac language for AI agents
密歇根大学教授 Jason Mars 近日推出了专为 AI 与 AI Agent 设计的新型编程语言 Jac 及其运行时 Jaseci,将智能体视为一等公民。Jac 融合了 Python 与 TypeScript 生态,并结合 LLVM 实现类似 Rust 的借用检查与高性能 C/C++ 互操作,底层原生采用图计算模型以实现低 Token 消耗与天然并行。在复刻代码审查工具的实测中,Jac 驱动的 Agent 表现显著优于基于 LangGraph 的传统实现。该方案直击当下人类中心化工具链拖累 Agent 性能的痛点,为下一代 Agent 原生开发范式提供了全新探索。
13.0 KB
54.7 KB
19.5 KB
88.0 KB
14.3 KB
54.0 KB
21.7 KB
86.2 KB
1.7 KB
7.0 KB
6.0 KB
2.5 KB
8.0 KB
2.3 KB
125.5 KB
中文
大多数编程语言都是为人类程序员编写的,但这一现状即将发生改变。密歇根大学教授 Jason Mars 开发了一门极具学术雄心的新语言 Jac 以及名为 Jaseci 的运行时,将 AI 和 AI Agent 视作一等实体(first-class entities)。
本周,Mars 在北卡罗来纳州罗利举行的 All Things Open 大会演讲中展示了该语言和运行时。
从编程语言到构建工具链,我们用于创建软件的工具全部是为人脑使用而设计的。它们诞生于生成式 AI 出现之前,难以适应 Agent 的实际需求。
他指出,当前的 Agent 正在被多语言的复杂性所淹没。“我们不再直接使用这些工具了,而是我们在使用 Agent,由 Agent 去使用那些工具。因此我需要的不是新工具,而是为我的 Agent 量身打造的工具,”他对现场观众说道。
吞噬一切的宏大语言
在演讲中,Mars 援引了 Bun 框架作者 Jarred Sumner 的例子。今年早些时候,Sumner 使用 Mythos 的预览版本,花费了价值 16.5 万美元的 Anthropic token 将 Bun 的 Zig 代码转换为 Rust。Mars 认为,这笔巨额开销与其说是因为任务本身复杂,不如说是因为所有内容都必须在两种以人类为中心的编程语言之间来回翻译。
“Mythos 本该像‘天网’一样黑入核反应堆并接管地球,但除非你花上 16.5 万美元,否则它连把 Bun 翻译成 Rust 都办不到,”他指出。
按照 Mars 的理论,Jac 是一种旨在“吞噬”其他语言的新型编程语言。具体而言,它是一门类似 Python 的语言,同时集成了 TypeScript 和 Python 的运行时与工具链。它既能编译为 Python 字节码、JavaScript,也能编译为原生机器码,并可直接利用 PyPI 与 npm 生态系统中的所有库。
不仅如此!Jac 还引入了 LLVM 编译器来实现类似 Rust 的借用检查和所有权语义,使 Jac 代码能够直接受益于这些内存安全规则和性能提升。得益于同套 LLVM 集成,它还能直接导入 C 和 C++ 库。
Mars 还介绍了一项“弹出功能(eject function)”,能够将用户的 Jac 代码反向编译回 TypeScript、Python 或 C,以满足企业的合规审计需求。
目前唯一缺席的主流语言是 Java。“如果你确实非用 Java 不可,那么 Jac 并不适合你,”他表示。
Agent 省心,皆大欢喜
正如 Jac 的设计旨在对抗生态系统的碎片化,它还试图通过将数据结构定义为图(Graph)来统一架构层面的割裂。
与其费力创建并填充数据库表,或是从类中实例化对象,数据的属性在 Jac 中直接通过 node 关键字定义。不同节点之间的关联则由 edge 连接来定义。本地程序逻辑仍可使用对象,但核心数据将是一张图,可驻留在本地内存、存储磁盘或云端服务器中。
没错,就是图计算。他指出,把所有数据构建成图结构,确实比建几张数据库表加外键关联需要更多前期工作,但图结构能在后续环节为 Agent 节省大量工作。Agent 不再需要为了从数据库、对象二进制块、JSON 字符串或 Python 对象中提取数据而不断消耗 token。
Agent 无需四处拉取数据再搬运到别处处理,而是可以直接派出一个“漫游者(walker)”去遍历数据结构并沿途就地处理。多个 walker 可以沿着图的不同路径同时推进,带来天然的并行性以实现更快执行。
理顺抽象层
在 All Things Open 的演讲中,Mars 对 Jac 与 LangGraph 进行了一场正面对决评测(后者是一款利用 Python 库构建智能体的 Agent 编排框架)。
他让同一个 AI Agent 分别基于这两个平台构建 AI 代码审查工具 Greptile 的复刻版本。在 Jac 平台上,Agent 自主构建了一个复杂的多阶段应用,能够并行调用多个工具。
而在使用 LangGraph 时,该 Agent 仅生成了一个粗糙的线性状态机,完全无法并行工作。Mars 总结认为,这很可能是因为它不得不调用的繁多工具拖累了其发挥。
Mars 从这场测试中得出的核心结论是:我们提供给 AI 的工具,直接决定了其产出的质量。
截至目前,该语言及其运行时已被应用于多家小型商业 AI 相关服务,例如 GraphClaw 多 Agent AI 平台、Skooch 调度器,以及 Tobu 的个人记忆平台。
开发者和 Agent 未来是否真会倒向 Jac 所倡导的统一语言愿景仍有待观察,但它无疑已经给其他基于 Python 的 Agent 框架带来了实质性的挑战。®
English / 原文
Most programming languages were written for human programmers, but that's about to change. University of Michigan professor Jason Mars has developed an academically ambitious language called Jac, and a runtime called Jaseci, that treats AI and AI agents as first-class entities.
Mars demonstrated the language and runtime in a talk at the All Things Open conference, held in Raleigh, North Carolina, this week.
The tools we use to create software – everything from programming languages to build toolchains – were made for human consumption. They were created before generative AI and are ill-fitted to understand agentic needs.
Currently, agents are drowning in polyglot complexity, he argued. "We're not using these tools anymore. We're using the agents, and the agents are using those tools. So I don't want new tools, but I want tools [for] my agents," he told the audience.
One big hungry language
In his talk, Mars cited Jarred Sumner, creator of the Bun framework, who spent $165,000 in Anthropic tokens to convert Bun’s Zig code into Rust earlier this year using a pre-release version of Mythos. Mars argued the heavy expense wasn't so much because the job itself was complicated; it was because everything had to be translated between two human-centered programming languages.
“Mythos is supposed to hack into our nuclear reactors and take over the planet like Skynet, but it can't translate Bun to Rust unless you spend $165,000,” he noted.
In Mars’s theory, Jac is a new type of programming language designed to “gobble up” other languages. Specifically, it's a Python-like language that integrates both the TypeScript and Python runtimes and toolchains. It compiles to Python bytecode, JavaScript, and native machine code. It can make full use of any libraries both in the PyPI and npm ecosystems.
And there’s more! Jac has also incorporated the LLVM compiler to implement Rust-style borrow checking and ownership semantics, allowing Jac code to directly benefit from these memory safety rules and performance gains. It can also import C and C++ libraries, thanks to the very same LLVM integration.
Mars also described an “eject function,” which can reverse-compile the user’s Jac code into TypeScript, Python, or C to meet corporate compliance.
One currently missing language is Java. “If you really need Java, Jac isn’t for Java,” he said.
Happy bot, happy lot
Just as Jac’s design sets out to battle ecosystem fragmentation, it also attempts to unify architectural fragmentation by defining data structures as graphs.
Instead of building and populating a database table, or creating objects from a class, the data’s attributes are defined under node keywords. The relationships among different nodes are defined by edge connections. Local program logic can still use objects, but the core data will be a graph, which can reside in local memory, a storage disk, or cloud server.
So, yeah, graph computing. Creating a graph from all your data is more work than just creating database tables and some foreign keys to tie ‘em together, but graphing saves agents a lot of work down the line, he posited. No longer will the agent have to burn tokens extracting data from databases, object blobs, JSON strings, or Python objects.
Instead of the agent fetching data hither and processing it over yonder, the agent can dispatch a “walker” to traverse the data structure and process it on the go. Multiple walkers can go down different paths of the graph, resulting in natural parallelism for faster execution.
Tidy the abstraction
For his All Things Open talk, Mars conducted a bake-off between Jac and LangGraph, an agent orchestration framework that uses Python libraries to build agents.
He asked an AI agent to use each platform to build a replica of Greptile, an AI code review tool. With Jac, the agent autonomously built a sophisticated multi-stage app that could call multiple tools in parallel.
Using LangGraph, the agent produced a crude linear state machine that could not work in parallel. It was probably weighed down by all of the tools it had to use, Mars concluded.
Mars’s takeaway from this exercise: The tools we provide the AI determine the quality of the output.
Thus far, the language and runtime have been used in a number of smaller commercial AI-related services, such as the GraphClaw multi-agent AI platform, the Skooch scheduler, and Tobu’s personal memory platform.
Whether developers and agents gravitate towards Jac’s promise as a unified language remains to be seen, but it certainly is giving other Python agent frameworks a run for their money. ®