반응형
Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
05-19 04:57
관리 메뉴

ImJay

프로그래밍언어론 02장 문제풀이 (Concepts of programming languages chapter 2) 본문

대학생활/프로그래밍언어론

프로그래밍언어론 02장 문제풀이 (Concepts of programming languages chapter 2)

ImJay 2022. 4. 4. 00:06
반응형

Programming Language Assignment #2


1.    Write a short history of the Fortran 0, Fortran I, Fortran II and Fortran IV systems

 

Fortran 0: In November 1954, John Backus of IBM and his group produced a report entitled “The IBM Mathematical FORmula TRANslating System: Fortran” (IBM, 1954). This document describes the first version of Fortran before its implementation. This document also boldly states that Fortran will provide both the efficiency of directly coded programs and the ease of programming of an interpretive pseudo-code system.

Fortran I: A compiler was released in April 1957 with modifications during the implementation of Fortran 0, and its implementation language (Fortran I) is described in the first Fortran Programmer's Reference Manual published in October 1956 ( IBM, 1956). Fortran I included input and output formatting, variable names limited to up to six characters, user-defined subroutines, an If statement, and a Do loop statement.

Fortran II: The Fortran II compiler was released in the spring of 1958. It fixed many bugs included in the Fortran I compilation system, and added some important features to the language, most importantly the ability to compile subroutines independently.

Fortran IV: Fortran IV became one of the most widely used programming languages ​of its time. The language was developed between 1960 and 1962 and was standardized as Fortran 66. Fortran IV is an improvement over Fortran II in several ways. Among the most important additions were explicit type declarations for variables, logical If statements, and the ability to pass subprograms as parameters to other subprograms.

 

Fortran 0 : 195411월에 IBMJohn Backus와 그의 그룹은 “The IBM Mathematical FORmula TRANslating System: Fortran” (IBM, 1954)의 타이틀을 갖는 보고서를 생성하였다. 이 문서는 Fortran의 첫 번째 버전을 그 구현 전에 서술하였다. 또한 이 문서는 Fortran이 직접 코딩 된 프로그램의 효율성과 해석적인 의사 코드 시스템이 갖는 프로그램의 용이성을 모두 제공할 것이라고 대담하게 기술하였다.

 

Fortran I : Fortran 0의 구현 기간 동안 수정을 통해 19574월에 컴파일러가 발표되었고, 그 구현된 언어(Fortran I)195610월에 출판된 첫 번째 Fortran 프로그래머의 참고 매뉴얼에 기술되어 있다(IBM, 1956). Fortran I은 입출력 형식화, 최대 여섯 글자로 제한된 변수 이름, 사용자-정의 서브루틴들, If 선택문, 그리고 Do 루프문을 포함했다.

 

Fortran II : Fortran II 컴파일러는 1958년 봄에 배포되었다. 이것은 Fortran I 컴파일 시스템에 포함된 많은 버그를 수정하였고, 그 언어에 몇 가지 중요한 특징들을 추가했는데, 가장 중요한 것은 서브루틴들의 독립적인 컴파일 기능이었다.

 

Fortran IV : Fortran IV는 그 당시에 가장 널리 사용된 프로그래밍 언어들 중의 하나가 되었다. 이 언어는 1960년에서 1962년 사이에 발전되었으며, Fortran 66으로 표준화 되었다. Fortran IVFortran II에 비해 여러 면에서 향상되었다. 그 가장 중요한 추가 가운데는 변수에 대한 명시적 타입 선언, 논리 If , 그리고 부프로그램을 매개변수로서 다른 부프로그램에 전달할 수 있는 능력 등이 있었다.

 

2.    Describe in detail the two most important reasons, in your opinion, why Speedcoding did not become a very widely used language.

 

The reason speedcoding has not become a popular language is that, although the effort to write a lot of work has been significantly reduced, the execution time of programs written with Speedcoding is typically 10 to 20 times slower than the execution time of machine code. Also, because of the excessively large memory interpreter, after the interpreter was loaded, only 700 words remained available, and Speedcoding's interpreter occupied 30% of the IBM 701's available memory. The drawbacks of Speedcoding's slow execution speed and the interpreter's too much memory occupancy are that speedcoding was not widely spread and I think it was enough to be replaced by other languages.

 

스피드코딩이 대중적인 언어가 되지 못했던 이유는 비록 많은 작업을 작성하는 노력을 상당히 줄였지만, Speedcoding을 통해 작성된 프로그램의 실행 시간은 일반적으로 기계 코드의 실행 시간의 10~20배 정도 느렸기 때문입니다. 또한, 지나치게 메모리가 컸던 인터프리터 탓에 인터프리터가 적재된 후 남아 있는 사용 가능한 메모리는 단지 700워드였으며, Speedcoding의 인터프리터는 IBM 701의 사용 가능한 메모리의 30%나 차지했기 때문입니다. Speedcoding의 느린 실행 속도와 인터프리터의 너무 많은 메모리 차지라는 단점은 speedcoding이 널리 퍼지지 못하고 다른 언어들로 대체되기 충분했다고 생각합니다.

 

