相关推荐

Pyrefly
<p>Pyrefly 是一款快速的 Python 类型检查器,计划在 2025 年底取代 Meta 现有的 Pyre 类型检查器。</p> <p>Pyrefly 旨在通过 IDE 功能和检查 Python 代码来提高开发速度。</p> <p>主要特点:</p> <ul> <li>类型推断:除了函数参数之外,Pyrefly 可以在大多数位置推断类型。它可以推断变量的类型和返回类型。</li> <li>Flow Types:Pyrefly 可以理解程序的控制流以细化静态类型。</li> <li>增量性:Pyrefly 旨在实现模块级的大规模增量性,并优化检查和并行性。</li> </ul> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <p>Pyrefly:Python 的快速类型检查器和 IDE</p> <a id="user-content-pyrefly-a-fast-type-checker-and-ide-for-python" class="anchor" href="https://github.com/facebook/pyrefly#pyrefly-a-fast-type-checker-and-ide-for-python" aria-label="永久链接:Pyrefly:Python 的快速类型检查器和 IDE"></a></div> <pre class="hljs python"> </pre> <p>目前正在积极开发中,存在已知问题。如果您发现错误,请提交问题。</p> <pre class="hljs python"> </pre> <p>Pyrefly 是一款快速的 Python 类型检查器。它计划在 2025 年底取代 Meta 现有的 Pyre 类型检查器。本 README 介绍了 Pyrefly 的基本用法。完整文档及代码检查工具请访问<a href="https://pyrefly.org/" rel="nofollow">Pyrefly 网站。</a></p> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h3 class="heading-element" dir="auto" tabindex="-1">入门</h3> <a id="user-content-getting-started" class="anchor" href="https://github.com/facebook/pyrefly#getting-started" aria-label="永久链接:入门"></a></div> <pre class="hljs python"> </pre> <p>Pyrefly 旨在通过 IDE 功能和检查 Python 代码来提高开发速度。</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li>在浏览器中尝试 pyrefly:<a href="https://pyrefly.org/sandbox/" rel="nofollow">沙盒</a></li> <li>获取命令行工具:<code>pip install pyrefly</code></li> <li>获取 VSCode 扩展: <a href="https://marketplace.visualstudio.com/items?itemName=meta.pyrefly" rel="nofollow">链接</a></li> </ul> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h3 class="heading-element" dir="auto" tabindex="-1">主要特点:</h3> <a id="user-content-key-features" class="anchor" href="https://github.com/facebook/pyrefly#key-features" aria-label="永久链接:主要特点:"></a></div> <pre class="hljs python"> </pre> <ul dir="auto"> <li>类型推断:除了函数参数之外,Pyrefly 可以在大多数位置推断类型。它可以推断变量的类型和返回类型。</li> <li>流类型:Pyrefly 可以理解程序的控制流以细化静态类型。</li> <li>增量性:Pyrefly 旨在实现模块级的大规模增量性,并优化检查和并行性。</li> </ul> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h2 class="heading-element" dir="auto" tabindex="-1">参与其中</h2> <a id="user-content-getting-involved" class="anchor" href="https://github.com/facebook/pyrefly#getting-involved" aria-label="永久链接:参与"></a></div> <pre class="hljs python"> </pre> <p>如果您有任何问题或想要报告错误,请 <a href="https://github.com/facebook/pyrefly/issues">创建问题</a>。</p> <pre class="hljs python"> </pre> <p>请参阅我们的 <a href="https://github.com/facebook/pyrefly/blob/main/CONTRIBUTING.md">贡献指南</a> 以获取有关如何为 Pyrefly 做出贡献的信息。</p> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h2 class="heading-element" dir="auto" tabindex="-1">选择</h2> <a id="user-content-choices" class="anchor" href="https://github.com/facebook/pyrefly#choices" aria-label="永久链接:选择"></a></div> <pre class="hljs python"> </pre> <p>编写 Python 类型检查器时有很多选择。我们从<a href="https://pyre-check.org/" rel="nofollow">Pyre1</a>、 <a href="https://github.com/microsoft/pyright">Pyright</a>和 <a href="https://mypy.readthedocs.io/en/stable/" rel="nofollow">MyPy</a>中汲取了灵感。以下是一些值得注意的选择:</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li>除了函数的参数外,我们在大多数地方都会推断类型。我们确实会推断变量和返回值的类型。例如, <code>def foo(x): return True</code>的结果等同于你写的<code>def foo(x: Any) -&gt; bool: ...</code>。</li> <li>我们首先尝试推断<code>[]</code>它的使用类型,然后再进行修复。例如,<code>xs = []; xs.append(1); xs.append("")</code>我们会推断出“ <code>xs: List[int]</code>然后”在最后一条语句上出错。</li> <li>我们使用流类型来细化静态类型,例如,<code>x: int = 4</code>既知道<code>x</code>具有类型<code>int</code>,而且紧接着的下一次使用<code>x</code>也会知道类型是<code>Literal[4]</code>。</li> <li>我们的目标是实现大规模增量(在模块级别)并通过并行性进行优化检查,旨在利用 Rust 的优势使代码更简单一些。</li> <li>我们期望模块具有大型强连接组件,并且不会尝试利用源代码中的 DAG 形状。</li> </ul> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h2 class="heading-element" dir="auto" tabindex="-1">设计</h2> <a id="user-content-design" class="anchor" href="https://github.com/facebook/pyrefly#design" aria-label="永久链接:设计"></a></div> <pre class="hljs python"> </pre> <p>设计中有很多细微之处会定期发生变化。但构建棋盘格的基本原理涉及三个步骤:</p> <pre class="hljs python"> </pre> <ol dir="auto"> <li>弄清楚每个模块导出的内容。这需要<code>import *</code> 传递性地解决所有语句。</li> <li>对于每个独立的模块,将其转换为绑定,处理所有语句和范围信息(静态和流)。</li> <li>解决这些绑定,可能需要解决其他模块中的绑定。</li> </ol> <pre class="hljs python"> </pre> <p>如果我们遇到不可知的信息(例如递归),我们会<code>Type::Var</code>插入占位符,稍后再填充。</p> <pre class="hljs python"> </pre> <p>对于每个模块,我们按顺序完整地解决各个步骤。具体来说,我们不会像 <a href="https://github.com/dotnet/roslyn">Rosyln</a>或 <a href="https://www.typescriptlang.org/" rel="nofollow">TypeScript</a>那样首先尝试解决某个特定的标识符,也不会使用细粒度的增量式方法(例如<a href="https://github.com/rust-lang/rust-analyzer">Rust Analyzer</a> 使用<a href="https://github.com/salsa-rs/salsa">Salsa</a>)。相反,我们追求的是原始性能和更简单的以模块为中心的设计——如果解决模块中的所有绑定足够快,就无需单独解决单个绑定。</p> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h3 class="heading-element" dir="auto" tabindex="-1">绑定示例</h3> <a id="user-content-example-of-bindings" class="anchor" href="https://github.com/facebook/pyrefly#example-of-bindings" aria-label="永久链接:绑定示例"></a></div> <pre class="hljs python"> </pre> <p>给定程序:</p> <pre class="hljs python"> </pre> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto"> <pre>1: x: int = 4 2: print(x)</pre> <div class="zeroclipboard-container"> </div> </div> <pre class="hljs python"> </pre> <p>我们可能会产生以下绑定:</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li><code>define int@0</code>=<code>from builtins import int</code></li> <li><code>define x@1</code>=<code>4: int@0</code></li> <li><code>use x@2</code>=<code>x@1</code></li> <li><code>anon @2</code>=<code>print(x@2)</code></li> <li><code>export x</code>=<code>x@2</code></li> </ul> <pre class="hljs python"> </pre> <p>值得注意的是:</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li>关键在于诸如<code>define</code>(某事物的定义)、<code>use</code>(某事物的用法)和<code>anon</code>(我们需要进行类型检查但不关心其结果的语句)之类的东西。</li> <li>在许多情况下,一个键的值指的是其他键。</li> <li><code>export</code>一些键是通过键和<code>import</code> 值从其他模块导入的。</li> <li>为了消除标识符的歧义,我们使用它们出现的文本位置(在我使用的示例中<code>@line</code>,但实际上它是文件中的字节偏移量)。</li> </ul> <pre class="hljs python"> </pre> <div class="markdown-heading" dir="auto"> <h3 class="heading-element" dir="auto" tabindex="-1">示例<code>Var</code></h3> <a id="user-content-example-of-var" class="anchor" href="https://github.com/facebook/pyrefly#example-of-var" aria-label="永久链接:Var 示例"></a></div> <pre class="hljs python"> </pre> <p>给定程序:</p> <pre class="hljs python"> </pre> <div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto"> <pre>1: x = 1 2: while test(): 3: x = x 4: print(x)</pre> <div class="zeroclipboard-container"> </div> </div> <pre class="hljs python"> </pre> <p>我们最终得到了以下绑定:</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li><code>x@1</code>=<code>1</code></li> <li><code>x@3</code>=<code>phi(x@1, x@3)</code></li> <li><code>x@4</code>=<code>phi(x@1, x@3)</code></li> </ul> <pre class="hljs python"> </pre> <p>表达式<code>phi</code>是两个值的连接点,例如<code>phi(int, str)</code> 。我们忽略和<code>int | str</code>之间的区别,因为在本例中没有必要。<code>define</code><code>use</code></p> <pre class="hljs python"> </pre> <p>在求解过程中,<code>x@3</code>我们会遇到递归。操作上:</p> <pre class="hljs python"> </pre> <ul dir="auto"> <li>我们开始解决<code>x@3</code>。</li> <li>那就需要我们去解决<code>x@1</code>。</li> <li>我们解决的<code>x@1</code>是<code>Literal[1]</code></li> <li>我们开始求解<code>x@3</code>。但我们目前正在求解<code>x@3</code>,所以我们发明一个新的<code>Var</code>(我们称之为<code>?1</code>)并返回 。</li> <li>我们得出结论,<code>x@3</code>一定是的<code>Literal[1] | ?1</code>。</li> <li>由于是<code>?1</code>由引入的,<code>x@3</code>我们记录为<code>?1 = Literal[1] | ?1</code>。我们可以取其可达上限,并得出结论 <code>?1 = Literal[1]</code>。</li> <li>我们简化<code>x@3</code>为仅仅<code>Literal[1]</code>。</li> </ul> <pre class="hljs python"> </pre>

