TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Translations of Russ Cox's Thompson NFA C Program to Rust

83 pointsby asicspover 1 year ago

4 comments

mleonhardover 1 year ago
If you&#x27;re interested in Rust regex implementations, you may be interested in the one that I wrote in a macro: <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;safe-regex" rel="nofollow noreferrer">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;safe-regex</a> . At build time, the macro generates the matcher as Rust code. The compiler then compiles and optimizes the matcher code as part of your Rust binary.<p>I wanted to see if it was possible to make a fast Rust regex library without using any unsafe code. It turns out that it is. Russ Cox&#x27;s paper was very helpful.
porridgeraisinover 1 year ago
Ripgrep also uses Thompson nfas
评论 #38125503 未加载
评论 #38126740 未加载
评论 #38125934 未加载
评论 #38125930 未加载
panyamover 1 year ago
I actually had a lot of fun doing this in typescript (though a much simpler not as prod ready version of it) - <a href="https:&#x2F;&#x2F;github.com&#x2F;panyam&#x2F;tlex">https:&#x2F;&#x2F;github.com&#x2F;panyam&#x2F;tlex</a>
评论 #38136756 未加载
bsaulover 1 year ago
Every time i read about rust requiring you to use indices instead of pointers for some algorithm, i wonder if this isn&#x27;t just rust forcing you to implement your own memory management, with your own local pointers.
评论 #38127187 未加载
评论 #38127140 未加载
评论 #38127115 未加载
评论 #38126561 未加载
评论 #38127484 未加载
评论 #38137129 未加载
评论 #38127955 未加载
评论 #38126881 未加载