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.
-
13:25
Nikko Ortiz
1 day agoWorst Karen TikTok Fails
9.44K10 -
40:24
The Connect: With Johnny Mitchell
2 days ago $18.41 earnedInside The WORST Drug-Infested Slums Of Medellin, Colombia
56.6K29 -
4:14
GritsGG
14 hours ago2 Warzone Easter Eggs! How to Find Them EASILY!
4.8K -
LIVE
Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
235 watching -
1:45:43
Man in America
14 hours agoThe DISTURBING Truth About Parasites — Live Q&A w/ Dr. Jason Dean
71.1K38 -
7:13:47
SpartakusLIVE
10 hours ago#1 Mountain of Muscle with HUGE Legs saves your weekend from complete BOREDOMNight HYPE
42.3K1 -
47:42
Sarah Westall
11 hours agoFreedom or Slavery? AI will Change Everything w/ Trump Senior Advisor Marc Beckman
56.7K12 -
2:23:20
vivafrei
18 hours agoEp. 285: Visa Revocation No-Go! Sortor Arrested! Ostrich Crisis! 2A Win! Comey Defense & MORE!
115K110 -
5:55:11
CassaiyanGaming
8 hours ago🟢LIVE - VISITING GOOB LAGOON! - Will They Rip Me Off?!? Waterpark Simulator
41.8K4 -
5:42:21
EricJohnPizzaArtist
6 days agoAwesome Sauce PIZZA ART LIVE Ep. #64: Robbie “The Fire” Bernstein
48.5K2