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.
-
1:54:06
Russell Brand
2 hours agoHas he done it? Ukraine Accepts Core Peace Terms — Nobel Prize incoming? - SF655
85.7K12 -
24:37
Stephen Gardner
2 hours agoTrump JUST Exposed 2 HUGE LIES meant to TAKE HIM DOWN!!
2.98K10 -
1:09:52
vivafrei
2 hours agoCBS News "Debunks" The Blaze Pipe Bomber Story? Thomas Massie Threatened by Kash Patel? AND MORE!
14.6K8 -
1:21:16
The White House
6 hours agoVice President JD Vance Celebrates Thanksgiving with Servicemembers and Delivers Remarks
9.5K10 -
59:49
The Quartering
3 hours agoMTG MELTDOWN On X, Hasan Piker Runs From Ben Shapiro & AI Nightmare!
86.4K34 -
1:16:24
DeVory Darkins
4 hours agoDISTURBING: Eric Swalwell left DUMBFOUNDED after he gets confronted about trans athletes
69.9K39 -
LIVE
Dr Disrespect
6 hours ago🔴LIVE - DR DISRESPECT - ARC RAIDERS - RANDOM SQUADS
1,771 watching -
2:06:36
Side Scrollers Podcast
5 hours agoThis is the Dumbest Story We’ve Ever Covered… | Side Scrollers
32.5K8 -
1:13:26
Steven Crowder
7 hours ago🔴 Jay Dyer on Hollywood, The Occult, and the Attack on the American Soul
251K185 -
1:26:28
Sean Unpaved
5 hours agoNFL Thanksgiving Games Are Going To Be ELECTRIC! | UNPAVED
30.2K3