字号·· | 护眼
theregister

密歇根大学教授为AI智能体打造类Python语言JacMichigan prof creates Python-like Jac language for AI agents

点「原文对照」整页切到原文,或双击某段只看那段的原文。

大多数编程语言都是为人类程序员编写的,但这种情况即将改变。密歇根大学教授杰森·马斯(Jason Mars)开发了一种学术野心勃勃的语言 Jac,以及一个名为 Jaseci 的运行时,它们将 AI 和 AI 智能体视为一等实体。马斯本周在北卡罗来纳州罗利举行的 All Things Open 大会演讲中演示了该语言和运行时。我们用于创建软件的工具——从编程语言到构建工具链——都是为人类使用而设计的。

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.

它们诞生于生成式 AI 之前,不适合理解智能体的需求。马斯辩称,目前智能体正淹没在多语言的复杂性中。“我们不再使用这些工具了。我们在使用智能体,而智能体在使用那些工具。所以我不想要新工具,我想要给我的智能体用的工具,”他对听众说。一种贪婪的大语言在演讲中,马斯引用了 Bun 框架创建者贾里德·萨姆纳(Jarred Sumner)的例子,今年早些时候,萨姆纳使用 Mythos 的预发布版本,花费 16.5 万美元的 Anthropic tokens 将 Bun 的 Zig 代码转换为 Rust。

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.

马斯辩称,这笔巨额开支并非因为工作本身复杂;而是因为所有内容都必须在两种以人类为中心的编程语言之间进行翻译。“Mythos 本该黑进我们的核反应堆、像天网一样接管地球,但除非你花 16.5 万美元,否则它无法将 Bun 翻译成 Rust,”他指出。

Mard 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.

在马斯的理论中,Jac 是一种新型编程语言,旨在“吞噬”其他语言。具体来说,它是一种类 Python 语言,集成了 TypeScript 和 Python 的运行时及工具链。它可编译为 Python 字节码、JavaScript 和原生机器代码。它能充分利用 PyPI 和 npm 生态系统中的任何库。还有更多!

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还集成了LLVM编译器,以实现Rust风格的借用检查和所有权语义,使Jac代码能够直接受益于这些内存安全规则和性能提升。得益于同样的LLVM集成,它还可以导入C和C++库。Mars还介绍了一种“弹出函数”,可以将用户的Jac代码反向编译为TypeScript、Python或C,以满足企业合规要求。目前尚缺的一种语言是Java。

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.

“如果你真的需要Java,那Jac不适合Java,”他说。快乐的机器人,快乐的一群正如Jac的设计旨在对抗生态系统碎片化,它也试图通过将数据结构定义为图来统一架构碎片化。无需构建和填充数据库表,或从类创建对象,数据的属性在节点关键字下定义。不同节点之间的关系由边连接定义。本地程序逻辑仍然可以使用对象,但核心数据将是一个图,可以驻留在本地内存、存储磁盘或云服务器中。

“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.

所以,没错,就是图计算。从所有数据创建图比仅创建数据库表和一些外键将它们关联起来工作量更大,但他认为,图化在后续能为智能体节省大量工作。智能体不再需要消耗token从数据库、对象块、JSON字符串或Python对象中提取数据。智能体无需在此处获取数据再到彼处处理,而是可以派遣一个“walker”遍历数据结构并就地处理。

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.

多个walker可以沿图的不同路径行进,从而实现自然的并行性以加快执行速度。整理抽象层次在他的All Things Open演讲中,Mars在Jac和LangGraph之间进行了一场对决,LangGraph是一个使用Python库构建智能体的智能体编排框架。他让一个AI智能体使用每个平台构建Greptile的复制品,Greptile是一个AI代码审查工具。

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.

使用 Jac,智能体自主构建了一个复杂的多阶段应用,能够并行调用多个工具。而使用 LangGraph,智能体生成了一个粗糙的线性状态机,无法并行工作。Mars 总结认为,这大概是因为它必须使用的工具太多而拖了后腿。Mars 从这次实验中得出的结论是:我们提供给 AI 的工具决定了输出的质量。迄今为止,该语言和运行时已被用于多个较小的商业 AI 相关服务,例如 GraphClaw 多智能体 AI 平台、Skooch 调度器以及 Tobu 的个人记忆平台。

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.

开发者和智能体是否会青睐 Jac 作为统一语言的承诺,仍有待观察,但它无疑正给其他 Python 智能体框架带来不小的竞争压力。®

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. ®

阅读媒体原文 ↗