- Type system of types
- *:types have values
- *->*: type constructor/function on types/types take a single parameter
- Constructor representing sets of types
- Types are used to define overloaded data
type family f :: aData families create new types, every instance of a data family declares a new constructor
- Asynchronous programming - Performing multiple operations in parallel
void myFunc() async {
	print("Do something")
}Dart will automatically assign myFunc to its own thread
- What if you need the result of an asynchronous operation?
- What if you encounter an error?
- How do you define the return of an operation?
Passing functions (success and failure) to "callback" after asynchronous operation
String contents = await f.readAsString();- awaitblocks the main thread until the worker thread is finished
- more readable than callbacks
- A Promise is an abstraction of an asynchronous operation
- Future.wait(futures).then(...)
- Dart uses "Isolates" to achieve concurrency and improve Future performance
- Unlike threads, Isolates do not share memory (to prevent deadlocking and read first errors) but pass messages to each other along a shared pipe
- Each thread inherits its parent's memory
Future.wait(futures)
	.then(...)
	.onError(...)We can use async operations to show the user a "loading" screen while the number of lines are being counted.
- Released in 2010 in Apple
- Multi-paradigm, general purpose
- Inspried by Python, Ruby, Obj-C, Haskell, Rust
- Statically Typed
- Feature in swift to improve type-safety
- Provides a safe solution to handle missing values
- Similar to Maybes in Haskell
var name: String?
name = "John"
print(name) // Error: needs to be unwrapped first
if let unwrappedName = name {
	let count = unwrappedName
	print(count)
} else {
	print("The value is nil")
}var age: Int?
age = 15
func getAge(_ age: Int?) {
	guard let unwrappedAge = age else {
		print("ERROR")
		return
	}
	print("Age is \(unwrappedAge)")
}var age: Int?
age = 15
print(age!)let cars = ["BMW", "Audi", "Tesla"]
let cars2 = []
let lower = cars2.first?.lowercased()
print(lower)first? checks if the optional has a value.
class Human {}
class Student : Human {}
class Professor : Human {}
let humans = [Student(), Professor()]
for person in humans {
	if let student = person as? Student {
		// call saySomething whenever the person is a student
		student.saySomething()
	}
}- Up-and-coming language
- Design goals
- performance and safety of compiled languages
- expressiveness of modern dynamic languages
 
- Easy to read
- Provides garbage collection
- Array implementation better
- Slow garbage collection
- Less community support
// Declaration
int[] arr = [1,2,3];
int[] arr2 = [4,5,6];
// Concatenation
auto arr3 = arr ~ arr2- Map, Filter, Fold like Haskell.
- Chain will attempt to concatenate the two parameters passed to it
result = words.filter!(x => x.length < 4);
- similar to C++, Java syntax
- No multiple inheritance
- this
- super
- override
- abstract
- public, protected, private
D provides memory safety through the use of tags
- @system - default normal functions
- @safe - disallow function calls that may lead to memory corruption
- @trusted - functions guaranteed not to exhibit undefined behavior
- syntactic sugar that allows regular functions to be called like member functions
cook("fries", 3) // => Cooking fries for 3 people
"fries".cook(3) // Same thing!- Determines the position of the shader
- Determines the color to fill shapes
- OpenGL Shading Language
- C-style language
- Built in math libraries (vector, matrix,...)
- Control branches, function definitions
- Does not support recursion
- Scalars
- Vectors
- attribute:
- shared between application and vertex shader
- vertex-specific data
 
- uniform:
- shared between application and shader
- object properties (eg. light properties, projection matrix)
 
- varying:
- shared between vertex shader and gragment shader
- information from vertex shader (eg. effects of lighting)
 
attribute vec3 vPosition;
attribute vec3 vColor;
varying vec4 color;
uniform mat4 model_view;
uniform mat4 projection;
...#school/f19/proglang-f19