Week 12 Flashcards

(13 cards)

1
Q

What is the future of programming?

A

You are unlikely to program in a purely functional language

However, you are likely already using functional programming principles due to their increasing adoption in mainstream programming languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is industrial inertia, and how does it affect new programming languages?

A

Industrial Inertia: Resistance to adopting new programming paradigms due to existing investments in old technologies

New programming languages often resemble old ones (e.g., “horseless carriages”) to ease adoption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are higher-order functions?

A

Higher-order functions are functions that take other functions as arguments or return them as results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are polymorphic types, and how are they used?

A

Polymorphic Types: Allow functions to operate on arguments of various types while maintaining type safety.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Verse programming language, and what is it used for?

A

Verse: A language for the Unreal Editor for Fortnite (UEFN) to control the behavior of assets in a gaming metaverse

Released by Epic Games, it supports custom game modes and scales well for thousands of players

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the key features of Verse?

A

1.Multi-paradigm

2.Strongly typed

3.Expression-oriented

4.Failure is control flow

5.Concurrency

6.Speculative execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does it mean for Verse to be multi-paradigm?

A

Verse combines functional, logic, object-oriented, and imperative programming paradigms

Values are immutable by default, ensuring consistent results for the same code and data

Example:

AnswerToTheQuestion : int = 42

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does strongly typed mean in Verse?

A

Strongly Typed: Every identifier has a specific type, minimizing uncaught errors

Predictable results because types and operations are predefined

Example:

WinningPlayer : int = 100

Announcement : string = “… And the winner is: {WinningPlayer}!”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does it mean for Verse to be expression-oriented?

A

There is no distinction between statements and expressions; everything is an expression

The result of the last expression in a function is the function’s return value

Example:

AreaOfCircle(Radius : Float) : Float = Pi * Radius ** 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does Verse handle failure?

A

Control flow changes based on whether an expression succeeds or fails

Example:

if (Score := Scores[High]):
Log(Score)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is concurrency in Verse?

A

Concurrency is built into the language

Race expressions run multiple
asynchronous blocks simultaneously, with the first to complete being used

Example:

set WinnerResult = race:
AsyncFunctionLongTime()
AsyncFunctionShortTime()
AsyncFunctionMediumTime()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is speculative execution in Verse?

A

Speculative Execution:

Effects are committed if an expression succeeds

Effects are rolled back if it fails

Implemented using Software Transactional Memory (STM). Reads and writes are logged and only committed if there are no conflicts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly