Premium Only Content

Compiler From Scratch: Phase 1 - Tokenizer Generator 015: Finishing Lazy Token Evaluation
Streamed on 2024-10-25 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Last week we started with the Lazy evaluation build option, but didn't have time to finish it. So today we finished it.
As I dug in, it became clear that I needed a way to track execution of the regex DFA states to see what was happening and when. So I started coding that in. However, that introduced a bug that caused things to crash so hard that there was no debug information. After a log to printf debugging, I narrowed it down to a single snippet of text that was being written out to a file. For some reason, copying a single word out by offset using snprintf was exploding if the source text had a "%" anywhere in it . The "%" was not in the offset/count region that was actually being copied from at all. I replaced the call to snprintf with strncpy and everything worked again. It just makes me sad how much time it took to find the reason and the solution.
Once we were back up and running there was a bit of fiddling to finish off Lazy token evaluation. There are a few differences in the way the process flows when batch processing vs lazy processing, but I found them one at a time (greatly aided by the trace log of the tokenizing process). A bit of testing with other performance flags, an update to the macros in the resulting file, and lazy processing is reasonably working for all of the build options we tested.
Next week we need to write a script to test the different combinations more automatically and efficiently. There are a lot of build configuration options now.
-
LIVE
The Rubin Report
39 minutes agoListen to ‘The View’ Crowd Gasp as Whoopi Admits She Agrees w/ Conservatives on This
2,829 watching -
1:00:49
VINCE
2 hours agoTrump Is Finding The Missing Children | Episode 129 - 09/19/25
73.4K50 -
LIVE
LFA TV
12 hours agoBREAKING NEWS ON LFA TV! | FRIDAY 9/19/25
4,196 watching -
LIVE
Nikko Ortiz
49 minutes agoBeing Poor Is A Choice?! - Rumble Studio LIVE
266 watching -
LIVE
Caleb Hammer
2 hours ago$60,000+ For New Boobs | Financial Audit
120 watching -
LIVE
The Big Migâ„¢
2 hours agoRet. Col. Doug Macgregor, Battlefield Legend & Author
4,626 watching -
1:45:19
Dear America
2 hours agoErica Kirk Just Announced As Turning Point CEO!! + Senate Dubs Oct 14th Charlie Kirk Day!!
111K25 -
LIVE
Benny Johnson
1 hour agoStephen Colbert DOUBLES DOWN On Jimmy Kimmel's Lies | Inside Decision to RIP Jimmy Kimmel Off Air...
5,913 watching -
LIVE
Badlands Media
7 hours agoBadlands Daily: September 19, 2025
3,904 watching -
35:08
Colion Noir
19 hours agoA Bear, an AR-15, and a Home Invasion
56.8K9