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:25:13
Kim Iversen
2 hours agoMKUltra Victims Are SUING — The CIA's Darkest Secret EXPOSED
75.5K34 -
16:30
Stephen Gardner
2 hours ago🚨OVAL OFFICE EXPOSES TRUMP TAKEOVER – FILIBUSTER NUKED!
8.73K15 -
1:34:03
Redacted News
3 hours agoBREAKING! CIA FURIOUS & EMERGENCY WHITE HOUSE MEETING - ISRAELI SPY CAUGHT MEETING WITH AMB HUCKABEE
113K106 -
1:22:06
vivafrei
4 hours agoCFIA Goes After a REFUGE? Charlie Kirk Missing Evidence "Uncovered"? Democrats are Epostein Simps!
119K52 -
1:44:33
The Quartering
5 hours agoTrump Calls For Hangings, McDonalds SNAP Controversy, The Demonic Relationship In Wicked & More
146K65 -
21:40
Bitcoin Policy Institute
7 hours agoCongressman Warren Davidson Unveils the “Bitcoin for America Act” | Spotlight Series #1
27.1K -
LIVE
LFA TV
21 hours agoLIVE & BREAKING NEWS! | THURSDAY 11/20/25
1,024 watching -
LIVE
freecastle
8 hours agoTAKE UP YOUR CROSS- Let your eyes LOOK directly FORWARD, and your gaze be STRAIGHT before YOU!
30 watching -
1:25:51
DeVory Darkins
6 hours agoDemocrats caught in corruption scheme as JD Vance issues MAJOR UPDATE
155K76 -
1:48:48
MattMorseTV
6 hours ago $41.25 earned🔴Sedition Charges INBOUND.🔴WH Press Conference.🔴
69K174