Premium Only Content
Compiler From Scratch: Phase 1 - Tokenizer Generator 009: Generating DFA State code
Streamed on 2024-09-13 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
I have to confess to cheating ... I did some work on the compiler off-stream. I created an asset pipeline for managing Code Snippets ... large chunks of text that are the same no matter what. These Code Snippets can be divided into chunks with a line of "...", so I can write a chunk, then emit custom code, and move on to the next chunk. The other thing was I refactored TxtBuf and ChrRef to remove the circular dependency that would necessarily exist if I use ChrRef in a TxtBuf::Iterator. And now I have a TxtBuff::Iterator. But that was all the cheating, I swear! Everything else we do on-stream.
Today was starting to emit DFAStates into our Tokenizer. Each DFAState has a list of Transitions and each Transition contains a list of conditions to check, and where the next DFAState is if those conditions are met. All the code emitted today was into simple methods, one per DFAState.
But a lot of the complexity we will face will come in the form of the PerformanceSwitches I am putting in. Whenever I come to a decision that I think will impact performance I am emitting code for each of those decisions, wrapped in a #ifdef/#endif so we can change some defines in our build and test the alternatives. There is some overlap between some of the options I've thought up, so we are going to be emitting way more code than we will end up with. As we go we will confirm correctness of each PerformanceSwitch, but we won't profile until things are working end-to-end and we have a large body of text to test against ... maybe JSON? So, if this stage of development seems a little slow, remember, I am generating 96 (currently) permutations of the way this code could be written.
-
14:33
Robbi On The Record
3 hours ago $1.97 earnedNPC Girls & The Digital Dehumanization of Women
12.6K7 -
53:25
Simply Bitcoin
1 day ago $0.64 earnedThe Bitcoin Crucible w/ Alex Stanczyk & Tomer Strolight - Episode 13
15K1 -
59:21
The Rubin Report
2 hours agoIs This the Real Reason Bongino Is Leaving the FBI?
28.8K52 -
LIVE
LFA TV
15 hours agoLIVE & BREAKING NEWS! | THURSDAY 12/18/25
2,811 watching -
LIVE
The Mel K Show
2 hours agoMORNINGS WITH MEL K- America is Mad As Hell And We’re Not Going to Take it Anymore! - 12-18-25
832 watching -
LIVE
The Shannon Joy Show
3 hours ago🔥SJ LIVE Dec 18 - Exclusive With Peter Schiff On Trumpflation, The Affordability Crisis, AI Bubbles & Bitcoin Collapse. Will Metals Become The Global Hedge Against Financial Chaos?🔥
156 watching -
45:19
Grant Stinchfield
1 hour agoKeystone Cops of the Ivy League... It Gets Worse Every Day as Brown Suspect Still on the Run!
1.72K9 -
1:02:26
VINCE
4 hours agoIt's Official: Dan Bongino To Leave FBI | Episode 191 - 12/18/25 VINCE
224K283 -
1:04:17
Chad Prather
3 hours agoTrump FOOLS Fake News, Touts Accomplishments + Trans Surgeries For Minors BANNED & BONGINO IS BACK!
34.7K11 -
2:04:25
Benny Johnson
3 hours ago🚨Trump BREAKS Internet With Primetime Address, TROLLS Media Into Covering His WINS | 2025 IN REVIEW
55.3K48