google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.21k stars 179 forks source link

[enhancement] DSLX should introduce turbofish qualifier to avoid need to backtrack #1691

Open cdleary opened 3 weeks ago

cdleary commented 3 weeks ago

What's hard to do? (limit 100 words)

We still have backtracking in the parser on account of the fact we don't know if identifier oangle (in an expression grammatical context) is going to be a less-than symbol or a parametric instantiation. To disambiguate this and avoid the need for backtracking Rust has the turbofish qualifier which I'd like to propose we adopt to fully eliminate the backtracking (good explainer blog post with more links here: https://matematikaadit.github.io/posts/rust-turbofish.html )

Code is here:

Current best alternative workaround (limit 100 words)

Keep backtracking -- this had led to bugs historically, and I was able to eliminate almost all backtracking in the past, but this one remains.

Your view of the "best case XLS enhancement" (limit 100 words)

Introduce turbofish to make the parse unambiguous.