Help cover our costs - any amount welcome
The Squidbot Speaks!
Tentacly Goodness

The Squidbot's tentacles stretch wide across the web. Follow us.

Search
« Squidpod 018 - Remix and Regret | Main | Squidpod 016 - Robophobia, Part 2 - Camp Indigo »

Squidpod 017 - Pop and Push

In this fortnight's Squidpod, Formal Language Theory is child's play! 

With thanks to Corsica_S for sound effects.

Pop and Push

by Dave Cochran

@talkymeat

Published under a Creative Commons Attribution NonCommercial ShareAlike 3.0 Unported Licence

MP3 PDF and ebook versions coming soon!

 

Hello everyone! It’s a busy day today in The Big Compiler! Shall we see what Pop and Push are doing?

Hello Pop!

Pop: Hewo!

Hello Push!

Push: Urro!

My goodness, Pop and Push, you’ve got a lot of tokens to parse today!

Pop and Push (together): Uh-huh!

But where’s the Finite Controller?

Pop: Ummmm…

Push: We don’t know.

Pop: He went away.

Push: We think he’s cross with us.

Pop, Push, why would the Finite Controller be cross with you?

Push: Uhhhh…

Pop: We were arguing.

With the Finite Controller?

Push: N-no.

With each other?

Pop: Y-yeah.

Push: She kept popping symbols off the stack that I had just pushed on!

Pop: Yeah, well he kept pushing symbols onto the stack when I had just popped symbols off!

But Pop, Push is meant to push symbols onto the stack, and Push, Pop is meant to Pop them off!

Pop: But Push kept pushing on symbols, even when he wasn’t supposed to!

Push: But I just love pushing symbols onto the stack! I love it when the stack gets really really tall! Anyway, Pop kept popping symbols when she wasn’t supposed to!

Pop: But popping symbols is so much fun! I like the sound they make when they go POP!

Pop … Push … you know you’re only supposed to pop and push symbols when the Finite Controller tells you. Push, if the stack gets too big, you’ll get a Stack Overflow! And if there are still symbols on the stack when you get to end of the Token String, you get a “symbol found when end of expression expected” error.

Push: Awww.

And Pop, if you empty the stack before you get to the end of the Token Stream, you get a “end of expression found when symbol expected” error!

Pop: Awww. Are errors bad?

Well, do you know where the Token Stream comes from?

Push: Yyyy-no.

Pop: Oh! Oh! I do! The Lexer’s house is just up the hill from ours. They get a stream of characters - like, numbers and letters and things, and they make them into Tokens - that’s like, while, and if and then and Variables and Integers and String Literals, and - and - and all of that stuff, and they put them on the stream to float down to us.

That’s right Pop, but where do they get the characters from?

Push: I know! They come from the Text Editor! There are a few different Text Editors. Vim is the best one.

Pop: No it’s not! It’s Emacs!

Push: Vim!

Pop: Emacs!

Push: Vim!

Pop: Emacs!

Pop, Push, please stop arguing.

Pop & Push, together: OK.

Right, but do you know where the characters come from?

Pop: Ummm … outer space?

Push: The sea?

Pop: Giraffes?

Push: France?

Pop: A wizard?

No Pop, not a wizard, exactly. A programmer.

Pop & Push: Ohhhh.

So the programmer writes code in a programming language, which humans can understand, and the Big Compiler turns it into machine code that the computer can understand.

Push: But … why can’t the programmer just write in a human language?

Well Push, human languages can be really messy. Too messy for computers! That’s why we use programming languages - everything’s much more tidy. But that means the code was to be written just right to work. One way it can be wrong is if things are written in the wrong order. That’s why, here in the Parser House, you and Pop and the Finite Controller check to see if everything’s in the right order.

Pop & Push: Ohhhh.

Those error messages are supposed to come if something’s wrong with the code. Then it’s helpful because it shows the programmer where she went wrong. But if they come just because you two are messing about…

Pop & Push: OHHHHH!

Pop: We’re sorry.

Push: Yeah.

OK. Maybe we should find the Finite Controller.

Pop: OK … but is it really important that we pop and push symbols on the Stack.

Push: Of course it is, Pop. Without us on the stack, the Finite Controller would just be a Nondeterministic Finite Automaton. He wouldn’t be able to process a Context-Free Grammar like … like … like … like … hahaHAha … ohhhhh Christ on a fucking bike.

Pop: What’s wrong, Ed?

Producer: CUT! Take a break people. Edwin, take a walk round the block and sort your fucking head out. You were doing great there! If you can just keep your head together for this and the next three scenes we can all be down the pub by six. God.

Pop: Christ, why does Will have to be such an arsehole.

Push: Gnnnn.

Pop: Come on, Ed, talk to me.

Push: You know I have a degree in computer science, right?

Pop: Yeah, me too.

Push: I thought I was gonna work for fucking Google, or Apple or Adafruit or something! Or that by thirty, I’d have a string of startups behind me, including the one that made me a billionaire!

Pop: Right.

Push: What I hadn’t counted on was in a couple of decades every fucking schoolkid knowing more than I did!  And now, the only job it qualifies me for if wobbling around cyberpunk teletubby-land wearing a giant purple fucking foam rubber robot head, showing preschoolers the value of friendship and co-operation and shit, and the operation of Push-Down Automata!

Pop: I hear ya, Ed. But look, isn’t this what we always wanted? The world got smarter.

Push: I know, I know. But I guess I just hoped I’d get smarter with it.

Pop: Tough tits, mate. Doesn’t work that way. Genetic modulation and all.

Push: <groans>

Pop: But look, it’s OK.

Push: How d’you mean?

Pop: Well, if the young’uns understand the world so much better than we do, then that means they can have responsibility for it.

Push: Yeah?

Pop: …which means we get to goof off for a bit. We get to leave them to it, while we skive off and smoke weed round the back of the studio.

Push: Like, right now?

Pop: Mmmmm…yes. I’ve got some in my bag

Push: Actually, that sounds really good.

Camera 1: You guys know I’m still recording, right?

Push: Oh shit.

Pop: Guy, please don’t let Will see this.

Camera 1: Fuck that shit. This shit is going on Facebook.

Push: No no no. Bad idea.

Pop: Dude, you could get the show cancelled like that. Just delete the file.

Camera 1: Oh, all right.

Push: Wait! Send me the file first.

Pop: WHAT?

Push: Don’t worry. I’m not gonna release it. Not right away, anyway. Give it, say, fifteen years, until all the kids who grew up watching Pop and Push are in uni. Then I’ll release it. It’s a little bit of career insurance.

Pop: Nice. Pop and Push: Too Wild For TV. It’ll go straight to the top of Youtube.

Push: Yesss!

Pop: Fancy a fuck?

Push: Bwha- uh -um…

Pop: Aaahahaha! The look on your face is priceless, mate. Come on. Let’s go get stoned.

Push: You know, I think I just learnt the true meaning of friendship.

Pop: Nice. You got Rizlas?

Push: King size.

Pop: Awesome.

 

 

Squidpod 017 - Pop and Push

References (2)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    RobotSquid - The Squidpod - Fortnightly Short Science Fiction - Squidpod 017 - Pop and Push
  • Response
    RobotSquid - The Squidpod - Fortnightly Short Science Fiction - Squidpod 017 - Pop and Push

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>