HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
trishume
syntect
Rust2017–2021
trishume / syntect

syntect

Rust library for syntax highlighting using Sublime Text syntax definitions.

7Distinct people
11Mentions
0Explicit recommenders
2.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Rust library for syntax highlighting using Sublime Text syntax definitions.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 11:34:28 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year11 dated mentions

Observed mentions: 2017-02-08 16:57:32 UTC to 2021-05-21 09:00:26 UTC.

012342017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC404
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

What Hacker News says

4 sources
Syntect's grammars are regex based, they're based on ST3's grammars which are an extension of the fundamental model used by Textmate/Atom/VSCode. They're stronger than just regexes though, there's a fancy stack machine with all sorts of features laid on top that allows it to do full parsing of a lot of languages. The more modern grammars are written with a regex style that makes heavier use of the stack machine and so only uses regexes that can be turned into a DFA. There's ongoing work to use a layer on top of Rust's super-fast DFA-based regex engine to accelerate these grammars https://github.com/trishume/syntect/pull/34. The problem with using non-regex based grammars is that you have to write them yourself. Syntect is something like 4000 lines of code but the grammars it uses total around 35k lines, and that's just the included ones,
Read the rest
not the full ecosystem of online grammars. Basically unless you only want to support a small set of languages, a non-regex-based highlighting library is fairly infeasibly for a single hobbyist.
In Chroma – A General purpose syntax highlighter in Go
Shameless plug for my syntax highlighting library in Rust which uses Sublime Text 3 grammars, which give much richer highlighting and semantic information than Pygments: https://github.com/trishume/syntect Sourcegraph also wrote a server using syntect which provides an API for highlighting, which they use to power their new server, so you can use it from any language (at a cost): https://about.sourcegraph.com/blog/announcing-sourcegraph-2 https://github.com/sourcegraph/syntect_server
In Chroma – A General purpose syntax highlighter in Go
As the author, this is the kind of condescension of Sublime users that annoys me. I think I know vim quite well, I've been using vim bindings for 5 years now across varying editors. I know almost all Vim bindings. How about a test? Suppose my cursor is on line 198 of https://github.com/trishume/syntect/blob/ef3b99b06b72e89b7a0.... I want to copy "match_pat.has_captures && cur_level.captures.is_some()" on line 172. If you give me an efficient sequence of vim bindings for that movement I can tell you if I know what everything does without looking it up. I think a more apt criticism would be that I think too slowly to use Vim. I can figure out that "26j4wy10e" does what I want, and at my normal english characters/second typing speed that is faster than doing the selection with my mouse. However, when I actually try and do that without figuri
Read the rest
ng it out ahead of time I take longer to read, count and figure out the right numbers and actions, then type the individual characters (which due to muscle memory for english I'm slower at than typing english). I end up being slower than the mouse, and with a higher mental load. You could say I just need to "git gud" and practice, but if practicing for hours a day for 5 years doesn't get me to the point that I'm better than the mouse, I think it's time to say that maybe it isn't a lack of practice, but perhaps an innate skill difference. That all presumes that there exists a substantial number of people who are faster in practice at long distance text selection with vim shortcuts than I am with the mouse. I have yet to see someone where I can confidently say that is the case, and I've watched a reasonable number of vim users. I guess everyone I've seen using vim (including many 5+ year users) is a "vim n00b" in your model, that sounds a bit "no true scotsman"-like.
In My Text Editor Journey: Vim, Spacemacs, Atom and Sublime Text
Shameless plug: my implementation of Sublime's syntax highlighting engine in Rust has similar optimizations and more. I'm not at my computer to benchmark on the same files but it should be >2x as fast as their "after" numbers just based on lines/second for JS-like files. This evening I'm even trying to port it to a pure Rust regex engine that should eliminate non-Rust code and make it substantially faster. It also implements the sublime-syntax format which is a superset of tmlanguage that allows even nicer highlighting. https://github.com/trishume/syntect
In Optimizations in Syntax Highlighting

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.