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.
-
26:33
DeVory Darkins
1 day ago $53.44 earnedRep Omar EMBARRASSES herself in a painful way as Newsom PANICS over Kamala confrontation
84.1K299 -
3:28:14
Badlands Media
1 day agoThe Narrative Ep. 39: The Sovereign Mind
112K37 -
2:17:35
TheSaltyCracker
10 hours agoThe Charlie Kirk Effect ReeEEStream 9-21-25
122K319 -
2:03:07
vivafrei
10 hours agoEp. 283: Charlie Kirk Memorial and other Stuff in the Law World
221K184 -
9:13:12
The Charlie Kirk Show
21 hours agoLIVE NOW: Building A Legacy, Remembering Charlie Kirk
2.17M944 -
1:55:20
The White House
13 hours agoPresident Trump Participates in the Memorial Service for Charlie Kirk
108K95 -
1:02:41
Sarah Westall
12 hours agoDomestic Terror Operation: Death Threats, Smear Campaigns, Gang Stalking w/ Journalist Sarah Fields
60.1K10 -
1:51:40
Nerdrotic
12 hours ago $22.72 earnedGobekli Tepe Discovery and "Reconstruction" | Forbidden Frontier #118
97.7K10 -
29:07
Tactical Advisor
12 hours agoATF Changes Ruling on SBR & Tacpack unboxing | Vault Room Live Stream 039
103K21 -
2:00
From Zero → Viral with AI
18 hours ago $6.19 earnedAre You Being Left Behind? Why AI Marketing is No Longer Optional
56.5K10