编程与软件工程codemirror.net
我们在重写 CodeMirror
We are rewriting CodeMirror
2018 — 2021,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 CodeMirror 6 的项目介绍页,宣告对这款老牌浏览器代码编辑器进行重写。新版强调模块化设计、移动端支持和可访问性,并配合 Lezer 解析器支持语法高亮、补全与检查等能力。它采用 MIT/GPL3 开源,同时期望商业用户资助维护。
为什么经久不衰:它经受住多年首页讨论,因为它不仅是编辑器重写,更回应了 Monaco 竞争、移动端与可访问性等长期痛点,至今仍是浏览器内代码编辑的重要基础设施。
HN 评论精选
质疑 CodeMirror 6 相对 Monaco/VSCode 的差异化价值,追问为何要竞争。
我得问一个可能很蠢的问题:为什么?我在三个项目里用过 CodeMirror,它很棒。现在我用的是 Monaco,也就是 VS Code 的编辑器。CodeMirror 能提供什么?用 Monaco 我能得到 VS Code 的最新功能,当前版本还包含 IntelliSense 等。我真心好奇 CodeMirror 会提供什么,以及为什么还要尝试竞争。不过我猜第一个问题的答案也能回答第二个。
tokyodude查看英文原文
I have to ask what is probably a dumb question. Why? I used CodeMirror on three projects. It was great. Now I use Monaco aka Visual Studio Code. What would CodeMirror offer ? With Monaco I get all the lastest feature of VSCode . Current versions of Monaco include Intellisense etc.. I'm honestly curious both what CodeMirror will offer and why even try to compete. Though I'm guessing the answer to the first question answers the second
期待原生 LSP;Monaco 的 LSP 生态成熟,但 CM6 的移动端支持是差异化亮点。
我原本希望这个版本能有一流的 LSP(语言服务器协议)支持。VS Code 的编辑器可以作为独立的 NPM 包 Monaco 使用,这很好,因为可以轻松获得 LSP 支持。例如 Sorbet(Ruby 类型检查器)实现 LSP 并可编译为 WASM,所以在浏览器里用 Monaco 就能得到和 VS Code 相同的功能,TypeScript Playground 也一样。这个 CodeMirror 版本有很多出色工作,我尤其兴奋的是移动端支持成为主打功能,因为 Monaco 完全缺乏这一点。也许 LSP 支持可以作为未来改进。
jez查看英文原文
One of the things I was hoping to see in this release was first-class LSP (language server protocol) support. VS Code's editor is actually available as a separate NPM package as Monaco[0], which is great because it means that you can trivially get LSP support. For example: https://sorbet.run ^ Sorbet (Ruby type checker) implements the LSP protocol and can be compiled to WASM. So by using Monaco in the browser, we get a playground that supports all the same features as you'd get in VS Code. It's the same for the TypeScript Playground[1]. There's a lot of great work in this release of CodeMirror. I'm especially excited to see mobile support as a headline feature, because that's completely lacking in Monaco. Maybe LSP support can be a future improvement. [0] https://microsoft.github.io/monaco-editor/index.html [1] https://www.typescriptlang.org/play
实际项目验证 CM6 与 Lezer 适合构建语法高亮、上下文补全和行内检查。
我在 https://promlens.com 使用 CodeMirror 6,配合 lezer 解析器生成器,为 PromQL 开发语法高亮、上下文自动补全和行内 lint 非常合适(这部分是开源的,在 codemirror-promql 仓库,主要由 Augustin Husson 构建,我也贡献了一些)。
jrv查看英文原文
I'm using CodeMirror 6 for https://promlens.com and together with the lezer parser generator, it was great for developing syntax highlighting, contextual autocompletion, and inline linting for PromQL (that part is OSS actually, in https://github.com/prometheus-community/codemirror-promql, much of it built by Augustin Husson, some by myself).
关注其开源许可与要求商业用户资助维护的社会期望。
这位开发者处理许可的方式很有意思:他主张商业使用者有社会义务付费。页面写道:CodeMirror 是开源的(MIT 或 GPL3),在 GitHub 上开发,欢迎贡献;如果你在商业项目中使用 CodeMirror,社会期望你帮助资助它的维护。
cmroanirgo查看英文原文
An interesting way the dev handles the licensing, by asserting that commercial ventures have a social obligation to pay: > CodeMirror is open source (MIT or GPL3). It is being developed on GitHub. Contributions are welcome. > If you are using CodeMirror commercially, there is a social expectation that you help fund its maintenance
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选