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.
-
5:45
Tactical Advisor
1 day agoWoox New Lever Action | Shot Show 2025
15K1 -
16:25
Clownfish TV
11 hours agoDEI is Deader Than Disco! Hollywood Most Affected?!
14.6K5 -
1:04:23
CarlCrusher
13 hours agoThe TRUTH about Roswell and the UFO Crash Recovery Material
9.06K2 -
59:40
Trumpet Daily
20 hours ago $4.07 earnedAmerica’s Royal Family - Trumpet Daily | Jan. 21, 2025
11.9K18 -
1:03:14
Bek Lover Podcast
13 hours agoInteresting Times with Bek Lover Podcast
25.4K6 -
3:10:10
Price of Reason
15 hours agoTrump is BACK in Action! Elon Musk's Inauguration Gesture Draws MSM Fire! Disney Prepares For LOSSES
42.2K4 -
2:08:22
Kim Iversen
14 hours agoIs This Even Legal? Trump’s Push to End Birthright Citizenship and The Insane Plan to Move Palestinians to Indonesia
140K292 -
1:27:06
Glenn Greenwald
14 hours agoMr. Tracey Goes To Washington: Inauguration Observations, Interviews & Commentary | SYSTEM UPDATE #393
170K60 -
52:01
Tucker Carlson
18 hours agoNew York Mayor Eric Adams Sounds a Lot Like a Trump Voter
243K239 -
2:47:25
Right Side Broadcasting Network
17 hours agoLIVE REPLAY: President Donald J. Trump Holds First Press Briefing Since Inauguration - 1/21/25
262K215