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
								Dr Disrespect
7 hours ago🔴LIVE - DR DISRESPECT - ARC RAIDERS - FULL SEND INTO THE RED
2,117 watching - 	
				
							26:34
								Stephen Gardner
1 hour ago🔥Elon EXPOSES The Exact Blueprint Dems use to CHEAT on Joe Rogan!!
1.12K22 - 	
				
							LIVE
								Dad Saves America
5 hours agoMask Off Mamdani: NYC’s Socialist “Savior” Is Another Spoiled Aristocrat
131 watching - 	
				
							6:14
								Buddy Brown
6 hours ago $0.76 earnedLaw Enforcement Caught SNOOPING on PRIVATE LAND! | Buddy Brown
4325 - 	
				
							16:21
								Real Estate
1 month agoIt’s Not Just You..NO ONE CAN AFFORD KIDS ANYMORE
1092 - 	
				
							LIVE
								LFA TV
23 hours agoLIVE & BREAKING NEWS! | MONDAY 11/3/25
1,152 watching - 	
				
							1:11:07
								vivafrei
2 hours agoFishing for Lawsuits! I Get Blocked Because Zohran is Anti-Gay? Halloween Terror Plot & MORE!
72.1K22 - 	
				
							1:12:46
								Russell Brand
4 hours agoWE’RE BACK! The Fight for Freedom Starts NOW - SF645
68.2K66 - 	
				
							1:07:56
								The Quartering
3 hours agoBen Shapiro Vs Tucker Carlson, Blackface Trick Works, Kash Patel Under Fire, Based Woman Vs Trans
58.2K18 - 	
				
							1:35:28
								The HotSeat With Todd Spears
2 hours agoEpisode 202: Ladies it's YOUR Battle too!
3.38K7