3 ms·
Historically Emacs used to disable even its dumb regex-based syntax highlighting out of the box for performance reasons. The slice of time since a parser-based
by technomancy 13y ago
Historically Emacs used to disable even its dumb regex-based syntax highlighting out of the box for performance reasons. The slice of time since a parser-based approach has become feasible is a tiny fraction of the time Emacs has been around.
- mickeyp 13y agoWell, true, but in fairness, go far enough back and people used Line editors - so yeah, it's certainly rooted in performance issues, but also the independent rise of IDEs and a strong desire by the writers of the IDEs -- who typically wrote the supporting compilers and environments -- to create a greater cohesive environment.
- barrkel 13y ago"Syntax" highlighting is normally done with lexical analysis, not with a parser, and is far, far faster than regex-based syntax highlighting, because it can use a simple tuned state machine, and it only needs to redraw text attributes until it gets to text in the same state (from the state machine) it's trying to repaint. Turbo Pascal was doing syntax highlighting in DOS 20 years ago. Parsers have been used to do semantic highlighting of symbols, e.g. paint identifiers in different colors depending on whether they're interfaces or classes, etc. But the big win for parsing isn't highlighting, it's completion. You can't do super useful completion without a fairly rich parse tree, and not just for the current file, but also for all the libraries.