Emacs维护者考虑加入incremental parsing功能

还举了tree-sitter的例子。以后就能在Emacs里用AST了www。性能也应该比现在好。

https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00059.html

2 个赞

牛逼了。整快点.jpg

感觉不用订阅邮件列表什么的了,有意思的这里都看得到w (还能有个 summary

1 个赞

不是正讨论吗没说就进了啊

看样子是个大工程,现在还在意见收集阶段,希望 emacs 30 之前能看见吧 :joy:

人人都能写paredit的时代要来了么,我好兴奋

有没有什么和 incremental parsing 有关的文献啊,搜了很久都是论文,太长了。

tree-sitter主页记得有论文链接

话题一开始被引向了奇怪的地方(LSP),现在被拉回来了。我感觉incremental parsing在font lock和modular edit(paredit)上大有可为。font lock不说了,就是速度更快,支持更复杂的语法,写起来更容易。modular edit上,可以有自带的expand-region,syntax-aware 的 jump word,等等。

咱最馋的也是全语言 paredit。感觉 Emacs 是不是因为有 Lisp 基因,其用户也比较多在其他语言使用结构化编辑插件。其他编辑器似乎没见到 smartparens 这种规模的插件。

另外看到 Eli 在一开始说还可以用来增强补全,这个没太想明白,有可能是让 etags 根据 parse 的结果来生成 tag file 吗(((

补全这种需要更深的语义理解的功能还是留给lsp吧,像高亮和编辑这种跟语法联系紧密的功能比较适合incremental parsing。

有拉回去了,这个和lsp有毛关系不懂为啥一直围着lsp扯蛋

很多语言并不是完全结构化的,还是要针对每种语言的特定去适配。

https://github.com/manateelazycat/awesome-pair 已经是最全的 paredit 实现了,细节上支持更好,特别是对 web-mode 的支持。

教主不是退隐了吗?

Re: Using incremental parsing in Emacs

   From: Richard Stallman
Subject: Re: Using incremental parsing in Emacs
   Date: Sat, 04 Jan 2020 18:48:48 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

What is VSCode, and how does it relate to Emacs development?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)

https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00127.html

Replacing all C code????

   From: Richard Stallman
Subject: Replacing all C code????
   Date: Sat, 04 Jan 2020 18:47:16 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Rewriting all the C code of Emacs in some other language would be a
tremendous job.  With the same amount of work we could add many
important features that are lacking.  We could make it possible to
edit fancy documents, which currently require a text formatter or
LibreOffice.

If execution of the other language is slower, the slowdown could make
Emacs unusable on old machines.  Old machines such as the T200 and
T400 are very important for our freedom since we can run them with
Libreboot.  We must not downgrade support for them.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)

https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00126.html

看得出来对这个议题还挺重视的。

感觉教主魔怔了,我没看出来哪里要替换所有C代码了……只是举了tree-sitter那个dynamic module作为例子而已。

We could make it possible to edit fancy documents, which currently require a text formatter or LibreOffice.

教主咋这么想拿emacs代替libreoffice :sweat_smile:

对, 教主一直惦记着编辑office文档.

人家说的是把C语言替换为其他语言, 不过此功能跟语言关系不大啊, 除非是替换成javascript, 基于Electron.

很多人对LSP还没那么熟悉, 甚至认为LSP可以搞定一切. 这个还是VSCode的人最懂, VSCode已经在做这方面的尝试了, 再提供API来支持类似tree-sitter的插件.

能明显感觉到最近教主的邮件变多了😂

估计退休以后闲了 doge