3.    Why, in your opinion, did Fortran allow names that begin with I, J, K, L, M and N as implicitly integer type?

 

This is because the Fortran I language did not have data type statements. Therefore, to distinguish data types, the implicit convention was that variables whose names start with I, J, K, L, M, and N are integer types, and that all other variables are implicitly floating-point types. It is said that the choice of letters for this convention was based on the fact that scientists and engineers at the time used letters as variable subscripts.

 

Fortran I 언어에는 데이터 타입 문장이 없었기 때문입니다. 그렇기 때문에 데이터 타입을 구분하기 위하여 이름이 I, J, K, L, M, N으로 시작되는 변수는 정수 타입이고, 다른 모든 변수는 묵시적으로 부동-소수점 타입으로 하자는 묵시적인 규약을 정했던 것입니다. 이런 규약을 위한 문자들의 선택은 그 당시에 과학자와 공학자들이 문자들을 변수 아래 첨자로서 사용하였다는 사실에 기반하였다고 합니다.

 

4.    What is the primary reason why C became more widely used than Fortran?

 

I think the reason Fortran was less widely used than C was because of its lack of flexibility. The original Fortran design team thought of language design only as a pre-work required for the critical task of designing the translator, and furthermore, they did not think that Fortran would be used on other computers that were not manufactured by IBM. The C language grew in popularity because compilers were part of the widely used UNIX operating system. Also, one of the features of Fortran I and all subsequent versions prior to Fortran 90 that allows for a high-level optimizing compiler is that the types and storage spaces for all variables are fixed before execution time, so that any new variables or storage spaces are not created at runtime. could not be allocated during It was a sacrifice of flexibility for simplicity and efficiency. One of the most important reasons C is preferred is its flexibility. The lack of one complete typecheck could result in functions whose parameters were not typechecked. Fortran's lack of flexibility eliminates the possibility of recursive subprograms, making it difficult to implement data structures that grow or change shape dynamically.

 

FortranC보다 널리 사용되지 않았던 이유는 유연성의 결여 때문이라고 생각합니다. 처음의 Fortran 설계 팀은 언어 설계를 단지 그 번역기를 설계하는 중대한 작업에 필요한 사전 작업으로만 생각했고, 더욱이 FortranIBM에서 제조되지 않는 다른 컴퓨터에서 사용될 것이라고 생각하지 못했습니다. C언어는 컴파일러가 널리 사용되고 있는 UNIX 운영체제의 일부분이었기 때문에 인기가 급증했습니다. 또한, 높은 수준의 최적화 컴파일러를 허용하는 Fortran IFortran 90 이전의 모든 후속버전들이 갖는 특징 중의 한 가지는 모든 변수에 대한 타입과 기억공간이 실행 시간 전에 고정되었기에, 어떠한 새로운 변수나 기억공간이 실행 시간 동안에 할당될 수 없었습니다. 이는 단순성과 효율성을 위한 유연성의 희생이었습니다. C가 선호되는 가장 중요한 이유 중의 하나는 바로 그 유연성입니다. 하나의 완전한 타입 검사의 결여로 매개변수가 타입 검사되지 않은 함수들이 작성될 수 있었습니다. Fortran의 유연성의 결여는 재귀적 부프로그램의 가능성을 제거하였고, 동적으로 형태를 키우거나 변경하는 데이터 구조를 구현하는 것을 어렵게 했습니다.

 

5.    What is your opinion of the argument that languages that are too complex are too dangerous to use, and we should therefore keep all languages small and simple?

 

To be honest, I didn't quite understand the meaning of the phrase "too dangerous a language that is too complex" is dangerous. Whether it is dangerous for users to confuse because the language is too complex, or whether the program execution itself is dangerous because of the complexity of the code. Because it means writing code, I think it would be good to materialize it into a program. However, in the former case, if the programming language is too complicated, it is natural for users to have difficulties or mistakes in using the language. However, as I said before, I don't think it's necessary to keep all languages ​​small and simple because I think each has its pros and cons. I just think that a simple language is better because I have experienced a lot of complex programming languages ​and had a lot of difficulties when writing code. But I don't think it has to be mandatory.

 

너무 복잡한 언어는 너무 위험하다라는 표현이 어떤 의미로 위험하다는 것인 것 솔직히 이해가 잘 가지 않았습니다. 언어가 너무 복잡하기 때문에 사용자가 혼동한다는 점이 위험하다는 것인지, 혹은 코드의 복잡성 때문에 프로그램 실행 자체에 있어 위험하다는 점인지, 물론 후자의 경우에 대해서는 본 케이스가 없기 때문에 걱정할 필요 없겠지만, 오히려 복잡하다면 그만큼 자세하게 코드를 작성한다는 뜻이기 때문에 오히려 프로그램에 구체화에는 좋을 것 같다고 저는 생각합니다. 그러나 전자에 있어 프로그래밍 언어가 너무나 복잡하다면 당연히 사용자는 언어를 사용하는데 어려움이나 실수가 잦을 것이고 이 점은 분명히 작고 단순한 언어가 낫다고 생각합니다. 그러나 앞서 이야기한 것처럼 각각 장단점이 존재한다고 생각하기 때문에 모든 언어를 작고 단순하게 유지할 필요는 없다고 생각합니다. 단지 저는 복잡한 프로그래밍 언어들을 겪어보면서, 코드를 작성할 때 어려웠던 점이 많았기 때문에 단순한 언어가 더 낫다고 생각합니다. 그러나 그게 의무가 될 필요는 없다고 생각합니다.

 

