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:17:50
Russell Brand
2 hours ago"NO ONE IS ABOVE THE LAW! - Just When You Thought It Couldn’t Get Crazier! – SF506
74.2K80 -
LIVE
vivafrei
2 hours agoRay Epps Fed-Surrection Cover-Up? Hunter Biden Pardon Fallout! Plan-Demic Failures & MORE!
3,341 watching -
LIVE
MDGgamin
3 hours ago🔴LIVE- Wake Up Stream Repeat - Games & Chatting - #RumbleTakeover
173 watching -
1:38:13
Mostly Sports With Mark Titus and Brandon Walker
22 hours agoThe World Needs More Jameis Winston & Bo Nix | Mostly Sports EP 302 | 12.3.24
15.2K2 -
DVR
TheAlecLaceShow
4 hours agoDoes Racism Exist? Guest: Franck Zanu | Elon’s Viral Meme | Hunter Pardon | The Alec Lace Show
5.07K3 -
LIVE
G2G Gaming Channel
6 hours agoI heard Smite, So Im here! #RumbleTakeOver #RumbleGaming
119 watching -
15:36
Neil McCoy-Ward
2 hours ago🚨 Emergency Martial Law Declared, Special Forces Deployed...
12.7K5 -
1:57:30
The Charlie Kirk Show
2 hours agoDemocrat Billionaires in Crisis + Fixing the Migrant Crisis | Blagojevich, O'Brien, Metaxas| 12.3.24
51.5K9 -
1:01:07
The Dan Bongino Show
5 hours agoBiden’s Reign Of Destruction Isn’t Over Yet (Ep. 2381) - 12/03/2024
611K1.51K -
1:59:02
Steven Crowder
5 hours ago🔴 COVID Chronicles: The Hidden Truths of the Pandemic Exposed
336K200