Programming Languages Review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/47

flashcard set

Earn XP

Description and Tags

These flashcards cover key concepts, terms, and definitions discussed in the programming languages review, including Lisp, Scheme, AArch64, Rust, and Lambda Calculus.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

48 Terms

1
New cards

Is Lisp the second-oldest programming language?

True

2
New cards

Which Lisp/Scheme data structure holds exactly two items?

pair/cone cell

3
New cards

Which function returns the first component of a cons cell / pair?

car

4
New cards

Which function returns the second component of a cons cell / pair?

cdr

5
New cards

What is the result of evaluating the Scheme expression ((lambda (x) (+ x 1)) 41)?

42

6
New cards

A function that captures data in its lexical environment is called a…?

Closure

7
New cards

A function that accepts another function as a parameter is called a…?

Higher-order function

8
New cards

What special symbol in the car of an s-expression causes its cdr to be returned unevaluated?

quote

9
New cards

Which of the following describes Scheme’s type system?

Strong

10
New cards

Which of the following are characteristics of Scheme’s scoping rules?

Lexical scoping

11
New cards

Which register stores the address of the top of the stack in aarch64?

SP

12
New cards

Which register stores the address of the current instruction executing in aarch64?

PC

13
New cards

Which register stores the return address of the currently executing instruction in aarch64?

R30 (Link register)

14
New cards

Which register stores the address of the current function’s stack frame in aarch64?

R29 (Frame pointer)

15
New cards

How many bits wide is the stack pointer’s alignment boundary?

16

16
New cards

The first parameter (assuming it fits) to a function is passed in which register?

R0

17
New cards

A function’s return value, assuming it fits, is stored in which register?

R0

18
New cards

Which instruction loads a page address into a register?

ADR

19
New cards

Which keyword makes a Rust variable mutable?

mut

20
New cards

What’s the main function’s signature in Rust?

fn main()

21
New cards

Which of the following is not an error that Rust is designed to prevent?

File handle exhaustion

22
New cards

In Rust, a macro is…?

A function that runs at compile time to transform the program’s syntax tree

23
New cards

Which of the following lifetime declarations indicates that the reference is valid for the entire program execution?

&'static str

24
New cards

Which of the following creates a slice of v that doesn’t contain its first element?

B) &v[1..]

25
New cards

Which character appears at the end of macro names?

!

26
New cards

Which of the following is the syntax of a Rust for-each loop?

for t in &a { … }

27
New cards

In C, if a program contains a statement with undefined behavior, then…?

It has no meaningful behavior before and after executing the statement

28
New cards

Rust’s type system…

is static, with inference to allow the programmer to leave out some types

29
New cards

Which of the following is not a memory allocation strategy/location?

Bin

30
New cards

In Rust, a named collection of methods defined for a type is called a…?

Trait

31
New cards

This Rust feature allows us to write code that uses variables where we would usually use actual types.

Generics

32
New cards

Which of the following operators allows us to propagate None / Err variants of the Option and Result data types?

?

33
New cards

In Rust, the compiler uses this construct directly to ensure all borrows are valid.

Lifetimes

34
New cards

λ Calculus was developed by whom?

Alonzo Church

35
New cards

Which of the following programming languages was directly influenced by λ Calculus?

Haskell

36
New cards

Which of the following is not a kind of term in the λ calculus?

Type signatures

37
New cards

Two terms that are syntactically identical when bound variables appearing in them are consistently renamed are called…?

α − equivalent

38
New cards

Renaming bound variables in a function being applied to avoid binding free variables in the argument is called…?

α-conversion

39
New cards

What is an alphabet in formal language theory?

A finite set of symbols

40
New cards

What kind of automaton is a parser?

PDA

41
New cards

What does BNF stand for?

Backus-Naur Form

42
New cards

In a CFG, what must appear on the left-hand side of a production?

A nonterminal

43
New cards

What does the symbol ϵ represent in regular expressions?

The empty string

44
New cards

What defines the syntax of a language?

Rules specifying legal strings

45
New cards

What handles tokens in a compiler?

Scanner

46
New cards

What is a language in formal language theory?

A set of strings

47
New cards

A programming language is a formal language and…?

Semantics

48
New cards

Which of the following operators denotes zero or more repetitions of a regular expression?

*