Hacker News new | past | comments | ask | show | jobs | submit login

None of these proposals are going to address the main problem: most Emacs modes depend on a lot of regular expressions for syntax highlighting and many other things. Regular expressions are slow; it is a computational complexity problem. That is, for example, the main problem behind long lines being slow (and why they are not so slow in fundamental-mode). Now that Emacs has multi-threading, pervasive regular expressions are the last big thing that is responsible for noticeable performance issues.



> most Emacs modes depend on a lot of regular expressions for syntax highlighting and many other things. Regular expressions are slow

I use Emacs every day. Never had a problem with slow syntax highlighting when working on regular source code files.

I don't feel regexs are bottlenecks in everyday use.


What sort of Regex are they using? The garden variety can be compiled to DFAs (O(n)) which a modern computer should have no issues handling. Further optimizations


Here is a good example:

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-l...

DFAs for regular expressions use exponential memory for regular expression size (also exponential time to compile them to DFAs). Try that for the regular expressions in the link above. There is no way to make regular expressions fast.


I believe Emacs has its own regular expression syntax that doesn't correspond exactly to either POSIX regexes, PCRE, or any other common regex variant. (Presumably because none of them existed yet when Emacs implemented regexes?)


How do more performant editors achieve syntax highlighting?


https://www.lazarus-ide.org/ does language modes with a parser-generator; the coloring is done on tokens. There is no good reason why Lisp code needs to be parsed with regular expressions.


You imagine the rusters think re-writing Emacs in rust is to solve some problem other than the act in and of itself.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: