跳到正文
原文
Simon Willison 博客· Simon Willison 博客·· 2026-05-04精选AI 评分75

Redis 数组类型交互式体验平台上线

AI 导读

Redis创始人Salvatore Sanfilippo提交了为Redis新增数组数据类型的PR,引入了包括ARCOUNT、ARDEL、ARGREP等在内的18个新命令。其中最引人注目的是ARGREP命令,它利用新集成的TRE正则表达式库,可直接在服务器端对数组值进行正则搜索。目前该功能已在一个分支中实现,开发者Simon Willison借助Claude Code构建了一个交互式在线沙盒,通过运行在浏览器中的WASM版Redis子集,供用户体验这些新命令。Salvatore还撰文详细介绍了在AI辅助下开发此功能的历程。

推荐理由

Redis 加数组类型可能改变很多缓存设计,Simon 这个 WASM playground 是把 PR 变成可试产品的最快路径,后端同学可以直接上手体会 ARGREP 的快乐。

正文

Salvatore Sanfilippo submitted a PR adding a new data type - arrays - to Redis.

The new commands are ARCOUNT, ARDEL, ARDELRANGE, ARGET, ARGETRANGE, ARGREP, ARINFO, ARINSERT, ARLASTITEMS, ARLEN, ARMGET, ARMSET, ARNEXT, AROP, ARRING, ARSCAN, ARSEEK, ARSET.

The implementation is currently available in a branch, so I had Claude Code for web build this interactive playground for trying out the new commands in a WASM-compiled build of a subset of Redis running in the browser.

Screenshot of a Redis command builder UI. Left sidebar shows commands ARSCAN, ARSEEK, ARSET. Main panel has a "predicate oneof" section with a MATCH dropdown and value CHERRY, plus a "+ add another" button. Below is "options (optional) oneof" with checkboxes: AND (checked), OR (unchecked), LIMIT (checked, value 10), WITHVALUES (checked), NOCASE (checked). COMMAND section shows: ARGREP myarr - + MATCH CHERRY AND LIMIT 10 WITHVALUES NOCASE. A red "Run command" button is below. REPLY section shows "(no reply yet)".

The most interesting new command is ARGREP which can run a server-side grep against a range of values in the array using the newly vendored TRE regex library.

Salvatore wrote more about the AI-assisted development process for the array type in Redis array type: short story of a long development.

来源:Simon Willison 博客 · simonwillison.net