GSAP
GSAP 是一个强大的 JavaScript 工具集,可以将开发人员变成动画超级英雄。构建适用于所有主流浏览器的高性能动画。动画化 CSS、SVG、画布、React、Vue、WebGL、颜色、字符串、运动路径、通用对象……任何 JavaScript 可以触及的东西! GSAP 的 ScrollTrigger 插件可让您使用最少的代码创建令人惊叹的基于滚动的动画。

augment code
Code 是一款面向团队的开发者 AI,它将您组织的专业知识和实践融入到每一次交互中。我们将您团队的集体编码知识放在您指尖,帮助每位开发人员更智能、更快速地工作。 Augment 是一个开发者 AI 平台,它能够理解您的代码库,帮助您理解代码、调试问题并加快交付速度。使用聊天、下一步编辑和代码补全功能,您可以完成更多工作。

Firebase Studio
集成Google基础设施的AI编程工具,支持一键构建前端、后端和移动应用,覆盖从开发到发布的全流程。 结合了类似Lovable、Cursor、Replit的功能,内置数据监控能力,适合快速部署和迭代。X用户称其为“Lovable+Cursor+Replit”的综合体,受到开发者关注。

trae.ai
Trae是字节跳动推出的一款免费AI编程工具,它集成了Claude3.5和GPT-4o等主流AI 模型,旨在为开发者打造一个全方位的智能编程环境。 Trae,致力于成为真正的 AI 工程师(The Real Al Engineer)。Trae 旗下的 AI IDE 产品,以智能生产力为核心,无缝融入你的开发流程,与你默契配合,更高质量、高效率完成每一个任务。

n8n
n8n帮助你将任何具有API的应用程序与任何其他应用程序连接起来,并在很少或没有代码的情况下操作其数据,完成工作流自动化。

Codex CLI
一款轻量级终端运行编码智能体 —— Codex CLI,该工具现已在 GitHub 完全开源。是OpenAI开发的。 Codex CLI 可以直接在用户的计算机上工作,旨在最大化 o3 和 o4-mini 等模型的推理能力,并即将支持 GPT-4.1 等额外的 API 模型。 Codex CLI 可以在 macOS 12+、Ubuntu 20.04+/Debian 10+、Windows 11 的 WSL2 子系统中使用,要求最少拥有 4GB 内存(建议 8GB)。