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.
-
5:32:35
Akademiks
5 hours agoWHERE IS WHAM????? Thug we Forgive u dawg.. Ralo vs Boosie. Charlie Kirk fallout. Cardi B album?
61.3K6 -
2:05:53
Inverted World Live
6 hours agoDeath Cult Terror Cells, NASA Bans Chinese Nationals | Ep. 108
64.1K10 -
2:43:57
TimcastIRL
7 hours agoVP Says No Unity With Democrats Celebrating Charlie Kirk Assassination, Left Confirmed | Timcast IRL
283K178 -
13:45
The Charlie Kirk Show
7 hours agoTPUSA AT ASU CANDLELIGHT VIGIL
227K66 -
55:10
Katie Miller Pod
7 hours ago $15.27 earnedEpisode 6 - Attorney General Pam Bondi | The Katie Miller Podcast
101K29 -
1:46:41
Man in America
12 hours agoLIVE: Assassin Story DOESN'T ADD UP! What Are They HIDING From Us?? | LET'S TALK
81.6K99 -
2:24:17
Barry Cunningham
8 hours agoFOR PRESIDENT TRUMP WILL TAKE NO PRISONERS AND THE LIBS SHOULD EXPECT NO MERCY!
117K69 -
1:08:41
Savanah Hernandez
8 hours agoCharlie Kirk Was Our Bridge And The Left Burned It
64.8K55 -
1:59:01
Flyover Conservatives
11 hours agoFinancial Web Behind Charlie Kirk's Murder with Mel K | Silver On It's Way to $50 | FOC Show
73K5 -
2:36:19
We Like Shooting
19 hours ago $1.73 earnedWe Like Shooting 628 (Gun Podcast)
47.4K1