CS 101: 코딩 소개
목차
Introduction
Assemblers translate assembly language to machine code
Grace Hopper
The launch of the high-level language
Compilers and interpreters
The Compiler
The Interpreter
The need for translators
컴퓨터는 정확한 명령이 필요합니다
Computers require precise, clear instructions, yet they can only understand one language: machine language (0s and 1s). The Central Processing Unit of a computer is capable of immediately executing instructions written in machine language (CPU).
Originally, just machine code was used to create programs. Prior to being carried out, each command was manually typed. This was aided by the use of operation code (opcode) tables, although it required a lot of work.
프로그래머는 작업을 더 빠르게 진행하기 위해 어셈블리 언어를 만들었습니다. 피연산자를 니모닉과 결합하여 명령을 생성함으로써 opcode를 읽기 쉽게 만들었습니다. 모든 어셈블리 언어 단어에 대해 한 줄의 기계 코드와 비슷했습니다.
어셈블러는 어셈블리 언어를 기계 코드로 변환합니다.
This was great for the programmers, but the computers still couldn’t understand the instructions. Assemblers were created to automatically translate the assembly language into machine code.
Assembly language and machine code are low-level languages. Each line of assembly language is equivalent to one line of machine code. The code is specific to the CPU that it is written for.
그레이스 호퍼
어셈블리 언어는 곧 너무 많은 시간이 소요되었습니다. 읽기, 디버깅 및 유지 관리가 어려웠습니다. 평범한 영어가 필요했습니다. Grace Hopper는 "데이터 프로세서는 프로그램을 영어로 작성할 수 있어야 하며 컴퓨터는 이를 기계 코드로 변환할 것"이라고 말했습니다. [ 1 ]
Grace Hopper는 일반 영어 코드를 기계 코드로 변환할 수 있는 컴파일러를 만드는 아이디어를 구상했습니다. 사람들이 "컴퓨터는 산술만 할 수 있다"고 믿었기 때문에 그녀의 작업이 진지하게 받아들여지기까지 3년이 걸렸습니다. [2]
고급 언어의 출시
Fortran and COBOL were created as the first high-level languages. They allowed programmers to write programs in formal, structured English. High-level languages made it easier to read, maintain, and debug code. As a result, programming computers became more suited to a wider audience.
mov edx, DWORD PTR [rbp-0x4]
mov edx, DWORD PTR [rbp-0x8]
add eax, edx
mov DWORD PTR [rbp-0xc], eax
These high-level languages could write one line of ‘formal, structured English’ code that would then be translated to dozens of lines of machine code. Here is the code from earlier written in the programming language, C
int c = a+b;
This line of code is four lines long in assembly language, and four lines long in machine code.
100010110101010111111100
100010110100101111111000
111010000
100010010100010111110100
컴파일러 및 인터프리터
High-level languages can be translated using a compiler or an interpreter. A compiler will create a single, executable file that can then be run without the original source code. An interpreter will run the source code one line at a time and doesn’t create an executable file. The interpreter is needed every time you run the code.
Imagine that you have been given a cake recipe that has been written in a language that you don’t understand. To help you follow the recipe, you are going to need to translate the instructions.
컴파일러
Your first option is to compile those instructions. This means that you can create a fully translated version of the recipe that you can use whenever you need to.
This might take some time, but once created, you would no longer need the original recipe and it would be much quicker to follow it each time. You could even easily share your translated recipe with other friends who speak the same language.
통역사
Your second option is to have an interpreter follow the recipe with you. The interpreter would translate each line of the recipe individually whilst you bake your cake. This would be quick to do initially, but you would always need an interpreter when you wanted to follow that recipe.
Also, if you wanted to share the recipe with your friends, then they would also need an interpreter to follow the recipe.
인터프리터와 컴파일러는 형식적이고 구조화된 영어로 프로그램을 작성하고 번역할 수 있게 해주기 때문에 프로그래머에게 필요합니다.
번역가의 필요성
High-level languages only exist because of translators. Without translators, our only option would be to write in machine code. High-level languages made programming more accessible to a wider audience.
References:
[1]: Quote from wikipedia. Original quote from: "The Woman Who Spoke to Computers". The Attic. Retrieved July 31, 2019.
[2]: Quote from Wikipedia. Original quote from: "The Wit and Wisdom of Grace Hopper"
Reference
이 문제에 관하여(CS 101: 코딩 소개), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/teach_wizbits/cs-101-introduction-to-coding-361i텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)