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:19:30
Game On!
23 hours ago $6.57 earnedCollege Football Week 4 Betting Preview!
105K3 -
26:04
Artur Stone Garage
4 days ago $0.15 earned$500 Civic: Will It EVER Drive Without Breaking Down?
1.4K -
31:44
SouthernbelleReacts
2 days ago $0.30 earned“E.T. Phone Home! 🛸 Emotional Mom Style Reaction to E.T. the Extra-Terrestrial (1982)”
4.15K1 -
20:10
JohnXSantos
22 hours agoI Built a FAKE Luxury Brand With $100 In 7 Days
2.54K -
25:24
marcushouse
2 hours ago $0.42 earnedStarship Test Trouble… and Block 3 Finally Unveiled! 🤯
3.84K4 -
1:13:26
Squaring The Circle, A Randall Carlson Podcast
9 hours agoSaving The Bees and Healing The Planet!
2.82K1 -
16:18
Chris Harden
2 days agoCharlie Kirk Utah Reaction | What Locals Are Saying
4K5 -
50:47
ChurchandState1776
19 hours agoFree speech is not negotiable with Sam Anthony
2.23K2 -
LIVE
Total Horse Channel
19 hours agoAMHA 2025 9/20
836 watching -
16:59
Chris From The 740
19 hours ago $2.43 earnedIs Bigger Better? - The Gideon Optics Mediator 2 Is Here!
16K2