[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-HigherOrderCO--Bend":3,"tool-HigherOrderCO--Bend":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":79,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":96,"env_os":97,"env_gpu":98,"env_ram":99,"env_deps":100,"category_tags":106,"github_topics":78,"view_count":107,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":108,"updated_at":109,"faqs":110,"releases":139},551,"HigherOrderCO\u002FBend","Bend","A massively parallel, high-level programming language","Bend 是一款开源的高级编程语言，旨在让并行计算变得像编写 Python 或 Haskell 一样简单。它解决了传统并行编程中复杂的线程管理和同步问题，开发者无需手动配置线程、锁或原子操作，即可在 GPU 等大规模并行硬件上运行代码。\n\nBend 的核心优势在于其强大的扩展性。借助 HVM2 运行时，它能自动调度超过一万并发线程，在 NVIDIA GPU 上实现近乎线性的性能加速。这意味着处理海量数据或复杂计算时，只需增加核心数量，速度就会显著提升。\n\n这款软件非常适合追求高性能的计算型开发者及科研人员，尤其是那些希望简化并行逻辑但不愿妥协效率的人群。目前 Bend 主要支持 Linux 和 macOS 环境下的 NVIDIA 显卡。虽然单核性能仍在优化中，但其多核扩展潜力巨大。如果你渴望探索下一代高效编程范式，Bend 提供了一个极具吸引力的入口。","\u003Ch1 >Bend\u003C\u002Fh1>\n\u003Cp>A high-level, massively parallel programming language\u003C\u002Fp>\n\n## Index\n1. [Introduction](#introduction)\n2. [Important Notes](#important-notes)\n3. [Install](#install)\n4. [Getting Started](#getting-started)\n5. [Speedup Example](#speedup-examples)\n6. [Additional Resources](#additional-resources)\n\n## Introduction\n\nBend offers the feel and features of expressive languages like Python and Haskell. This includes fast object allocations, full support for higher-order functions with closures, unrestricted recursion, and even continuations.                             \nBend scales like CUDA, it runs on massively parallel hardware like GPUs, with nearly linear acceleration based on core count, and without explicit parallelism annotations: no thread creation, locks, mutexes, or atomics.                     \nBend is powered by the [HVM2](https:\u002F\u002Fgithub.com\u002Fhigherorderco\u002Fhvm) runtime.\n\n\n## Important Notes\n\n* Bend is designed to excel in scaling performance with cores, supporting over 10000 concurrent threads.\n* The current version may have lower single-core performance.\n* You can expect substantial improvements in performance as we advance our code generation and optimization techniques.\n* We are still working to support Windows. Use [WSL2](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall) as an alternative solution.\n* [We only support NVIDIA Gpus currently](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F341).\n\n\n\n\n## Install\n\n### Install dependencies\n\n#### On Linux\n```sh\n# Install Rust if you haven't already.\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# For the C version of Bend, use GCC. We recommend a version up to 12.x.\nsudo apt install gcc\n```\nFor the CUDA runtime [install the CUDA toolkit for Linux](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads?target_os=Linux) version 12.x.\n\n\n#### On Mac\n```sh\n# Install Rust if you haven't it already.\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# For the C version of Bend, use GCC. We recommend a version up to 12.x.\nbrew install gcc\n```\n\n\n### Install Bend\n\n1. Install HVM2 by running:\n```sh\n# HVM2 is HOC's massively parallel Interaction Combinator evaluator.\ncargo install hvm\n\n# This ensures HVM is correctly installed and accessible.\nhvm --version\n```\n2. Install Bend by running:\n```sh\n# This command will install Bend\ncargo install bend-lang\n\n# This ensures Bend is correctly installed and accessible.\nbend --version\n```\n\n### Getting Started\n#### Running Bend Programs\n```sh\nbend run    \u003Cfile.bend> # uses the C interpreter by default (parallel)\nbend run-rs \u003Cfile.bend> # uses the Rust interpreter (sequential)\nbend run-c  \u003Cfile.bend> # uses the C interpreter (parallel)\nbend run-cu \u003Cfile.bend> # uses the CUDA interpreter (massively parallel)\n\n# Notes\n# You can also compile Bend to standalone C\u002FCUDA files using gen-c and gen-cu for maximum performance.\n# The code generator is still in its early stages and not as mature as compilers like GCC and GHC.\n# You can use the -s flag to have more information on\n  # Reductions\n  # Time the code took to run\n  # Interaction per second (In millions)\n```\n\n#### Testing Bend Programs\nThe example below sums all the numbers in the range from `start` to `target`. It can be written in two different methods: one that is inherently sequential (and thus cannot be parallelized), and another that is easily parallelizable. (We will be using the `-s`flag in most examples, for the sake of visibility)\n\n#### Sequential version:\nFirst, create a file named `sequential_sum.bend`\n```sh\n# Write this command on your terminal\ntouch sequential_sum.bend\n```\nThen with your text editor, open the file `sequential_sum.bend`, copy the code below and paste in the file.\n\n```py\n# Defines the function Sum with two parameters: start and target\ndef Sum(start, target):\n  if start == target:\n    # If the value of start is the same as target, returns start.\n    return start\n  else:\n    # If start is not equal to target, recursively call Sum with\n    # start incremented by 1, and add the result to start.\n    return start + Sum(start + 1, target)  \n\ndef main():\n  # This translates to (1 + (2 + (3 + (...... + (999999 + 1000000)))))\n  # Note that this will overflow the maximum value of a number in Bend\n  return Sum(1, 1_000_000)\n```\n\n##### Running the file\nYou can run it using Rust interpreter (Sequential)\n```sh\nbend run-rs sequential_sum.bend -s\n```\n\nOr you can run it using C interpreter (Sequential)\n```sh\nbend run-c sequential_sum.bend -s\n```\n\nIf you have a NVIDIA GPU, you can also run in CUDA (Sequential)\n```sh\nbend run-cu sequential_sum.bend -s\n```\n\nIn this version, the next value to be calculated depends on the previous sum, meaning that it cannot proceed until the current computation is complete. Now, let's look at the easily parallelizable version.\n\n\n#### Parallelizable version:\nFirst close the old file and then proceed to your terminal to create `parallel_sum.bend`\n```sh\n# Write this command on your terminal\ntouch parallel_sum.bend\n```\nThen with your text editor, open the file `parallel_sum.bend`, copy the code below and paste in the file.\n\n```py\n# Defines the function Sum with two parameters: start and target\ndef Sum(start, target):\n  if start == target:\n    # If the value of start is the same as target, returns start.\n    return start\n  else:\n    # If start is not equal to target, calculate the midpoint (half),\n    # then recursively call Sum on both halves.\n    half = (start + target) \u002F 2\n    left = Sum(start, half)  # (Start -> Half)\n    right = Sum(half + 1, target)\n    return left + right\n\n# A parallelizable sum of numbers from 1 to 1000000\ndef main():\n  # This translates to (((1 + 2) + (3 + 4)) + ... (999999 + 1000000)...)\n  return Sum(1, 1_000_000)\n```\n\nIn this example, the (3 + 4) sum does not depend on the (1 + 2), meaning that it can run in parallel because both computations can happen at the same time. \n\n##### Running the file\nYou can run it using Rust interpreter (Sequential)\n```sh\nbend run-rs parallel_sum.bend -s\n```\n\nOr you can run it using C interpreter (Parallel)\n```sh\nbend run-c parallel_sum.bend -s\n```\n\nIf you have a NVIDIA GPU, you can also run in CUDA (Massively parallel)\n```sh\nbend run-cu parallel_sum.bend -s\n```\n\nIn Bend, it can be parallelized by just changing the run command. If your code **can** run in parallel it **will** run in parallel.\n\n\n### Speedup Examples\nThe code snippet below implements a [bitonic sorter](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBitonic_sorter) with *immutable tree rotations*. It's not the type of algorithm you would expect to run fast on GPUs. However, since it uses a divide and conquer approach, which is inherently parallel, Bend will execute it on multiple threads, no thread creation, no explicit lock management.\n\n#### Bitonic Sorter Benchmark\n\n- `bend run-rs`: CPU, Apple M3 Max: 12.15 seconds\n- `bend run-c`: CPU, Apple M3 Max: 0.96 seconds\n- `bend run-cu`: GPU, NVIDIA RTX 4090: 0.21 seconds\n\n \u003Cdetails>\n  \u003Csummary>\u003Cb>Click here for the Bitonic Sorter code\u003C\u002Fb>\u003C\u002Fsummary>\n   \n\n```py\n# Sorting Network = just rotate trees!\ndef sort(d, s, tree):\n  switch d:\n    case 0:\n      return tree\n    case _:\n      (x,y) = tree\n      lft   = sort(d-1, 0, x)\n      rgt   = sort(d-1, 1, y)\n      return rots(d, s, (lft, rgt))\n\n# Rotates sub-trees (Blue\u002FGreen Box)\ndef rots(d, s, tree):\n  switch d:\n    case 0:\n      return tree\n    case _:\n      (x,y) = tree\n      return down(d, s, warp(d-1, s, x, y))\n\n# Swaps distant values (Red Box)\ndef warp(d, s, a, b):\n  switch d:\n    case 0:\n      return swap(s ^ (a > b), a, b)\n    case _:\n      (a.a, a.b) = a\n      (b.a, b.b) = b\n      (A.a, A.b) = warp(d-1, s, a.a, b.a)\n      (B.a, B.b) = warp(d-1, s, a.b, b.b)\n      return ((A.a,B.a),(A.b,B.b))\n\n# Propagates downwards\ndef down(d,s,t):\n  switch d:\n    case 0:\n      return t\n    case _:\n      (t.a, t.b) = t\n      return (rots(d-1, s, t.a), rots(d-1, s, t.b))\n\n# Swaps a single pair\ndef swap(s, a, b):\n  switch s:\n    case 0:\n      return (a,b)\n    case _:\n      return (b,a)\n\n# Testing\n# -------\n\n# Generates a big tree\ndef gen(d, x):\n  switch d:\n    case 0:\n      return x\n    case _:\n      return (gen(d-1, x * 2 + 1), gen(d-1, x * 2))\n\n# Sums a big tree\ndef sum(d, t):\n  switch d:\n    case 0:\n      return t\n    case _:\n      (t.a, t.b) = t\n      return sum(d-1, t.a) + sum(d-1, t.b)\n\n# Sorts a big tree\ndef main:\n  return sum(20, sort(20, 0, gen(20, 0)))\n\n```\n\n\u003C\u002Fdetails>\n  \nif you are interested in some other algorithms, you can check our [examples folder](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Ftree\u002Fmain\u002Fexamples)\n\n\n### Additional Resources\n - To understand the technology behind Bend, check out the HVM2 [paper](https:\u002F\u002Fpaper.higherorderco.com\u002F).\n - We are working on an official documentation, meanwhile for a more in depth\n     explanation check [GUIDE.md](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fblob\u002Fmain\u002FGUIDE.md)\n - Read about our features at [FEATURES.md](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fblob\u002Fmain\u002FFEATURES.md)\n - Bend is developed by [HigherOrderCO](https:\u002F\u002Fhigherorderco.com\u002F) - join our [Discord](https:\u002F\u002Fdiscord.higherorderco.com)!\n","\u003Ch1 >Bend\u003C\u002Fh1>\n\u003Cp>一种高级、大规模并行编程语言\u003C\u002Fp>\n\n## 目录\n1. [简介](#introduction)\n2. [重要说明](#important-notes)\n3. [安装](#install)\n4. [入门指南](#getting-started)\n5. [加速示例](#speedup-examples)\n6. [其他资源](#additional-resources)\n\n## 简介\n\nBend 提供了类似 Python 和 Haskell 等表达性语言的感觉和功能。这包括快速的对象分配、对带有闭包的高阶函数的完全支持、无限制的递归，甚至延续 (continuations)。                             \nBend 像 CUDA 一样扩展，它运行在 GPU 等大规模并行硬件上，基于核心数量实现近乎线性的加速，且无需显式的并行标注：无需线程创建、锁、互斥锁或原子操作。                     \nBend 由 [HVM2](https:\u002F\u002Fgithub.com\u002Fhigherorderco\u002Fhvm) 运行时驱动。\n\n\n## 重要说明\n\n* Bend 旨在在核心扩展性能方面表现出色，支持超过 10000 个并发线程。\n* 当前版本单核性能可能较低。\n* 随着我们推进代码生成和优化技术，您可以期待性能有显著提升。\n* 我们仍在努力支持 Windows。请使用 [WSL2](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall) 作为替代方案。\n* [我们目前仅支持 NVIDIA 显卡](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F341)。\n\n\n\n\n## 安装\n\n### 安装依赖项\n\n#### 在 Linux 上\n```sh\n# Install Rust if you haven't already.\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# For the C version of Bend, use GCC. We recommend a version up to 12.x.\nsudo apt install gcc\n```\n对于 CUDA 运行时，[请为 Linux 安装 CUDA toolkit](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads?target_os=Linux) 12.x 版本。\n\n\n#### 在 Mac 上\n```sh\n# Install Rust if you haven't it already.\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# For the C version of Bend, use GCC. We recommend a version up to 12.x.\nbrew install gcc\n```\n\n\n### 安装 Bend\n\n1. 通过运行以下命令安装 HVM2：\n```sh\n# HVM2 is HOC's massively parallel Interaction Combinator evaluator.\ncargo install hvm\n\n# This ensures HVM is correctly installed and accessible.\nhvm --version\n```\n2. 通过运行以下命令安装 Bend：\n```sh\n# This command will install Bend\ncargo install bend-lang\n\n# This ensures Bend is correctly installed and accessible.\nbend --version\n```\n\n### 入门指南\n#### 运行 Bend 程序\n```sh\nbend run    \u003Cfile.bend> # uses the C interpreter by default (parallel)\nbend run-rs \u003Cfile.bend> # uses the Rust interpreter (sequential)\nbend run-c  \u003Cfile.bend> # uses the C interpreter (parallel)\nbend run-cu \u003Cfile.bend> # uses the CUDA interpreter (massively parallel)\n\n# Notes\n# You can also compile Bend to standalone C\u002FCUDA files using gen-c and gen-cu for maximum performance.\n# The code generator is still in its early stages and not as mature as compilers like GCC and GHC.\n# You can use the -s flag to have more information on\n  # Reductions\n  # Time the code took to run\n  # Interaction per second (In millions)\n```\n\n#### 测试 Bend 程序\n下面的示例计算从 `start` 到 `target` 范围内所有数字的和。它可以写成两种不同的方法：一种是本质上顺序执行的（因此无法并行化），另一种是易于并行化的。（为了可见性，我们将在大多数示例中使用 `-s` 标志）\n\n#### 顺序版本：\n首先，创建一个名为 `sequential_sum.bend` 的文件\n```sh\n# Write this command on your terminal\ntouch sequential_sum.bend\n```\n然后使用文本编辑器打开文件 `sequential_sum.bend`，复制以下代码并粘贴到文件中。\n\n```py\n# Defines the function Sum with two parameters: start and target\ndef Sum(start, target):\n  if start == target:\n    # If the value of start is the same as target, returns start.\n    return start\n  else:\n    # If start is not equal to target, recursively call Sum with\n    # start incremented by 1, and add the result to start.\n    return start + Sum(start + 1, target)  \n\ndef main():\n  # This translates to (1 + (2 + (3 + (...... + (999999 + 1000000)))))\n  # Note that this will overflow the maximum value of a number in Bend\n  return Sum(1, 1_000_000)\n```\n\n##### 运行文件\n您可以使用 Rust 解释器（顺序执行）运行它\n```sh\nbend run-rs sequential_sum.bend -s\n```\n\n或者您可以使用 C 解释器（顺序执行）运行它\n```sh\nbend run-c sequential_sum.bend -s\n```\n\n如果您有 NVIDIA GPU，也可以使用 CUDA 运行（顺序执行）\n```sh\nbend run-cu sequential_sum.bend -s\n```\n\n在此版本中，下一个要计算的值取决于之前的总和，这意味着在当前计算完成之前无法继续。现在，让我们看看易于并行化的版本。\n\n\n#### 可并行化版本：\n首先关闭旧文件，然后进入终端创建 `parallel_sum.bend`\n```sh\n# Write this command on your terminal\ntouch parallel_sum.bend\n```\n然后使用文本编辑器打开文件 `parallel_sum.bend`，复制以下代码并粘贴到文件中。\n\n```py\n# Defines the function Sum with two parameters: start and target\ndef Sum(start, target):\n  if start == target:\n    # If the value of start is the same as target, returns start.\n    return start\n  else:\n    # If start is not equal to target, calculate the midpoint (half),\n    # then recursively call Sum on both halves.\n    half = (start + target) \u002F 2\n    left = Sum(start, half)  # (Start -> Half)\n    right = Sum(half + 1, target)\n    return left + right\n\n# A parallelizable sum of numbers from 1 to 1000000\ndef main():\n  # This translates to (((1 + 2) + (3 + 4)) + ... (999999 + 1000000)...)\n  return Sum(1, 1_000_000)\n```\n\n在此示例中，(3 + 4) 的求和不依赖于 (1 + 2)，意味着它可以并行运行，因为两个计算可以同时发生。 \n\n##### 运行文件\n您可以使用 Rust 解释器（顺序执行）运行它\n```sh\nbend run-rs parallel_sum.bend -s\n```\n\n或者您可以使用 C 解释器（并行）运行它\n```sh\nbend run-c parallel_sum.bend -s\n```\n\n如果您有 NVIDIA GPU，也可以使用 CUDA 运行（大规模并行）\n```sh\nbend run-cu parallel_sum.bend -s\n```\n\n在 Bend 中，只需更改运行命令即可进行并行化。如果您的代码**可以**并行运行，它就**会**并行运行。\n\n### 加速示例\n下面的代码片段实现了一个带有*不可变树旋转 (immutable tree rotations)* 的 [比特尼克排序器 (bitonic sorter)](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBitonic_sorter)。这通常不是你会预期能在 GPU 上快速运行的算法类型。然而，由于它采用了本质上具有并行性的分治法 (divide and conquer)，Bend 将在多个线程上执行它，无需创建线程，也无需显式的锁管理 (lock management)。\n\n#### 比特尼克排序器基准测试\n\n- `bend run-rs`: CPU, Apple M3 Max: 12.15 秒\n- `bend run-c`: CPU, Apple M3 Max: 0.96 秒\n- `bend run-cu`: GPU, NVIDIA RTX 4090: 0.21 秒\n\n\u003Cdetails>\n  \u003Csummary>\u003Cb>点击此处查看比特尼克排序器代码\u003C\u002Fb>\u003C\u002Fsummary>\n   \n\n```py\n# Sorting Network = just rotate trees!\ndef sort(d, s, tree):\n  switch d:\n    case 0:\n      return tree\n    case _:\n      (x,y) = tree\n      lft   = sort(d-1, 0, x)\n      rgt   = sort(d-1, 1, y)\n      return rots(d, s, (lft, rgt))\n\n# Rotates sub-trees (Blue\u002FGreen Box)\ndef rots(d, s, tree):\n  switch d:\n    case 0:\n      return tree\n    case _:\n      (x,y) = tree\n      return down(d, s, warp(d-1, s, x, y))\n\n# Swaps distant values (Red Box)\ndef warp(d, s, a, b):\n  switch d:\n    case 0:\n      return swap(s ^ (a > b), a, b)\n    case _:\n      (a.a, a.b) = a\n      (b.a, b.b) = b\n      (A.a, A.b) = warp(d-1, s, a.a, b.a)\n      (B.a, B.b) = warp(d-1, s, a.b, b.b)\n      return ((A.a,B.a),(A.b,B.b))\n\n# Propagates downwards\ndef down(d,s,t):\n  switch d:\n    case 0:\n      return t\n    case _:\n      (t.a, t.b) = t\n      return (rots(d-1, s, t.a), rots(d-1, s, t.b))\n\n# Swaps a single pair\ndef swap(s, a, b):\n  switch s:\n    case 0:\n      return (a,b)\n    case _:\n      return (b,a)\n\n# Testing\n# -------\n\n# Generates a big tree\ndef gen(d, x):\n  switch d:\n    case 0:\n      return x\n    case _:\n      return (gen(d-1, x * 2 + 1), gen(d-1, x * 2))\n\n# Sums a big tree\ndef sum(d, t):\n  switch d:\n    case 0:\n      return t\n    case _:\n      (t.a, t.b) = t\n      return sum(d-1, t.a) + sum(d-1, t.b)\n\n# Sorts a big tree\ndef main:\n  return sum(20, sort(20, 0, gen(20, 0)))\n\n```\n\n\u003C\u002Fdetails>\n  \n如果你对某些其他算法感兴趣，可以查看我们的 [示例文件夹](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Ftree\u002Fmain\u002Fexamples)\n\n\n### 其他资源\n - 要了解 Bend 背后的技术，请查阅 HVM2 [论文](https:\u002F\u002Fpaper.higherorderco.com\u002F)。\n - 我们正在编写官方文档，在此期间，若要了解更深入的说明，请查看 [GUIDE.md](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fblob\u002Fmain\u002FGUIDE.md)\n - 在 [FEATURES.md](https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fblob\u002Fmain\u002FFEATURES.md) 阅读关于我们功能的信息。\n - Bend 由 [HigherOrderCO](https:\u002F\u002Fhigherorderco.com\u002F) 开发 —— 加入我们的 [Discord](https:\u002F\u002Fdiscord.higherorderco.com)!","# Bend 快速上手指南\n\nBend 是一种高级、大规模并行的编程语言。它支持在 GPU 等大规模并行硬件上运行，无需显式编写多线程代码即可实现线性加速。\n\n## 环境准备\n\n- **操作系统**: 推荐 Linux 或 macOS。Windows 用户请使用 [WSL2](https:\u002F\u002Flearn.microsoft.com\u002Fen-us\u002Fwindows\u002Fwsl\u002Finstall)。\n- **硬件要求**: 支持 NVIDIA GPU（用于 CUDA 模式）。\n- **前置依赖**:\n  - **Rust**: 用于编译和运行。\n  - **GCC**: C 语言编译器（建议版本 12.x 以下）。\n  - **CUDA Toolkit**: 如需使用 GPU 加速，请安装 Linux 版 CUDA 12.x。\n\n## 安装步骤\n\n### 1. 安装基础依赖\n\n**Linux:**\n```sh\n# 安装 Rust\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# 安装 GCC\nsudo apt install gcc\n\n# 安装 CUDA Toolkit (仅需要 GPU 加速时)\n# 请参考官方下载页面：https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads?target_os=Linux\n```\n\n**macOS:**\n```sh\n# 安装 Rust\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n# 安装 GCC\nbrew install gcc\n```\n\n### 2. 安装 Bend 运行时与工具\n\n```sh\n# 安装 HVM2 运行时\ncargo install hvm\nhvm --version\n\n# 安装 Bend 语言\ncargo install bend-lang\nbend --version\n```\n\n## 基本使用\n\n### 运行程序\n\nBend 提供了多种解释器模式，可根据需求选择：\n\n- `bend run \u003Cfile.bend>`: 默认使用 C 解释器（并行）。\n- `bend run-rs \u003Cfile.bend>`: 使用 Rust 解释器（串行）。\n- `bend run-cu \u003Cfile.bend>`: 使用 CUDA 解释器（大规模并行，需 NVIDIA GPU）。\n\n添加 `-s` 参数可显示执行统计信息（如耗时、交互次数等）。\n\n### 示例：并行求和\n\n创建一个名为 `parallel_sum.bend` 的文件，内容如下：\n\n```py\n# 定义函数 Sum，计算从 start 到 target 的并行求和\ndef Sum(start, target):\n  if start == target:\n    return start\n  else:\n    half = (start + target) \u002F 2\n    left = Sum(start, half)\n    right = Sum(half + 1, target)\n    return left + right\n\ndef main():\n  return Sum(1, 1_000_000)\n```\n\n在终端中运行该文件（以 C 解释器为例）：\n\n```sh\nbend run-c parallel_sum.bend -s\n```\n\n若拥有 NVIDIA GPU，可使用 CUDA 模式获得更高性能：\n\n```sh\nbend run-cu parallel_sum.bend -s\n```\n\n> **注意**: 如果代码逻辑本身支持并行，只需更改运行命令，Bend 会自动利用多核或 GPU 进行加速。","某金融风控团队需要实时分析每日千万级交易流水，以毫秒级精度识别潜在欺诈模式。\n\n### 没有 Bend 时\n- 依赖 C++ 或 Java 编写多线程代码，需手动管理线程池、锁机制及内存同步。\n- 计算任务主要跑在 CPU 上，难以充分利用昂贵的 GPU 集群进行大规模并行加速。\n- 随着数据量增长，系统扩展困难，增加服务器节点无法带来线性性能提升。\n- 复杂的并发逻辑导致调试周期长，容易出现死锁或数据竞争等隐蔽 Bug。\n\n### 使用 Bend 后\n- 无需关心线程创建或互斥锁，Bend 自动将逻辑映射到 GPU 核心实现无缝并行。\n- 直接利用 NVIDIA GPU 的算力，处理相同规模数据时速度提升数十倍。\n- 代码结构保持高级语言风格，支持高阶函数与递归，开发效率显著提高。\n- 硬件资源扩容即可线性加速，轻松应对未来数据量的指数级增长需求。\n\nBend 通过屏蔽底层并发复杂性，让开发者能用极简代码释放 GPU 的极致算力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FHigherOrderCO_Bend_a9809ee7.png","HigherOrderCO","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FHigherOrderCO_8fbd9bb9.png","we are getting to the very core of what makes computers capable of reasoning.",null,"contact@higherorderco.com","HigherOrderComp","https:\u002F\u002Fhigherorderco.com","https:\u002F\u002Fgithub.com\u002FHigherOrderCO",[84,88],{"name":85,"color":86,"percentage":87},"Rust","#dea584",99.9,{"name":89,"color":90,"percentage":91},"Just","#384d54",0.1,19196,472,"2026-04-05T09:22:47","Apache-2.0",4,"Linux, macOS","需要 NVIDIA GPU，CUDA 12.x","未说明",{"notes":101,"python":99,"dependencies":102},"1. Windows 系统暂不支持原生运行，需使用 WSL2 作为替代方案。2. 目前仅支持 NVIDIA 显卡进行 CUDA 加速。3. 若使用 CUDA 解释器，必须安装 CUDA Toolkit 12.x 版本。4. 编译 C 版本解释器推荐使用 GCC 12.x 及以下版本。5. Bend 是独立的编程语言，运行无需 Python 环境。",[85,103,104,105],"GCC","CUDA Toolkit","HVM2",[13],37,"2026-03-27T02:49:30.150509","2026-04-06T05:17:58.221294",[111,116,120,125,129,134],{"id":112,"question_zh":113,"answer_zh":114,"source_url":115},2234,"如何在 WSL2 上为 HVM 安装 CUDA Toolkit？","需要下载特定版本的 CUDA 仓库并安装。假设使用 x86_64 wsl2 ubuntu，请执行以下步骤：\n1. 下载并移动 pin 文件：`wget https:\u002F\u002Fdeveloper.download.nvidia.com\u002Fcompute\u002Fcuda\u002Frepos\u002Fwsl-ubuntu\u002Fx86_64\u002Fcuda-wsl-ubuntu.pin` 和 `sudo mv cuda-wsl-ubuntu.pin \u002Fetc\u002Fapt\u002Fpreferences.d\u002Fcuda-repository-pin-600`\n2. 下载 deb 包并安装：`wget https:\u002F\u002Fdeveloper.download.nvidia.com\u002Fcompute\u002Fcuda\u002F12.4.1\u002Flocal_installers\u002Fcuda-repo-wsl-ubuntu-12-4-local_12.4.1-1_amd64.deb` 和 `sudo dpkg -i cuda-repo-wsl-ubuntu-12-4-local_12.4.1-1_amd64.deb`\n3. 复制密钥环：`sudo cp \u002Fvar\u002Fcuda-repo-wsl-ubuntu-12-4-local\u002Fcuda-*-keyring.gpg \u002Fusr\u002Fshare\u002Fkeyrings\u002F`\n4. 更新并安装：`sudo apt-get update` 和 `sudo apt-get -y install cuda-toolkit-12-4`","https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F384",{"id":117,"question_zh":118,"answer_zh":119,"source_url":115},2235,"安装 CUDA 后 `bend run-cu` 仍提示 \"CUDA not available\" 怎么办？","这通常是因为未将 CUDA 二进制文件路径添加到环境变量中。请手动添加 CUDA bin 目录到 PATH：`export PATH=\"\u002Fusr\u002Flocal\u002Fcuda-12.4\u002Fbin:$PATH\"`。添加后重新加载 shell，并建议重新安装 hvm (`cargo +nightly install hvm`) 以确保识别新环境。",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},2236,"为什么发布后 Bitonic Sort 示例的性能会显著下降？","性能下降完全源于 eta-reduction（η-归约）在 CUDA 运行时中的影响。测试显示，对 warp、down 和 flow 函数进行 eta-reduction 会导致性能从正常水平降至约 6500 MIPS。这与 CPU 上的表现相反，可能是二进制递归函数的调度问题导致的。","https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F634",{"id":126,"question_zh":127,"answer_zh":128,"source_url":124},2237,"如何解决 Bend 中的性能退化问题？","作为临时解决方案，可以暂时在 Bend 中禁用 eta-reduction。由于该功能易于关闭，维护者建议在获得更好的调度洞察之前先禁用它，以避免性能进一步下降。",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},2238,"Bend 目前的类型系统状态如何？","项目放弃了渐进式类型，转而采用简单的 100% 静态可选类型系统。未定义类型的值默认为 `Any` 类型，它们在运行时或编译时不会被检查，但可以按预期方式与其他类型一起使用。系统基于 Hindley-Milner 算法实现。","https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F615",{"id":135,"question_zh":136,"answer_zh":137,"source_url":138},2239,"安装 HVM 时出现 `linker 'cc' not found` 错误如何处理？","此错误表明系统缺少 C 编译器链接器。在 WSL\u002FUbuntu 环境下，通常需要安装构建工具链。请尝试运行 `sudo apt install build-essential` 来安装必要的编译器和链接器，然后再重新执行安装命令。","https:\u002F\u002Fgithub.com\u002FHigherOrderCO\u002FBend\u002Fissues\u002F355",[140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194,197],{"id":141,"version":142,"summary_zh":78,"released_at":78},101757,"0.2.38",{"id":144,"version":145,"summary_zh":78,"released_at":78},101758,"0.2.37",{"id":147,"version":148,"summary_zh":78,"released_at":78},101759,"0.2.37-alpha.1",{"id":150,"version":151,"summary_zh":78,"released_at":78},101760,"0.2.36",{"id":153,"version":154,"summary_zh":78,"released_at":78},101761,"0.2.34",{"id":156,"version":157,"summary_zh":78,"released_at":78},101762,"0.2.33",{"id":159,"version":160,"summary_zh":78,"released_at":78},101763,"0.2.32",{"id":162,"version":163,"summary_zh":78,"released_at":78},101764,"0.2.31",{"id":165,"version":166,"summary_zh":78,"released_at":78},101765,"0.2.30",{"id":168,"version":169,"summary_zh":78,"released_at":78},101766,"0.2.29",{"id":171,"version":172,"summary_zh":78,"released_at":78},101767,"0.2.28",{"id":174,"version":175,"summary_zh":78,"released_at":78},101768,"0.2.27",{"id":177,"version":178,"summary_zh":78,"released_at":78},101769,"0.2.26",{"id":180,"version":181,"summary_zh":78,"released_at":78},101770,"0.2.25",{"id":183,"version":184,"summary_zh":78,"released_at":78},101771,"0.2.24",{"id":186,"version":187,"summary_zh":78,"released_at":78},101772,"0.2.23",{"id":189,"version":190,"summary_zh":78,"released_at":78},101773,"0.2.22",{"id":192,"version":193,"summary_zh":78,"released_at":78},101774,"0.2.21",{"id":195,"version":196,"summary_zh":78,"released_at":78},101775,"0.2.20",{"id":198,"version":199,"summary_zh":78,"released_at":78},101776,"0.2.19"]