Premium Only Content
Compiler From Scratch: Phase 1 - Tokenizer Generator 008: Code generating Context and Token
Streamed on 2024-09-06 (https://www.twitch.tv/thediscouragerofhesitancy)
Zero Dependencies Programming!
Today we generated more code to support the tokenizer we will be generating. We generated a class to handle Context. This is a simple object that keeps all the shared state and intermediate results which are in use throughout the different stages. For starters it contains our text buffer and a list of error and warning messages. This class will grow as we need more features.
We also generated the Token class that the Tokenizer will generate. This class contains all the information about where to find the token in the text buffer and a token identifier.
Then we got a start on generating the Tokenizer itself. We have stubbed in some of the simple parts, but there are two main processing methods we could go through: lazy or batch evaluation. Both have different performance implications, so we will generate both inside of ifdef checks so we can test them both.
In all this coding, we are writing out text, and large sections are just text with no modification which we could get from a separate file and not clutter our main code generation. The idea of having code snippets in an asset folder, then an asset pipeline script which embeds the code into our code would mean we could edit our snippets easier and also not count as much of that code towards our line count. We might work on this next week ... unless I get ambitious and excited about it and do it on my own before the next stream. That happens sometimes. Especially when I don't get to work on my compiler more than once a week and start to get the shakes.
-
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.8K51 -
LIVE
LFA TV
15 hours agoLIVE & BREAKING NEWS! | THURSDAY 12/18/25
2,813 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
834 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?🔥
155 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 -
1:06:53
Graham Allen
5 hours agoDan Bongino Out At The FBI, Something Is Coming and Its Massive!
161K1.71K