 OK, we're going to try something very strange. I'm going to be presenting on both screens. So this one's recording the audio on the video, and this one's what you see. So who knows how this is going to work. OK, so we're going to start off right where we left off on Friday. So we're talking about compilers, transpilers, and interpreters. And so how do they work? And this is one of those things that this is going to be the driving question behind a lot of the things we do in this class. How do these tools that we use literally almost every day? You're developing some programs. You're going to be interacting with a compiler or an interpreter. And so you need to know how they work. And so we're going to study how do these be just right? A compiler is just a program, just like the programs that you're writing, but slightly more complicated. And on that, they're more complicated. It's a program written by people. So how does it work? And how does it actually translate your high-level intentions into something that a computer can actually understand? And to do this, we need two components. We need theory. So why do we need theory? Anybody a super math person in here? I actually shouldn't raise my hand. I'm not very much a math person. I have a degree. You have to do mathematics. In mathematics? Cool. So why do we study theory? Because nobody else is not a math major. Because if it's not precisely defined, it doesn't work. It's not precisely defined, it doesn't work. What does that remind you of? What happens if you forget one semi-colon in your program? It doesn't compile. Sometimes it will be garbage. So saying you're missing a half your file, missing that one semi-colon. And so the theory enables us and helps us define our limits. It helps us define what can we do and what can we not do? Because we can't do that when we're defining a program language. So why do programming languages look the way they do? How come they're not like English? How come they're not like super easy? Remember struggling with programming? It wasn't that long ago. I remember sitting in my CS 101 class and the professor putting a Hello World Java up on the board. And he had to hand away the way. He was like, OK, ignore all this stuff at the top about all these import who knows what they do. And then ignore this public static void, main string, brackets, rs, who knows what that means. And then here's the line that actually prints out Hello World. Why does it look like that? Why does it look like that? And so the theory helps us define, OK, it helps us describe this is why language looks the way it does and why there are certain rules with languages. So practice. So we're going to be combining theory, describing the limits of what we can do with actual hands-on practice. And this is actually really important. So you may never, I will hopefully not burst your bubble now, you will probably never write your own compiler, especially not from scratch in your career, right, once you want to have some fun. If you want to have fun, absolutely. And it is a good way to have fun. I totally agree. So you may not do that in the course of your work, right? So why study compilers? Because we make you, because you're literally forced to take this class if you want to graduate? No, because you're going to be compilers. And compiler techniques show up in all kinds of areas. For instance, something like an XML parser. A parsing XML uses parsing techniques from compilers. We're developing domain-specific languages. Hey, do you remember? I think it was, I want to say, Ratchet and Clank, one of the early PS2 video games. Yeah, so the way they wrote that game was they wrote the entire game in lists. And they created this domain-specific language to write games in using lists. And that's what the entire game was coded in. So we compiled down all the way these crazy assembly tricks and doing all this register stuff. But at the high level, they created this programming language specifically for programming, Ratchet and Clank. And so there's really good resources on the run to look at that. You may have task-specific compilers if there's some maybe translation you need to do. There was, I can't remember the name of the company. There's been some companies that develop on really old technology, like Visual Basic. They develop their entire company on this Visual Basic app and then they want to move to something like C-Sharp, which is much more modern. But instead of rewriting the whole thing manually and having that take months or years, they develop the compiler to automatically translate from Visual Basic to C-Sharp. And they use that as their starting point in their port. And you can have static analysis or parsing, all these kinds of things you will end up doing and they're gonna all come from the techniques we're gonna talk about in this class. Okay, what is this? Then we're blanking. Is this a program? Yeah. Yes? No? Yes, it is. Is it really? It kinda just looks like text on a string. Yeah, I know what language that is. But you're not gonna let me say that loud, so. No, I'm not. No, but we're talking about what is the programming language, right? So these are just plus signs, angle brackets, square brackets, periods, dashes, right? And so just as it is, it's nothing, it's garbage, right? It doesn't have any meaning unless you say, hey, this is a program we're in a language called BF. And it's actually turned complete and it's as powerful as any other C or Java or Ruby or Rust or whatever you write your language is in. You can do this exact same thing using this language. I can definitely say on the back, I know nothing. I can't write a BF program, so I don't know what this does. But I do know if you write it, it will output Hello World. This is a Hello World BF program. If you want more information, there's a bunch of resources online where you can find BF compilers, you can write your own, and BF interpreters, all this kind of stuff. Oh yeah, I know, that is a program. Okay, I know what language that is. Yeah, so maybe, so there are, I guess in some programming languages maybe an old file would actually compile and be part of the language, but maybe it doesn't make sense. Yeah, but actually. The world's smallest self-replicating program. The world's smallest self-replicating program. You wanna expand on that? When you print it, it outputs itself. Nothing. Ooh. Ha ha ha. It depends on the language. You can find me a language and I'll accept this. It works in C. It will work. It works in C. It works in C? I don't know, it does not have a main function. I don't think it'll work in C. I don't know if I'll accept it. Can somebody try to compile with GCC and wine.cfile and see what it does. If you could run it, that'd be cool. Okay. I know there are white space languages where literally all it is is, yeah. So here I've replaced all the spaces with underscores, all the new lines with slash N and all the tabs with slash T. All right. So this is kind of cool like sci-fi fantasy thing where you think about like you're spying and smuddle this programming language so you hide it in the spaces of a word document or something like that, right? But this is a language that's called white space, the white space language. This is all output, tell the world the spaces. I'm also not an expert in coding white space, so please don't ask. And there are more resources where you can find out more information about this white space language. So what about this? Is this a program? What language could this be written in? Python. Python? Basic. Basic. Basic means print back, you know? Yes, it does. One of the basic papers. No, there's no similar. It's actually QBasic that would work and SmallBasic. No, it wouldn't work in SmallBasic, sorry. So what about, does Ruby have something similar? Yeah. I think you can use frankly too in Ruby, but this I took from Python, right? So you can see, there's a large variation in the exact same program, right? The output of this program, the semantics of this program is the same in this crazy BS language and the white space language in just this simple one line icon program, right? They're all the same. They're all different programming languages. So what about this? It does look like a programming language. Can you recognize it? Anybody need super big on functional programming? It was the super basic Haskell program, right? And then if we look at, what is, so if you think about compiler, right? You want compiler to output something. Well, can't we just say, we don't need programming languages. Those high level programming languages are for, I don't know, not a super cool hardcore people. We want to write our stuff in assembly, right? So this is X8664 assembly to output Hello World. Actually, it's about on the same level of complexity as the original program you were looking at, right? It's only, was it one, two, three, four, five, six, seven, eight, nine, 10, 10 lines or so, maybe 11 or 12, depending on the county label, right? But why don't you want to program this all day? Making large programs would become very, very teaches, as my grandmother would say. Yes, yeah, so why does it become difficult? So what's the key problem here? What do you need to worry about in your programming assembly? Doesn't that be X86 for the MIPS that you studied in school? Registers. Registers, what about registers? Absolutely. Right, so the machine has a fixed number of registers to do and perform computations, right? So you as a programmer need to keep in your head, okay, that variable is now in the RAX register, and then I push that onto the stack and so now RAX is free, but now I want to add something and that's going to put the result into RAX and I need to remember to like save the thing that wasn't there and then store this, right? You need to keep this all in your head. You could write super compact code, right? You get this compared to what a bottom level programming language is, but we're used to, and we know that we get this benefit of abstraction, right? We're thinking at a higher level. We're thinking about variables, right? And what happens to variables? We're not thinking about how those variables translate and which registers those variables are going to be in. We like to kind of deal with that. So, which one of those is a programming language? All of them? What do you think? Kind of like I said, they're all just text in a slide, like you can't actually run those, right? You can't run them. Are only some of them are only like the Python and the Haskell actually programming languages because they're real things that you've heard of whereas this BF and white space are just like completely esoteric and weird programming languages they don't really count. Like what makes them a programming language? But it means like some of that environment where it can run, what else does it need? A compiler? Why does it need a compiler? I have no idea where you are. If it's too great for me, I'm just gonna leave you. Okay, good. Okay. So, say, right, so to take the program, we want something that takes the program that we write. Some right, right? What we write is just text. Just characters in a file. And so, the compiler needs to decide like, is this actually a valid program in this language? Right? And so, I'd say, yeah, they're definitely all programming languages. They all have different, they all have different aspects of usability, right? There's other ways we can think about programming languages, right? Is one of them more usable than the other? Does it offer us different types of abstractions? Do we have to worry about memory management ourselves? Like in C and C++ where we're using a language like Java or Python that does automatic memory management, right? There's a lot of different things here. Okay. So, the overview, so this is kind of where we're gonna go in this course on the things we're gonna study. This is kind of getting into the guide map of how can languages work and what pieces we're gonna study. Right, so what's our input? What are we writing when we write programs in a program language? The characters. Yeah, strings of characters in a file, right? So we have some source file that sits on there. And it's really just what to the computer? It's, well, maybe not ASCII, I mean, I don't know, now we have BTFA and all this crazy nonsense, right? Which is a good thing, preface. Right, but what is this to the computer? Now, can you read in a file? What are you reading in? Bites. Bites, yeah? You're just reading in bytes. So this is really thinking about the black box of our compiler. Bites are coming in, right? Just a sequence of bytes. And then we need something that kind of abstracts those bytes and says, okay, what things are important in our language, and this is the lexer that we'll talk about. And it's gonna output a series of tokens. So we're gonna abstract those bytes and say, aha, these bytes together are the wild keyword. And these bytes together are a number literal. And this byte is a left parentheses and this byte is a right parentheses. So the lexer gives us some kind of higher level abstracting, so we're not worrying about the bytes, right? From the language perspective, a number could be an infinite number of things, right? It could be 10, it could be 100, it could be 1,000, right, a literal number. But to the language, we just care that it's a literal number, right? We don't really care what that exact number is. Then the parser takes all those tokens and asks the question, is this a valid program in this language? So it conducts, constructs a parse tree out of everything. And finally, we then analyze that parse tree to say, is this parse tree semantically valid? Are we trying to add a function with an integer, right? Something that doesn't make sense. How would you do that, right? And finally after that, we have a valid parse tree where we take that and the backend of the compiler translates that parse tree into either an interpretation, or we've done some sort of commutation, in compilation, outputs, and x86 binary. So this is kind of the overall goal of where we're going. So what makes a program valid? How do you know when you've written a valid program in language? Just keep compiling until it says it's good. Sometimes, I move up and like, it's okay, okay. So how do you know? How do you know when a program is valid? It's valid, semantics, and syntax. What does that mean? So basically, the lexer will accept it and the parse tree is valid. Yes, but what does that mean? Why does it accept it? Yeah, correct. So I mean, it's kind of the difference of power time errors or runtime errors. Like if your code compiles, it doesn't mean just doing what you want it to do. Has anybody had their code of crash when they ran it? Those hands are gonna go up to the semester. Yeah. That was, yeah. So in compilation, what makes it different? Why are they different? I mean, it's because on that same point, like, so you wrote a bunch of sorting algorithms, sorting algorithms in 3.10, and we had them where it compiled the different array of integers and it did things with them, but at the end, it didn't sort them properly. So like, it's doing things to them, it's the code's quote unquote working, but it's not doing what we want it to do. Right, so there's this specification in your head, right, of what you want the code to do, right? Some high-level specification. Then there's the nuts and bolts of what actually happened, right? What have you written? So then, going back to the syntax, right? So the syntax describes what does it mean to look like a valid program, right? If I just hit random keys on my keyboard, is that gonna be a valid C program? Depends on the keys. I think you can get away with just a few keys and hitting those at random borders. That would be actually really interesting. But, right, so to try to answer that question, what does it mean to look like a valid program and the semantics, right? Say, what does it mean for a program to be valid, right? How can a program actually be valid? And so some of the things, both of these can happen both at compile time and at runtime. Usually syntax is happening at compile time and semantics, part of it's compile time with types and part of it could be at runtime errors. And then it's correctness, right? Just what we've been talking about. So is the program the correct one for the job? And that could be any number of things, right? You could have, going back to sorting algorithms, right? You can write the best, perfect, works 100%, bubble sort algorithm. And then if you go work at Google and try to use that beautiful perfect algorithm program to sort 100 billion elements, right? It's not the correct one for the job because it's inefficient. It's not gonna be ever be able to finish. So even though it's correct, in some sense, it's not the correct one for the job. Any questions on this? Cool. All right, so let's finish. And now we'll get into, okay, there's something I noticed from teaching 340 that I figured that I learned from teaching 340 is there is a lot of programming in this course, a lot of practical practice. We're gonna talk about some security things, but a lot of what you're gonna be doing on your own in the projects is programming. And so I kind of came up with, what are some like essential programming skills that maybe they don't teach you during the course of your academic career? And I kind of looked back and said, okay, what do I wish I had done my fraction year, my sophomore year that I didn't do until I got a real job, right? And I can help you and get through it. So the one thing I hope you've learned this, constant learning, it wasn't gonna be constantly learning. Looking stuff up on Stack Overflow. Looking stuff up, yeah. And it's not just looking stuff up. Do you just read the first thing on Stack Overflow and then do whatever it says? No, it never works. So you have to read the comments on that first entry on Stack Overflow. Then you have to read the second entry because maybe that was better than the first one and read the comments on that, right? So you have to constantly be seeking out and interpreting and understanding different sorts of information and being able to differentiate, huh, did I learn this from a super respected person on Stack Overflow versus like some blog that could be garbage, right? So not all sources of information on the internet are equally valid and I hope this is not the first time you're hearing that fact. I get all my information off Wikipedia. Wikipedia, yeah. It's not terrible. Yeah, so searching, right? So what happens? So you get a compile error or you get something you've never seen. What do you do? Do you email me? I mean, you can. It was not an effective use of your word on my time. Right? So what do you do? Google, yeah, you Google it, right? And don't feel like this is somehow a source of weakness or like, I don't know, you feel bad because you're Googling things can do this all the time. Like, you know, you have some error and you're like, huh, what does that mean? You look it up. The time that you can terrify is if there's zero results, right? Oftentimes that means you just kept a file in there or a file name that's unique to you, right? So if you remove that, then maybe you'll get some results, right? But still, you want to Google for errors? The other thing, if this is something I really didn't come to learn until even now in the last couple of years is I'm getting much better about actually, instead of going to Stack Overflow first, I'll go to the documentation. Like, when I have a problem with Python, I'm gonna go check out the module that I'm using first to try to understand how should I be using this function or this object. And so finding the documentation for your programming language, how do you search for errors? How do you search for the documentations for like C and C++? C++.com, yeah, good resource. It's actually one of all your Linux machines, the man command, the manual. So you can type in man in the name of libc function and it will show you awesomely everything that you need for that. Maybe if I have time, I'll try to show you but it's kind of hard on the Windows machine, but we'll see. Right, so not only finding documentation, but navigating documentation, right? So how do you go from one topic to the other? How is your programming language's documentation structured? Cause they seem silly, but it actually can be a lot faster to go right to the documentation than go to Google, reading. Everyone know how to read? Step one. Step two is actually applying that, understanding what you're reading, right? Interpreting what you're reading. We talk about going on blog posts. I remember back when Ruby on Rails first came out, it was changing constantly, every on six months or something. So when you're Googling for an error message or how do I do this in Ruby on Rails, you have to always check that blog post page because it could be talking about a completely different version and everything that is irrelevant. So this is part of being reading, interpreting information, but contextualizing it in your head and saying, when was this written? Is this useful to me and my problem? Man pages, so this is the man page that I was talking about. You can go man, it's a good man print app that you've never used print app before. Or you don't know about free or not, you do man, how, write your terminal, shows up all beautiful, tells you everything you need to know. And actually a lot of the stuff on c++.com or some of the other resources are taken from the man pages. It's beautiful, it's right there in your computer. You don't need to go and make a web request, have to deal with ASU's wifi, right? It just works, right there. Okay, documentation, being able to read documentation and being able to read specifications, right? What should your program do? And this is something you're definitely gonna get in this class, right? We're gonna give you the specification for your project. Here's the input, here's the output, here's what it's gotta look like. And you have to read these and understand these. So reading and even, I always start the projects early, start the projects early. Oftentimes, whatever. Read the projects early, right? If you read it the first day it's out, it can process in the back of your brain. So you go, anyway, but what if this thing is null or what if there's no non-terminals in this grammar? How would that change things, right? So you gotta find the corner cases and everything from the specifications. Questions on this? This is something you have to do forever. I mean constant learning is, this is just kind of about learning as you're doing things, but you cannot stay alive in the technology field without constantly getting on top of new things and learning and accumulating more information. Although as I say that, there is, I think, one of the highest paying jobs is like a cobalt programmer. Because nobody knows cobalt and they have these huge mainframes that do banking systems and all these really important things that are all in cobalt. But if you wanna go that route, I'm sure it's open to you, but I will not just try it. Does anybody have a program, cobalt? A little bit? Okay, this is gonna be one that's a little weird, but stick with me. Touch type name, what does it mean? If I'm even not looking, can you do that? It's a rhetorical question. I appreciate your enthusiasm, right? So you should be able to type without looking and I guess I'm just having to argue right there because I have to talk in type. So why is this important? So I'll tell you personally from me. So I was basically always on the computer as a kid probably some of you. And so I kind of developed what I thought was really cool, like a compact method where I kind of figured out the keys and I could like type pretty fast, but I still kind of had to look and I would cross over a lot and I thought it was really cool. And then I got to have a Microsoft and I had to leave a meeting and we were triaging bugs. It was like a room full of people, you're driving everything. So they're watching you type. And it's kind of hard to type when, you know, 10 people, your colleagues are looking at you and then I realized, oh man, I really need to learn how to actually type with home row and like actually effectively do this. And so I started spending like a half hour a day at Microsoft doing this. And now I'm so much better. Like now I'm actually faster than I was before where I thought I was faster. But why is this important? So yes, it's cool to show off in a meeting that you can do this, but why else? How you close are 99% of the bugs in your software. How you close are a lot of bugs. Yes, I would not. I definitely agree with that. I've been guilty of that. You'll see some of these slides too. Yeah. You'll be typing at least millions of characters so maybe we'll do it fast. Yeah, right? So, right, you come up with an idea in your head and try to encode something. How you test that idea in your head is the right thing. You type it out and then what do you do? You look at it and then what? Yeah, you compile and run it. See if you compile, see if it runs, right? And then if it's wrong, you go back to the thinking stage and then you go back to writing, the looking, kind of the looking action, that's really cool. Well, I'm not sure if we can maybe type without actually looking at what they typed. That would be kind of interesting. Anyway, so you have this cycle, right? And so the tighter and smaller you can make that cycle, the more efficient you're gonna be as a programmer, right? The quicker you can go from your ideas to testing if they work or not, the better, more effective programmer that you're going to be. And it's one of those things that it's little things, right? These are the little things that they add up over time. And this is why especially I'm telling you about this is because I really wish I had actually done touch typing as like a freshman. I would be so much more happier, like my college experience was a much better. I wouldn't be like typing my thing about like a lot of the pointer, like star, x equals whatever, I would just do it without thinking about typing it, right? You want to be thinking about the high level challenges not putting your fingers to the keyboard part. So this is my, I don't know, I used a, this is not working, okay. I used a thing, this is how I worked for a minute. I was able to type at one point last year. I don't know if this is even valid, but it's super helpful, right? And this especially for me now because I do a lot of writing. When you write you also want to be able to type quickly. So spend time invest in you and yourself typing, actually typing. Okay. Editors, what do I mean by editors? These are people you hire to proofread your manuscripts. IDE, well one of those letters stands for editor. Shouldn't be too hard to figure out what you want. What is it? What is it type? What was that? It's where you type. Where you type? Yeah, it's the program that you interact with which I'm saying is whatever you're typing into a file which is what you pass to the compiler, right? Why is an editor important? Or editing, yes. Miss Bellens. So that's, so an editor I will say can help in some of those ways, definitely. If you use like it's an IDE integrated development, oh I can still type for editor, environment. And so the IDE is like continuously compiling your code and it will show you errors as you type. Maybe it has some sort of feature in there where it's auto-completes where you're typing which can be useful when you're coding against really, really heavy or large APIs that you're not very sure of what they do. But I'll say I don't really advocate starting out with IDEs or I honestly don't think they're 100% necessary. Although I've definitely used them in my career. But why is an editor, so they are important, so why are they important? It makes you more efficient. It makes you more efficient, how so? Yeah, right? So your editor is your main instrument you use to crack the program and the cracked code, right? This, you are craftspeople. You are making software, right? And so would you want, I don't know. Anybody got a chef in the room? Like what are some important tools to a chef? Chef knife. A knife, yeah exactly, right? Chefs want to use the best knife possible. Would you want your chef to use some nice thing down at the garbage that's like all janky and rusted? And like have to chop things and it takes them like a minute to chop the carrot? No, you want to use the best freaking knife that's super clean, that's the whole other thing. But they want to use the best knives possible, right? Just like, anybody work on a car or a mechanic or something like that? Kind of. Yeah, you want to use like the best wrenches as the best tools, right? You want to use the appropriate, you're not going to use, this is why the cans have a bunch of tools because not all of them are useful in all scenarios, right? So, but they don't use the best, they don't use the crappy wrench that's going to break when they're under the car and the wrench is going to snap in half and dig up their knuckles, right? They want to use the good tools that are going to break. Bakers, right? They want to use the best ovens. They want to use ovens where they set it to 400 degrees and it's 400 degrees and not 410 or 425, right? Because this stuff is really important. This is just like them. I mean, just like them, you need to be thinking about your tools and how you can use them and how you can use them to be the most effective programmer, computer scientist that you could be. And not only this, not only do they know their tools and try to use the best, I'm not saying you should go out and buy whatever somebody says is the best editor, but whatever tools they use, they know their needs and outs. They know the best times to use, I don't know, tool X over tool Y. I'm not really into these things, so it's hard for me to talk about them, but, you know, there's knives, some knives are better for when you're butchering things, some knives are better for shopping. I don't know, there's all these kinds of stuff, right? So you want to use the best tool for the job. So, I'll say this, invest time in learning your editor, time spent learning your editor, learning the shortcuts, right? Are really important. And so, why is learning the shortcuts important? And it's easily summed up in this title. Your mouse is evil. I guess a lot of your black ops, I should admit this, your mouse and track pad are evil. Every time you have to switch your hands from that beautiful, amazing home row of super efficient to the mouse, you're losing precious seconds of your life that you're never gonna get back. And I can prove it. So, in human-computer interfaces, there is a, they call it the keystone level model, so there's different models of how people use software so that they can try to see what's more efficient. So this model's how fast different user actions are, and they created these models based on actual human data of people using systems. So they said, okay, how fast is it to press a key? So if you're a fast typist, it can take you 0.08 seconds per character to type. It's pretty fast, right? You can type a lot of characters. Even as average typist to a slow typist, right? 0.28 versus 1.2 characters per second. In the same model, doing studies of how long do you take it to just, this is one way, to move your hands from the keyboard to the mouse? Just doing that, 0.4 seconds? So, but do you just move your hand? This is a mechanical movement of hand to mouse. But then what do you have to do? Get the point, you have to point the cursor using, you don't even think about it anymore, right? It's so ingrained in you. You have to point that cursor using your hands. You have to say the name and like, mimic this, because it's like weird. And I'm also going up, it's a freaking mouse. So like, you're moving your hand to point it to something. So you have to point the mouse, which can be 0.8 to 1.1 seconds. You have to click, which is about the same as a keystroke, right? And then you have to move your hand back to the keyboard after you're done. Which is another 0.4 seconds. So using a mouse, you have to move the keyboard from the keyboard, somebody's phone. Okay. So you first have to move your hands from the keyboard to the mouse for 0.4 seconds. You then need to point the mouse at something, average is 1.1 seconds. You need to press the left mouse button. Then you need to point the mouse maybe at something else. So this would be like, selecting something from a dialogue box, right? You have to first move it up there, get the click, then you have to move it to the next item and click. So this would be something from a menu, right? And then you're going to move your hands back to the keyboard. So this would be selecting maybe like copy from the menu. Total 2.82 seconds. So in 2.82 seconds, if you were a super fast cyclist, you could type 35.25 characters, right? That's largely more shortcuts in that time, right? More a lot of code. And you know, the slower typist you are, the least nine keys. But even in this worst case of a super slow typist who's taking literally like one second, two seconds to type keys. A command C, right, for copy, that's about at the same time it'll take you to select it from the menu. A little bit less. And the better your typing improves, the more effective and efficient you're going to be when developing this, when doing this. And so you're saying this, it seems crazy, right? Like why did I care about 1.2 seconds, right? It was two seconds, eight, day in, day out, day in, day out, right? Two seconds every time you do something, multiply that by a year in your life, by your 30 year, 40 year career, and it starts to add up to a lot of time saved. Your mouse is evil. Okay, so for editors, so this is one of the suggestions. I suggest learning either Vim or Emacs. Really? And you know, these are all kinds of preferences. I'm not going to get into an editor war. I want to get rewards on the mailing list. These are just my suggestions, because I've seen people be very effective and very efficient in this various editors. Vim is great. It's installed everywhere. It has a dual mode, where you have an ending mode or command mode. You can look up, there's great cheat sheets and tutorials, all these kind of things on Vim that can get you started. I personally use Emacs. I love it because it's highly extensible, so you can completely customize it. So Emacs is written in a dialect of list called Emacs list. And so you can configure any part of the editor by using these Emacs list snippets. It's like my .emacs file is huge. It's got all these snippets I've got over the years of happy words and files, and I don't know, doing all these kind of customizations that I want. It has what I call single mode endings. You're always editing, so any command keys use the control key or the command key on the Mac. And or whatever. I mean, as long as you're efficient, right? As long as you take the time to write it, I have people that use TextMate, Visual Studio. Like when I, you know, and it's about using the right tool for the job. Like when I was at Microsoft, I was using Visual Studio because I was coding C sharp. I tried to use, I had like an Emacs mode so the key bindings were the same. That was not very great. But still, every once in a while, I'd get into cases where I was editing this huge XML document. I was like, no, it's taking a while this time for me to do this Emacs. So I did an Emacs and it was faster. So I just go back and forth using whatever tools are more useful. Questions, editors? Comments, suggestions for sweet editors? Definitely something with more like undos than notepads, please. Something that kills me when people come to my office with problems. Although maybe I'm not, but those tend to notepad have unlimited undos now, so maybe it's not. I'm carving on like Windows XP, don't that? Okay, so these are just some tutorials, some quick Emacs tips from me. I wanted to show you like an example of how efficient you could be with macros and other cool stuff with Emacs. Unfortunately, I could do that but you're not gonna be able to see it, so not really useful. I map on every single machine I use. I map caps lock to control as Emacs that way. So the controller right, it's all the way down here, so you gotta like bend your pinky, but the caps lock is very nice to it. The side effect of this is you never really, it's not easy to flame anybody in all caps. So I don't know if you do that or you should A, stop, but B, then you do this, then not do it. Emacs macros are a really great reason all the time to do any research projects of like manipulating or changing data from one format to the other. If you have a CSV file, you want it to be in a LaTac table or something, I can do a macro very quickly on the fly that a lot of people do that. I've done all kinds of translation things. So there's also, Vim is awesome too, don't get me wrong. You just kinda gotta pick one, stick with it, and then never change. They've been around for like 25, 30 years, like longer than probably people in this room, let's just say, right? So that's kinda cool, they're pretty well tested. Okay, the command line. So another point of efficiency, right, is using the command lines. What do I mean by the command line? Can you say it a latter name? Understanding commands. Understanding commands, yeah. So when you open on your CentOS, there's the terminal, right, and the drop down menu on other devices, it's other types of things, right? Being effective at the Unix command line and batch and all that stuff will be, pay so much dividends. So it's really an amazing tool for, especially for command composition. So it's kinda thinking more long term, but when you are, oh, wait a minute, I don't know what you're talking about, cool. Okay, yeah, so by command composition, you can use the type character, type the output of one program to the input of the other, and you can create a series of crazy things that do all sorts of stuff. So I've used this for crawling the internet, it's spit out a bunch of URLs and then those URLs get transformed and turned into HTML and then find and store them in database or something. This makes it really easy. Output redirection, so you can store your output to a file which is awesome with the redirects. So these are all things you can look up, right? Constant learning, you can go Unix, output redirection, Linux, output redirection, Linux command composition, and you can get pointers to all these things. You can have things run in the background, you can sleep certain tasks, certain targets. You know, Wikipedia is good, there's awesome like command line foo which has this great series of one line command line things to do certain cool stuff. Okay, debuggers, debuggers are very important. So does anybody use debuggers? Okay, okay, that's actually more hands on top, great. You should get comfortable with them, you're gonna be comfortable with them in this class, I guarantee it, we can have crazy pointer errors. It's often difficult to just look at the program and understand what's happening. So debuggers let you inspect a running process to find out what went wrong, right? You think of it like the engine of a car if you're just able to say like, no, what's that strange sound? They caused the engine in one state to be able to pull it apart magically and look at where the state of everything, right? That's what you can do with debuggers, it's really awesome. It's also really useful for prototyping, so when I'm kind of like quickly developing something, I try to like evaluate functions, like just write a function at a time to write a function, test it maybe in a debugger to see what it does. Different debuggers have different facilities for this. So for Python, ifython is amazing for evaluating functions and coding things at runtime. GB is the command line debugger for Linux. It is primitive, but it's pretty awesome. And it's actually what all of like Eclipse, is it NetThings is the other one? They all use basically GDV underneath with a nice graphical interface. So GDV is something that's really useful to get into. And knowing when do I want to use a debugger versus when do I not want to use a debugger and just use print devs, right? Sometimes it is a lot easier to use a print dev, right? Ever know print dev debugging means? There's output, basically a log of what's going on from there, you're trying to infer what the problem was. It's not gonna be useful. Okay, some advanced topics that I'll just give you a point just a later. Back scripting, so you can automate frequently run tasks. So it'll be giving you some back scripts to test your code. Also useful to write your own of how to write back scripts to automate things if you do them a lot. Customizing your editor, so you gotta think about we have a really cool benefit, right? We are programmers. The tools that we use are code and programs. So we're in a unique position to be able to shape our tools to best suit us, right? And so this is something we should definitely take advantage of and this is why we're like Emacs, because you have to do whatever I want to do. Version control. Every semester, most of it gets emails about people who have lost their projects on their machine, their hardware failed, whatever. And he does have the copies, but it is a huge pain. You should just not ever put yourself in this situation. Use some sort of version control, some sort of backup. I don't care because the GitHub student packs that we talked about, use GitHub, make sure your repository is private like we talked about. Use subversion, use whatever. So you can go back, I mean, I've seen some code where some people just make different copies of the functions and keep them all in their program. It's like function A underscored good, function A underscored bad, function A underscored really bad. And so when they're scrolling through it, that's a lot of lower head, right? So your version control system is great because you can go throughout time and say, what was that thing that I had last week? And you can maybe use that function and it's useful for you and you never leave that. Unit test, testing your code, this is something we're doing in this class with the first project and with that. Thanks for listening to me. We're gonna start with Lexar's syntax analysis on Wednesday.