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.
-
2:00:47
Sam Tripoli
2 days ago $4.22 earned#965: BlackRock Bamboozle With Susan Bradford
3.99K12 -
17:58
Nikko Ortiz
2 days agoClips That Went Too Far...
38.6K5 -
47:33
The Sam Hyde Show
2 days agoThe Sam Hyde Show: This is War w/ Ken O'Keefe
88K42 -
LIVE
FreshandFit
12 hours agoJames Fishback Debates Miami Girls & 5 RAGE QUIT
10,923 watching -
1:55:12
Badlands Media
22 hours agoDevolution Power Hour Ep. 433: Epstein Psyops, SAVE Act Theater & The Coming Election Reveal
70.8K34 -
1:15:27
Inverted World Live
11 hours agoThe Discombobulator | Ep. 174
58.2K22 -
3:02:15
ThatStarWarsGirl
12 hours agoTSWG LIVE: HollyWEIRDS Gone NUTS! 007 Casting, Robert Pattinson in Drag, Comics And MORE!!!
27.6K1 -
1:16:52
Adam Does Movies
6 hours ago $3.25 earnedTalking Movies + Ask Me Anything - LIVE
30.7K2 -
3:00:29
TimcastIRL
6 hours agoWAR! US War With Iran FEARED As MASSIVE Deployment Heading To Gulf | Timcast IRL #1452 w/ Amber Duke
196K66 -
LIVE
GritsGG
8 hours ago#1 Warzone Victory Leaderboard 1410+ Ws!!🔥
566 watching