gears
306
Stars
32
Forks
22
Watchers
17
Open Issues
Apache-2.0
许可证
Scala
语言
2023-03-03
创建时间
2026-10-30
最近更新
项目能做什么
Gears 是面向 Scala 3 的实验性底层异步编程库。它主要解决并发编程复杂及计算泄漏问题,支持使用 `.await` 直接调用异步函数的直观编程风格;提供结构化并发与非结构化外部事件处理工具;并跨平台支持 JVM (>=21)、Scala Native 与 Scala.js (Wasm)。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# gears   [](https://lampepfl.github.io/gears) [](https://lampepfl.github.io/gears/api) An Experimental Asynchronous Programming Library for Scala 3. It aims to be: - **Simple**: enables direct-style programming (suspending with `.await`, calling Async-functions directly) and comes with few simple concepts. - **Structured**: allows an idiomatic way of structuring concurrent programs minimizing computation leaking (*structured concurrency*), while providing a toolbox for dealing with external, unstructured events. - **Cross-platform**: Works on JVM >= 21, Scala Native and Scala.js with WAsm support. > [!WARNING] > On V8 <14.2.75 (Node.js 24 and 25), there is a bug that causes stack overflows in nested async contexts, which are used extensively by Gears. Use Node.js 26+, or another runtime with Wasm 3.0 and JSPI support. > See #165 for more details. ## Getting Started The [Gears Book](https://natsukagami.github.io/gears-book) is a great way to getting started with programming using Gears. It provides a tutorial, as well as a guided walkthrough of all concepts available within Gears. ### Adding `gears` to your dependencies With `sbt` 2: ```scala libraryDependencies += "ch.epfl.lamp" %% "gears" % "<version>" ``` For cross-platform dependencies with sbt 1, use `%%%`. With `mill`: ```scala def ivyDeps = Agg( // ... other dependencies ivy"ch.epfl.lamp::gears:<version>" ) ``` With `scala` (since 3.5.0) or `scala-cli`: ```scala //> using dep "ch.epfl.lamp::gears:<version>" ``` ## Setting up on an unpublished version of Gears The build uses sbt 2 and Scala 3.9.0. You will need JDK >= 21 and [Scala Native](https://scala-native.org) set up, plus Node.js 26+ to run the Scala.js tests. ```bash sbt publishLocal ``` ## Contributing We are happy to take **issues**, **pull requests** and **discussions**! For a quick look at our development environment and workflow, check our the [contributing guide](./CONTRIBUTING.md). ### Related Projects You might also be interested in: - [**ox**](https://github.com/softwaremill/ox): Safe direct-style concurrency and resiliency for Scala on the JVM. ## License Copyright 2024 LAMP, EPFL. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and阅读完整原文
项目深度分析 AI 生成
直接风格(Direct-Style)微服务与网络应用框架
| 产品构想 | 基于 Gears 的结构化并发原语,封装类似 Go/Ktor 体验的高性能轻量级 HTTP/RPC 服务端开发框架,降低 Scala 编写高并发 Web 服务的门槛。 |
| 核心功能 | HTTP 路由与中间件、结构化并发请求上下文管理、跨平台支持(JVM 21 Virtual Threads / Native)、JSON/Protobuf 序列化集成。 |
| 目标用户 | 采用 Scala 3 且厌倦复杂 Monad 栈(Cats Effect / ZIO)的后端团队或中小型企业开发者。 |
| 难度/周期 | 高 · 3-6个月 · 成本:极低(主要是自身研发与测试服务器成本) |
| 收费模式 | 核心开源,高级插件(如企业级 Auth、监控告警集成)双许可或商业授权,提供付费定制支持。 |
| 竞争风险 | 生态成熟度严重不足;Scala 社区规模相对较小;竞品(如 ox、Armadillo 等)竞争;Gears 自身仍处于 experimental 状态,上游 API 变动频繁。 |
| 依据 | AI推测 |
结构化并发调试与可视化分析工具
| 产品构想 | 利用 Gears 的层级式并发和取消机制,开发配套的 APM/调试探针与 Web 仪表盘,可视化展示异步任务树(Task Hierarchy)、协程挂起状态与泄漏检测。 |
| 核心功能 | 实时并发树状图可视化、挂起/阻塞热点定位、死锁与未处理取消检测、OpenTelemetry 链路标准导出。 |
| 目标用户 | 构建复杂并发后台服务、对内存/线程泄漏敏感的平台工程师与架构师。 |
| 难度/周期 | 中等至高 · 2-4个月 · 成本:低(基础云服务与前端展示) |
| 收费模式 | SaaS 订阅制(按监控节点/事件量收费)或企业私有部署 License。 |
| 竞争风险 | 底层平台(JDK 21+ Virtual Threads / Wasm JSPI)的底层追踪标准尚在演进中,探针适配成本高;目标用户体量目前非常窄。 |
| 依据 | 尚需验证的假设 |
Scala 3 并发迁移与工程落地咨询/培训服务
| 产品构想 | 提供从传统 Future/Monadic (Cats-Effect/ZIO) 向现代 Direct-Style (Gears/Virtual Threads) 并发范式重构的咨询、技术评估与内训课程。 |
| 核心功能 | 并发架构审计、性能基准对比分析、迁移指南与 Codemod 工具链、团队现场/远程实战培训。 |
| 目标用户 | 维护陈旧 Scala 代码库、计划升级到 Scala 3 及 JDK 21+ 的大型企业技术团队。 |
| 难度/周期 | 中等 · 1-2个月 · 成本:极低(主要为人力沟通与材料准备) |
| 收费模式 | 咨询人天费用、企业培训课时费、项目包工改造费。 |
| 竞争风险 | Gears 目前定位为 strawman(草案原型),生产环境采用意愿极低;企业普遍倾向于选择成熟稳定的生态(如继续留在 Cats Effect 或直接用 JDK 21 原生机制)。 |
| 依据 | 已验证事实 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建于 2023-03-03,近 30 天仍在推送,发布过 8 个 Release |
| 社区活跃 | Star 306 / Fork 32 / Issue 17(数据支持,可自行核实) |
| 许可证 | Apache-2.0 |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。