Configs2026年5月19日·1 分钟阅读

Unison — A Content-Addressed Programming Language

Unison is a statically typed functional programming language where code is stored as a content-addressed hash tree, eliminating dependency conflicts, enabling seamless distributed computing, and making refactoring trivial.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Unison Language
通用 CLI 安装命令
npx tokrepo install f24282ac-5339-11f1-9bc6-00163e2b0d79

Introduction

Unison is a functional programming language that takes a fundamentally different approach to code management. Instead of storing code as text files, Unison identifies every definition by the hash of its syntax tree. This means renaming a function does not break dependents, dependency conflicts cannot exist, and code can be trivially shared or executed across distributed nodes.

What Unison Does

  • Stores code in a content-addressed codebase where definitions are identified by hash, not name
  • Eliminates dependency hell because two versions of the same library can coexist without conflict
  • Provides built-in support for distributed computing via its Abilities system (algebraic effects)
  • Includes the Unison Codebase Manager (UCM) for browsing, editing, and sharing code
  • Supports structural typing and pattern matching with a Haskell-inspired syntax

Architecture Overview

The Unison Codebase Manager (UCM) is the central development tool. When you write Unison code in a scratch file, UCM watches for changes, typechecks the definitions, and stores them in a local SQLite-backed codebase keyed by content hash. Names are metadata attached to hashes, not identifiers. The runtime compiles Unison to an intermediate representation that runs on a custom virtual machine. The Abilities system (similar to algebraic effects) allows pure expression of side effects that can be interpreted differently in tests vs. production.

Self-Hosting & Configuration

  • Download the UCM binary from the official releases for Linux, macOS, or Windows
  • The codebase is stored locally in ~/.unison by default
  • Pull libraries from Unison Share (share.unison-lang.org), the community package hub
  • Use ucm commands to create namespaces, push/pull code, and run tests
  • Scratch files (.u extension) are watched by UCM and typechecked on save

Key Features

  • Content-addressed storage makes all refactors (renames, moves) perfectly safe
  • Abilities system provides typed, composable effect handling without monads
  • Built-in test framework with test> watch expressions that run on save
  • Distributed computing primitives let you describe computations that span multiple nodes
  • Unison Share enables publishing and discovering libraries with no version conflicts

Comparison with Similar Tools

  • Haskell — similar syntax and type system, but Haskell uses traditional file-based modules; Unison's hash-based storage eliminates breakage from renames
  • Erlang/Elixir — strong in distribution; Unison adds content-addressing and a typed effect system
  • Scala — JVM functional language; Unison has a lighter runtime and novel codebase model
  • Darcs — a VCS with patch theory; Unison applies similar ideas at the code-definition level rather than file level

FAQ

Q: Where is the source code stored if not in files? A: Definitions live in a content-addressed SQLite codebase. You write in scratch .u files, but UCM parses them and stores the hashed AST. Names are just metadata pointers to hashes.

Q: Can I use Unison for production applications? A: Unison is maturing but still evolving. It is best suited for exploratory projects, distributed computing experiments, and developers interested in next-generation language design.

Q: How do I share Unison code with others? A: Push your namespace to Unison Share with push in UCM. Others pull it into their codebase. Since code is content-addressed, there are no version conflicts.

Q: Does Unison have an IDE? A: UCM is the primary interface. Editor plugins for VS Code provide syntax highlighting. The language server protocol (LSP) support is in development.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产