Lecture 7: Potpourri
--- class: center, middle # Week 7 --- # Announcements * Basic and Advanced 4 due October 18 * Basic, Advanced 5 due October 22 * Basic, Advanced 6 due October 27 --- class: center, middle # Lecture 7: Potpourri --- # Overview * How do computers understand us? * Fields and jobs in EECS * Internships * GNU/Linux experience --- class: center, middle # How do computers understand us? --- ## Quick rundown on comp arch ### Parts * CPU * The star of the show: handles general workloads * Memory (RAM) * Storage (HDD, SSD) * Accelerators * GPU * Motherboard * Connects everything together --- ## How do computers work? * The CPU executes a sequence of instructions in the form of binary * This is known as __machine code__ * The __instruction set architecture__ defines what instructions there are and how they are encoded in binary * Yes, even CPUs have their own languages * Example ISAs: x86-64, ARMv8, RISC-V, MIPS -- * CPUs perform relatively rudimentary operations * Arithmetic: `add`, `sub`, `mul`, `div` * Control: `br`, `jmp` * Memory: `ld`, `st` * (These are generic instruction names) -- * Example operation: "add 5 to variable" * x86-64: `[0x48,0x83,0xc0,0x05]` * AArch64 (ARMv8): `0xe2800005` --- ## How do computers understand us? * Writing a program in machine code with a hex editor is not most people's idea of fun * __Assembly languages__ are human readable representations of machine instructions * x86-64: `add rax, #5` -> `[0x48,0x83,0xc0,0x05]` * AArch64 (ARMv8): `add r0, r0, #5` -> `0xe2800005` * An __assembler__ takes assembly code and turns it into machine code -- * Assembly is still rather cumbersome to use * You're still working with machine instructions * You just now you have a tool that remembers how instructions are encoded * This isn't portable: assembly for one ISA won't work for another --- ## How do computers understand us? * Higher level languages were developed * Raises abstraction level: can think in arithmetic expressions and higher level constructs * Leads to portability since you don't have to worry as much about hardware/ISAs * "Classic" classes * Compiled * Interpreted -- * Things get a bit hazy * Byte-code * Just-in-time (JIT) compilation -- * Keep in mind languages don't necessarily need to fit any one classification --- ### Compiled languages * "Compilation" in general refers to taking the language and producing a lower level form * Compiled languages _usually_ have the source code compiled down to the machine code level * The CPU can directly run this machine code * This is fast * Examples: C, C++, Fortran, Go, Objective-C, Rust, (Java*) --- ### Interpreted languages * These languages _usually_ are read by another program known as an __interpreter__ * This program will parse statements and do something based off of them * This is understandably slow and there are other strategies to improve performance * Examples: Shell, Bash, Python, Ruby --- ### Lines get hazy * Some languages compile down to __byte-code__ that is meant to be efficiently interpreted * Java is a poster child * Some languages have interpreters that do __just-in-time (JIT)__ compilation * Source code is compiled to machine code at runtime * Traditional compilation is known as __ahead-of-time (AOT)__ compilation in contrast -- * Ultimately these aren't really hard classifications * You can compile Python if you want * You can write a C interpreter if you --- ## Running a program * On \*nix systems you can execute both machine code and interpreted programs * Machine code programs are put into file formatted with data pertaining to execution known as an "executable" * The execute permission bit must be set for you to execute a program file -- * Executable file formats have information that can identify their file type * \*nix systems will recognize the shebang (`#!`) on the first line to figure that it's an interpreted program, then call the appropriate interpreter * If there's no shebang, the OS will generally assume it's a shell script * `#!/bin/env python3`: invoke the `/bin/env` executable to find the `python3` executable * `#!/bin/bash`: invoke Bash as the interpreter --- class: center, middle # Questions? --- class: center, middle # Fields and jobs in EECS --- ## EECS is a __very__ broad subject * No wonder when you have EE, CE, and CS all in one acronym * There's a lot of different ways to divy up the space: this is just my conception of it * I'll keep it _computer_-related * Sorry, analog and power EEs * __Not an all-encompassing list__ --- ## Domains ### Computer hardware * Physical design engineer * RTL/ASIC design engineer * Design verification engineer * Computer architect -- ### Hardware-software twilight zone * Embedded systems engineer * Firmware engineer --- ## Domains ### Computer systems * Systems software engineer * Compiler engineer * Embedded software engineer --- ## Domains ### Applications * Desktop software developer 🦕 * Mobile app developer 📱 * Front-end web developer * Back-end web developer * Full-stack developer * Software engineer* * DevOps engineer * Testing/QA engineer --- ## Domains ### Data science * Data analyst * Data engineer * Machine learning engineer ### Other areas * Cybersecurity * Robotics * Scientific computing/simulation * Research --- ## Industries * You can find these jobs in various industries * Tech * Gaming * Finance * Telecommunications * Defense * Government * Health care * and more (you'd be surprised at the opportunities in the restaurant industry) --- ## Internships * Great way to get experience and build up your resume * I learned a lot of my practical skills on the job -- * Job postings will go up during the Fall and early Winter: try to nab them! * That doesn't mean all hope is lost if you're applying in late February/March * I got my internships as a "late" applicant * __It doesn't cost anything to apply, unlike with college applications__ -- * Career fairs are not _the_ only way to apply * You can still find success in online applications -- * Interviews often have a behavioral and technical portion * Behavioral interview will involve questions about you as a person * Technical interview will test your knowledge * Getting an answer wrong on a technical interview isn't the end of the world: often the interviewer is just as interested in your problem-solving process --- ## Internships * If your summer is open, try looking for an internship! * If you have companies in mind, check the job postings on their website * You can use websites like Indeed, Glassdoor, and LinkedIn to browse for jobs and see what's around * You might find something you like based on the description! * [r/cscareerquestions](https://wwww.reddit.com/r/cscareerquestions/) can be a useful place to get some opinions on how the job market is doing --- class: center, middle # Questions? --- class: center, middle # GNU/Linux experience --- ## GNU/Linux experience * GNU/Linux offers a very large degree of freedom in setting up your system * __You__ are in control of your computer * Lots of free alternatives to commonly used software * __Office applications__: LibreOffice * __Note taking__: xournal++ * __Video editing__: Kdenlive * __Photo processing__: darktable * __Art__: Krita, Inkscape * [Fun list (it's for Arch, but gives a sense of what's there)](https://wiki.archlinux.org/index.php/List_of_applications) --- ### Building your own environment * A Linux distribution encompasses a software collection, the Linux kernel, and a particular philosophy * Many distributions come with a lot of stuff and a particular look a feel, but you still hav ethe ability to radically change how they look and operate #### What's most evident is the graphical user interface (GUI); here's some vocab * __Display server__: software that handles the graphics for various client applications * e.g. X11, Wayland * __Window manager__: software that manages control and appearance of windows * e.g. awesome, i3, xmonad * __File manager__: software that presents an interface for managing files * e.g. Nautilus, Dolphin * __Desktop environment__: an all-in-one integrated environment that presents a full desktop experience, integrating a window manager, toolbars, file manager, network management, web browsing, etc. * e.g. GNOME, KDE Plasma, Xfce, LXQt --- ### Putting it together from the ground up * I'll be using virtual machines to illustrate the OS installation process * Virtual machines (in this context) are emulated computer systems * You have virtual CPUs and virtual storage and virtual monitors for your virtual machine * You can install operating systems on them and treat them like any other computer * Fun fact: the course server is running on a virtual machine -- * I'll first install Ubuntu Linux on a VM to illustrate the typical Linux installation process * I'll then install Arch Linux on a VM to illustrate putting together a personalized setup piece by piece * It's relatively quick to install since it doesn't install much in the beginning * While I stan Arch, there's nothing wrong about other distros --- ### Putting it together from the ground up * Installation media * Setting up a VirtualBox VM * OS installation * Ubuntu * Arch * OS setup and customization --- class: center, middle # Questions?