Skip to content

Commit

Permalink
Updates to swift talk
Browse files Browse the repository at this point in the history
  • Loading branch information
alkrauss48 committed Jul 15, 2021
1 parent 0960ffd commit 0c2ee92
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 9 deletions.
12 changes: 12 additions & 0 deletions how-swift-works/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
How Swift Works Under the Hood
==

By [Aaron Krauss](https://thecodeboss.dev)

[Watch the talk on Youtube](https://www.youtube.com/watch?v=iPddh9N9o8A)

## Running the Presentation

```
./sent presentation.txt
```
Binary file modified how-swift-works/images/meetup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 53 additions & 9 deletions how-swift-works/presentation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,33 +99,47 @@ Programming Concepts

Compiled vs. Interpreted

Compiled

Swift is compiled

Now when we say
compiled / interpreted

We're referring to an implementation
of the language

Not the language itself

Compiled

Pros

* Speed / Peformance
* Speed / Performance
* Typically build with static type-checking

Cons

* Usually not cross-platform
* Must compile everytime
* Challenging to implement reflection, metaprogramming, etc.
* Don't usually have benefits of
dynamic type-checking

Interpreted

* Usually cross platform
* No compilation step
* Easier access to reflection, metaprogramming, etc.
* Typically built with dynamic type-checking

Cons

* Less speed
* Runtime errors
* Less speed / performance
* Don't usually have benefits of
static type-checking

Bonus: Bytecode

* Power of compiled performance
* Same interpreter as many other bytecode languages
* Some of compiled performance
* Usually cross-platform
* Can use same VM as other bytecode languages

JVM

Expand All @@ -138,10 +152,30 @@ Type Checking
Swift is a statically
typed-checked language

Unlike compiled/interpreted,
type checking is a language feature

Static type checking

* Track type errors early
at compile time

* Makes runtime modifications more challenging

* Static type checking is more rigid
on your development style

Dynamic type checking

* Easier to implement
reflection, metaprogramming, etc.

* Also easier to introduce type-related
bugs into your code

Dynamically type-checked languages
often encourage testing with your code

Type Safety

Strong vs. Weak Typing
Expand Down Expand Up @@ -171,6 +205,9 @@ Examples of weakly typed language
static vs dynamic type checking
means "when" type safety is enforced

Strong / Weak Typing means
"how" type safety is enforced

Concurrency

Swift supports concurrency
Expand All @@ -180,6 +217,9 @@ Concurrency != Parallelism
Swift 5.5 (2021) expands concurrency support
via the "actor" model

Swift does not appear to support
true parallelism

Garbage Collection

2 main algorithms
Expand Down Expand Up @@ -232,6 +272,10 @@ E.g. SQL

Swift UI is declarative

Learn more programming concepts at

https://thecodeboss.dev/blog/

Storyboard / SwiftUI

Storyboard & XIB
Expand Down

0 comments on commit 0c2ee92

Please sign in to comment.