6.    Compare the features of Fortran and C and BASIC. Read some of the document, which are available on the Internet, and write an analysis of their features.

 

Most of the BASIC design is taken from Fortran, with minor influences from the syntax of ALGOL 60. Fortran was primarily used for scientific purposes, while BASIC was more suited to commercial and business applications. Basic ran primarily on Microsoft platforms, while Fortran ran on many platforms such as Windows and Linux. Fortran must conform to the program, but BASIC is simply interpreted. Fortran is required, Basic is not. BASIC has object-oriented programming (OOP) capabilities, but Fortran was developed long before OOP. But today newer versions of Fortran have these objects. BASIC is very convenient for creating user-friendly GUIs, but it is very difficult to do this in Fortran. Fortran simply stands for mathematical formula translation. It was one of the first languages ​​developed after the Assembly language. Because of the lack of structure, it is more vulnerable to spaghetti code than C. Fortran was a huge improvement when it was created. However, it is not a structured language like C. C was developed to develop the UNIX operating system. Structured languages ​​have blocks of indentation and code, surrounded by curly braces {,} to indicate the beginning and end of each code block. Fortran passes all variables to subroutines by reference. This means that if a variable is changed in a subroutine, it can also change in the calling program and cause problems. C allows calling by reference or by value. By value passes the value of a variable in the calling routine and then assigns that value to a variable defined locally in the subroutine. C also allows subroutines to be called recursively. This cannot be done in Fortran.

 

BASIC 설계의 대부분은 Fortran으로부터 가져왔으며, ALGOL 60의 구문으로부터 사소한 영향을 받았습니다. Fortran은 주로 과학적 목적으로 사용되는 반면 BASIC은 상업 및 비즈니스 응용 프로그램에 더 적합하였습니다. Basic은 주로 Microsoft 플랫폼에서 실행되지만 Fortran Windows Linux와 같은 많은 플랫폼에서 실행되었습니다. Fortran은 프로그램을 준수해야 하지만 BASIC은 단순히 해석됩니다. Fortran은 필수이지만 Basic은 그렇지 않습니다. BASIC에는 객체 지향 프로그래밍(OOP) 기능이 있지만 Fortran OOP보다 훨씬 앞서 개발되었습니다. 그러나 오늘날 새로운 버전의 Fortran에는 이러한 개체가 있습니다. BASIC은 사용자 친화적인 GUI를 만드는 데 매우 편리하지만 Fortran에서는 이를 수행하기가 매우 어렵습니다. Fortran은 단순히 수학 공식 번역을 의미합니다. Assembly 언어 이후에 개발된 최초의 언어 중 하나입니다. 구조가 없기 때문에 C보다 스파게티 코드에 더 취약합니다. Fortran은 만들어졌을 때 대단한 발전이었습니다. 그러나 C와 같은 구조화된 언어는 아닙니다. C UNIX 운영 체제를 개발하기 위해 개발했습니다. 구조화된 언어에는 들여쓰기와 코드 블록이 있으며 각 코드 블록의 시작과 끝을 나타내는 중괄호 {,}로 둘러싸여 있습니다. Fortran은 모든 변수를 참조로 서브루틴에 전달합니다. 이는 변수가 서브루틴에서 변경되면 호출 프로그램에서도 변경되어 문제를 일으킬 수 있음을 의미합니다. C는 참조 또는 값에 의한 호출을 허용합니다. By value는 호출 루틴의 변수 값을 전달한 다음 해당 값을 서브루틴에 로컬로 정의된 변수에 할당합니다. C를 사용하면 서브루틴을 재귀적으로 호출할 수도 있습니다. 이는 Fortran에서 수행할 수 없습니다.

 

7.    Give a brief general description of the Java servelet.

 

A Java servlet is an instance of a Java class that resides and runs on a web server machine. Execution of the servlet is requested by the markup document being displayed by the web browser. The output of the servlet is returned to the requesting browser. A program running in a web server process called a servlet container controls the execution of servlets. Servlets are commonly used for form processing and database access.

 

자바 서블릿은 웹 서버 시스템상에 상주하여 실행되는 Java 클래스의 사례입니다. 서블릿의 실행은 Web 브라우저에 의해서 디스플레이되고 있는 마크업 문서에 의해서 요청됩니다. 서블릿의 출력은 요청한 브라우저에게 반환됩니다. 서블릿 컨테이너라 불리는 웹 서버 프로세스에서 실행되는 프로그램은 서블릿들의 실행을 제어합니다. 서블릿들은 폼 처리와 데이터베이스 접근을 위해서 공통적으로 사용됩니다.

반응형
Comments