what can we do now we have an AST? we can rewrite parts of it to a simpler form! Yes that's right, it's another opportunity to throw stuff away. hooray
@thingskatedid
x? x* x+ x{0,1} all parse to the same kind of AST node, just with different values for the max/min repetition https://t.co/gaL2hqKHNw
@thingskatedid
Moving up a level, [ x ] and (?: x ) lex as different *sequences* of tokens, but they also parse to the same Abstract Syntax Tree. We're throwing away information about which tokens were used to make the tree. https://t.co/V3mMGXBGNU
@thingskatedid
\x2e, \. and the dot inside [.] all get lexed as different *single* tokens. I throw away the information about exactly how each token is spelled, and keep just their decoded character value. So these all produce the same "literal character value" node in the grammar. https://t.co/7oeZPpDin1
@thingskatedid
Anyway we've done all we can with lexing, it's time for a new datastructure. Which gives us new opportunities to throw away information hooray
@thingskatedid
I'm legally obliged to say "colorless green ideas sleep furiously" here.
@thingskatedid
New phase! Parsing! We don't care about how tokens are spelled any more, but we do care about their order. That's what "syntax error" means, the order has to be valid according to a grammar.
@thingskatedid
PCRE has a few ways to spell the same thing, \x2E and \x{2E} both lex to the same token. We need the spelling to decode the escape sequence, but the next phase doesn't need to know. This sort of falls in between lexing and parsing.
@thingskatedid
Here's our lexer for PCRE, the -> $xyz parts are the tokens it produces:
https://t.co/g84fOgCNeE
@thingskatedid
First, lexing breaks up the input into a stream of tokens. PCRE has comments, (?#...)
That's information we can drop right there in the lexer. Read a comment, don't produce a token, and move on to read the next thing.
@thingskatedid
Compilers are a sequence of phases. The reason you break them into multiple phases is to pass different datastructures between each phase. And the reason for different datastructures is so you can drop as much information as possible along the way.
🧵
https://t.co/DOhEUkk6ii
@mrled
@jonst0kes @krishnanrohit There's a tangential rule of thumb I've been thinking about for a couple of years: "infinity makes for bad policy". Other examples: zero tolerance policies, state religions with laws that are justified by spiritual infinities.
@mrled
RT @jonst0kes: As @krishnanrohit essentially says in a QT to this, once somebody makes this move in an argument, the argument is effectivel…
@jonst0kes
As @krishnanrohit essentially says in a QT to this, once somebody makes this move in an argument, the argument is effectively over. The move is, "Ok, so imagine a Djinn..." https://t.co/5CqoHfvhiu
@mrled
I fucking hate it when I look up from Twitter on my phone, which I realize I picked up after closing Twitter on my computer, which I closed so that I could get some work done 👹
@mrled
Ah, you say, but at least the window containing the large picture of my avatar is maximized and thereby obscures everything else on my computer. There is nothing more important than this representation of Me
@mrled
Important to see when joining a meeting: a large picture of just your avatar and nothing else
Not important to see when joining a meeting: a list of participants who have already joined
Thanks @Zoom, ur right, this was a good choice
@brianloveswords
@thingskatedid I would love to read a whole bunch of words about how this works if you ever want to write those words
@thingskatedid
i made something that if a regex would match a single string, anchored at either end, tells you what that string is. not shown here, it exits non-zero if your regex would match more than one string, like /x?/ or /x+/ https://t.co/nFjxtKDx1t
@mrled
@sudobunni Oh wait in Lua both are true, apologies
@mrled
@sudobunni It's a great question, but is zero true like shell, or false like C? Or are both false like Lua??
@sudobunni
true or false: you're only a real developer when you forego languages altogether and just code in binary
@mrled
RT @tenobrus: realizing with mounting horror that this app is showing the bullshit i type here to other ppl??
@tenobrus
realizing with mounting horror that this app is showing the bullshit i type here to other ppl??
@mrled
RT @eigenrobot: overall i wish the aviation-security complex a very merry encounter with my favorite "avian" entity, the blood eagle
@mrled
What is the intended purpose of laws in Ireland and Japan that require companies to announce layoffs for a month before announcing who is actually affected? This has to be worse for everyone over just mandatory severance length, right?
@eigenrobot
overall i wish the aviation-security complex a very merry encounter with my favorite "avian" entity, the blood eagle
@eigenrobot
it IS enough however to prevent the TSA from successfully associating my ticket with my known traveler number which would let me take the fast line through the airport
why do they care? they dont, they already have the extortion payment
@eigenrobot
first, it reveals that no one in the industry cares whether their shit works
second, it reveals once again that security is about theater
i am and will again today be flying under a garbage name that is not my, nor anyone's, govt name
no one will stop me and no one will care
@eigenrobot
somewhere between making a reservation with Navan and actually getting a ticket with Delta, my middle name was concatenated to my first name
support at Delta conveyed that this is a common and known issue
this tells us several things
@eigenrobot
todays worst tech interaction is between @Navan, @Delta, and @TSA
Navan books trips for work. Delta flies planes. TSA is a government-run theater group whose performance art involves inconveniencing people
@smllwrlds
088 of 365 illustrated tiny sci-fi stories: https://t.co/UiHDLiCS6M
@smllwrlds
087 of 365 illustrated tiny sci-fi stories: https://t.co/LdbJylCToM
@smllwrlds
086 of 365 illustrated tiny sci-fi stories: https://t.co/dqB0DWYopE
@mrled
Every time someone says Q1 I have to ask them if they mean the normal person period ending in March or the insane accounting period ending in June. Dumb
@mrled
If you're going to adopt accounting's incompatible labels for periods of time ("fiscal 2023"), have the decency to not shorthand that into labels that already exislt ("2023"). Especially if e.g. Q1 ends in June etc, maybe call that FQ1 or xQ1 or 💩Q1, don't just say Q1 😠 smh
@mrled
"We’re celebrating a small victory, but the larger story is one of a loss."
https://t.co/BMRt1jWiK8
@smllwrlds
085 of 365 illustrated tiny sci-fi stories: https://t.co/9fl2UEjcT7
@smllwrlds
084 of 365 illustrated tiny sci-fi stories: https://t.co/o3AQJxnPvm
@mrled
RT @patio11: They keep violating Stringer Bell’s dictum on the wisdom of keeping written notes of a criminal conspiracy.
@mrled
RT @dystopiabreaker: if you see an infohazard, share the infohazard. if you're cold, they're cold
@dystopiabreaker
if you see an infohazard, share the infohazard. if you're cold, they're cold
@dystopiabreaker
i have watched this at least 30 times since last weekend. i do not know why https://t.co/6P8OuAcOzl
@patio11
They keep violating Stringer Bell’s dictum on the wisdom of keeping written notes of a criminal conspiracy. https://t.co/fk4obj0mx1
@jaypinho
oh my https://t.co/va2COjixd3
@smllwrlds
083 of 365 illustrated tiny sci-fi stories: https://t.co/9KJer0MtYv
@mrled
What a cool paper. How did Dennis Ritchie Produce his PhD Thesis? A Typographical Mystery (PDF), by David F. Brailsford, Brian W. Kernighan, and William A. Ritchie. https://t.co/X0RUFCyYSE
@mrled
Can't wait for this to slither deep down inside me 😍 https://t.co/VYNVsx9sHh
@smllwrlds
082 of 365 illustrated tiny sci-fi stories: https://t.co/g4zrRprU5Y
@mrled
RT @tallsnail: kubernetes would be a beautiful name for a girl