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.
-
8:46
Lacey Mae ASMR
16 hours agoASMR But You're At The DMV [Whispered Roleplay]
1.26K1 -
13:24
Actual Justice Warrior
1 day agoCrazed New York Kidnapper THROWS Child
4.1K6 -
23:14
DeVory Darkins
1 day ago $6.67 earnedMayor Bass PANICS during press conference as Democrats suffer LEGAL BLOW
9.79K61 -
2:00:21
MG Show
19 hours agoCIA Report Confirms Trump was Framed; I Stand with Ice
13.7K20 -
10:58
Nikko Ortiz
1 day agoCrazy Karen TikTok Fails Part 13
133K13 -
14:55
Michael Knowles
1 day agoThe Epstein Files Just Got WEIRDER
15.4K50 -
50:02
The Why Files
8 days agoProject Pegasus | The CIA's Child Time Soldiers
57.2K52 -
2:00:35
Freshprinceceo
7 hours agoAre BBL's and Plastic Surgery Going Out of Style?
23.4K -
3:58:41
Alex Zedra
10 hours agoLIVE! Scary game again :D
32.2K3 -
3:04:10
TimcastIRL
11 hours agoLeftist Anti ICE Just OPENED FIRE On ICE Agents In California At LA Riots | Timcast IRL
336K174