1/38
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Prolog
Created in 1972, it is a logic programming language associated with artificial intelligence and computational linguistics.
Ruby
Developed in 1993 by Yukihiro Matsumoto with an emphasis on OOP from the beginning.
Java
Created by Sun Microsystems in 1995, it was popular with web-based applets. It's one of the most popular languages today.
JavaScript
Brandon Eich created this language in 1995. It is a very popular language to embed within HTML for client-side web scripting.
PHP
Developed by Rasmus Lerdorf in 1995, it is the most popular language for server-side scripting.
Objective-C
Created in the 80s by Love and Cox, it was the primary language for Apple software development.
Describe three reasons why it is a good idea for someone to study the concepts of programming languages.
options for reasons:
1. increased ability to express ideas
2. improved background for choosing appropriate languages
3. increased ability to learn new languages
4. better understanding of significance of implementation
5. better use of languages that are already known
6. overall advancement of computing
List three common criteria that are used to evaluate programming languages.
options:
1. readability
2. writability
3. reliability
4. cost
List four programming domains.
options:
1. scientific applications
2. business applications
3. AI
4. systems programming
5. web software
List four language categories.
1. imperative
2. functional
3. logic
4. markup/programming hybrid
language design trade-offs
- reliability vs. cost of execution
- readability vs. writability
- writability (flexibility) vs. reliability
implementation methods
- compilation
- pure interpretation
- hybrid implementation systems
compilation phases
1. lexical analysis: converts characters in the source program into lexical units
2. syntax analysis: transforms lexical units into parse trees which represent the syntactic structure of the program
3. semantics analysis: generate intermediate code
4. code generation: machine code is generated
Von Neumann Bottleneck
program instructions can be executed much faster than the speed of the connection between a computer's memory and processor; the connection speed thus results in a bottleneck
- primary limiting factor in the speed of computers
examples of programming environments
- UNIX
- Microsoft Visual Studio .NET
- NetBeans
What is Fortran ranked on the Tiobe index?
in January 2025, 10; in January 2024, 12
T/F: Fortran is a strongly typed language, which means each variable must have a type.
T
What are the 5 built-in data types in Fortran?
1. integer
2. real
3. complex
4. character
5. logical
T/F: Fortran is case-sensitive.
F
Give two reasons for having a single language for all programming domains.
1. It would create ultimate standardization, where the programming language can be used across all development environments and machines. Due to the single language, it would require some extreme complexity to deliver functionality across all machines. Although it would be difficult to understand the language at first, extensive research would allow for numerous textbooks, videos, articles, etc. to be available to learn the language.
2. Therefore, once individuals learn the language, there would be overall simplicity since no other languages exist. (only one big learning curve, not many small learning hurdles)
Give two reasons against having a single language for all programming domains.
1. Programming domains exist for a reason; they each have their own set of requirements necessary for languages, and have language optimized for the programming domains. With a single language, this optimization would be impossible.
2. The language would be extremely complex and take much longer to learn due to its vast amount of design aspects it would require.
Name six attributes that can be used to characterize a variable.
1. name
2. address
3. value
4. type
5. lifetime
6. scope
What does it mean to have a binding of a variable?
A binding is an association between an entity and an attribute, such as between a variable and its type or value.
possible binding times with variables
- compile time: bind a variable to a type in C or Java
- load time: bind a C or C++ static variable to a memory cell
- runtime: bind a nonstatic local variable to a memory cell
static binding
first occurs before run time and remains unchanged throughout program execution
dynamic binding
first occurs during execution or can change during execution of the program
When does binding occur for a Fortran variable? Explain by using an example.
Binding occurs during compile time, not during run time. This means that Fortran variables use static binding, where the variable's type and memory allocation remain constant throughout execution.
For example, given the code:
integer :: height
real :: grade
height = 89
grade = 90.0
we can see that height and grade are bound to their data types and when they are given a value, memory is allocated based on the type, which stays constant.
In the history of computing, what are the two most influential programming languages? Provide evidence to support your answers.
The two most influential programming languages are C and Python. C inspired C++, Java, Python, and other languages that are all used commonly today. It was able to be understood at a high level, and although not object-oriented, inspired the structures of the popular object-oriented language C++. It can also be used in a wide variety of applications like writing operating systems and compilers. Python is influential due to its ease of use and applications. It is easy to teach and learn, but it also extremely powerful, especially in AI and statistics modeling applications. Although COBOL is different from Python, it seems to be its successor, as many individuals involved with business applications are learning to use Python, even though they are not working in the computer science field.
syntax
the form or structure of the expressions, statements, and program units
semantics
the meaning of the expressions, statements, and program units
What provides a language's definition?
syntax and semantics
Who are the users of a language's definition?
- other language designers
- implementors
- programmers (users of language)
sentential form
sentence that has only terminal symbols
leftmost derivation
the leftmost nonterminal in each sentential form is the one that is expanded
- practice examples of this
ambiguous grammar
a grammar is this IFF it generates a sentential form that has two or more distinct parse trees
operational semantics
Describe the meaning of a program by executing its statements on a machine, either simulated or actual. The change in the state of the machine (memory, registers, etc.) defines the meaning of the statement
Provide a syntax description for the Fortran while statement.
do while (condition)
// code block
end do
Describe the semantics of the Fortran while statement.
The condition is evaluated. If the condition is true, the code block is executed. Control moves back to the do while line and the condition is evaluated again. This process is repeated until the condition is false.
What is a Fortran derived type? When would it be needed?
It is a special form of data type that can encapsulate other built-in/intrinsic types as well as other derived types. It is similar to a struct in C/C++. It would be needed when a record needs to be represented, like with the ACM student membership data example.