Skip to content

Commit d54e64d

Browse files
djmitcheNoahDragon
authored andcommitted
Generalize the day-4 afternoon (google#487)
* Generalize the day-4 afternoon This is in preparation for adding more options for this portion of the course, and reflects an existing practice of substituting other materials for this last half-day. * address review comments
1 parent b43b0bc commit d54e64d

File tree

8 files changed

+61
-41
lines changed

8 files changed

+61
-41
lines changed

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ editable = true
4343

4444
[output.html.redirect]
4545
"structure.html" = "running-the-course/course-structure.html"
46+
"exercises/day-4/afternoon.html" = "exercises/day-4/android.html"
4647
"unsafe/unsafe-functions.html" = "calling-unsafe-functions.html"

src/SUMMARY.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[Welcome to Comprehensive Rust 🦀](welcome.md)
44
- [Running the Course](running-the-course.md)
55
- [Course Structure](running-the-course/course-structure.md)
6+
- [Day 4](running-the-course/day-4.md)
67
- [Keyboard Shortcuts](running-the-course/keyboard-shortcuts.md)
78
- [Translations](running-the-course/translations.md)
89
- [Using Cargo](cargo.md)
@@ -199,7 +200,7 @@
199200
- [Dining Philosophers](exercises/day-4/dining-philosophers.md)
200201
- [Multi-threaded Link Checker](exercises/day-4/link-checker.md)
201202

202-
# Day 4: Afternoon
203+
# Day 4: Afternoon (Android)
203204

204205
----
205206

@@ -222,7 +223,7 @@
222223
- [Calling Rust from C](android/interoperability/with-c/rust.md)
223224
- [With C++](android/interoperability/cpp.md))
224225
- [With Java](android/interoperability/java.md)
225-
- [Exercises](exercises/day-4/afternoon.md)
226+
- [Exercises](exercises/day-4/android.md)
226227

227228
# Final Words
228229

src/android.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ Rust is supported for native platform development on Android. This means that
44
you can write new operating system services in Rust, as well as extending
55
existing services.
66

7+
> We will attempt to call Rust from one of your own projects today. So try to
8+
> find a little corner of your code base where we can move some lines of code to
9+
> Rust. The fewer dependencies and "exotic" types the better. Something that
10+
> parses some raw bytes would be ideal.
File renamed without changes.

src/running-the-course.md

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,51 @@
55
Here is a bit of background information about how we've been running the course
66
internally at Google.
77

8-
To run the course, you need to:
8+
Before you run the course, you will want to:
99

1010
1. Make yourself familiar with the course material. We've included speaker notes
11-
to help highlight the key points (please help us by
12-
contributing more speaker notes!). You should make sure to open the speaker
13-
notes in a popup (click the link with a little arrow next to "Speaker
14-
Notes"). This way you have a clean screen to present to the class.
11+
to help highlight the key points (please help us by contributing more speaker
12+
notes!). When presenting, you should make sure to open the speaker notes in a
13+
popup (click the link with a little arrow next to "Speaker Notes"). This way
14+
you have a clean screen to present to the class.
1515

16-
2. Decide on the dates. Since the course is large, we recommend that you
16+
1. Select your topic for the afternoon of the fourth day. This may be based on
17+
the audience you expect, or on your own expertise.
18+
19+
1. Decide on the dates. Since the course is large, we recommend that you
1720
schedule the four days over two weeks. Course participants have said that
1821
they find it helpful to have a gap in the course since it helps them process
1922
all the information we give them.
2023

21-
3. Find a room large enough for your in-person participants. We recommend a
24+
1. Find a room large enough for your in-person participants. We recommend a
2225
class size of 15-20 people. That's small enough that people are comfortable
2326
asking questions --- it's also small enough that one instructor will have
2427
time to answer the questions. Make sure the room has _desks_ for yourself and for the
2528
students: you will all need to be able to sit and work with your laptops.
2629
In particular, you will be doing a lot of live-coding as an instructor, so a lectern won't
2730
be very helpful for you.
2831

29-
4. On the day of your course, show up to the room a little early to set things
32+
1. On the day of your course, show up to the room a little early to set things
3033
up. We recommend presenting directly using `mdbook serve` running on your
31-
laptop (see the [installation instructions][5]). This ensures optimal performance with no lag as you change pages.
34+
laptop (see the [installation instructions][3]). This ensures optimal performance with no lag as you change pages.
3235
Using your laptop will also allow you to fix typos as you or the course
3336
participants spot them.
3437

35-
5. Let people solve the exercises by themselves or in small groups. Make sure to
38+
1. Let people solve the exercises by themselves or in small groups. Make sure to
3639
ask people if they're stuck or if there is anything you can help with. When
3740
you see that several people have the same problem, call it out to the class
3841
and offer a solution, e.g., by showing people where to find the relevant
3942
information in the standard library.
4043

41-
6. If you don't skip the Android specific parts on Day 4, you will need an [AOSP
42-
checkout][1]. Make a checkout of the [course repository][2] on the same
43-
machine and move the `src/android/` directory into the root of your AOSP
44-
checkout. This will ensure that the Android build system sees the
45-
`Android.bp` files in `src/android/`.
46-
47-
Ensure that `adb sync` works with your emulator or real device and pre-build
48-
all Android examples using `src/android/build_all.sh`. Read the script to see
49-
the commands it runs and make sure they work when you run them by hand.
44+
1. Prepare anything you need to have available for the afternoon of day 4.
5045

5146
That is all, good luck running the course! We hope it will be as much fun for
5247
you as it has been for us!
5348

54-
Please [provide feedback][3] afterwards so that we can keep improving the
49+
Please [provide feedback][1] afterwards so that we can keep improving the
5550
course. We would love to hear what worked well for you and what can be made
56-
better. Your students are also very welcome to [send us feedback][4]!
51+
better. Your students are also very welcome to [send us feedback][2]!
5752

58-
[1]: https://source.android.com/docs/setup/download/downloading
59-
[2]: https://github.com/google/comprehensive-rust
60-
[3]: https://github.com/google/comprehensive-rust/discussions/86
61-
[4]: https://github.com/google/comprehensive-rust/discussions/100
62-
[5]: https://github.com/google/comprehensive-rust#building
53+
[1]: https://github.com/google/comprehensive-rust/discussions/86
54+
[2]: https://github.com/google/comprehensive-rust/discussions/100
55+
[3]: https://github.com/google/comprehensive-rust#building

src/running-the-course/course-structure.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ The course is fast paced and covers a lot of ground:
77
* Day 1: Basic Rust, ownership and the borrow checker.
88
* Day 2: Compound data types, pattern matching, the standard library.
99
* Day 3: Traits and generics, error handling, testing, unsafe Rust.
10-
* Day 4: Concurrency in Rust and interoperability with other languages
11-
12-
> **Exercise for Day 4:** Do you interface with some C/C++ code in your project
13-
> which we could attempt to move to Rust? The fewer dependencies the better.
14-
> Parsing code would be ideal.
10+
* Day 4: Concurrency in Rust and seeing Rust in action.
1511

1612
## Format
1713

src/running-the-course/day-4.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Day 4
2+
3+
> This page is for the course instructor.
4+
5+
The afternoon of the fourth day should cover a topic of your choice. Include
6+
the topic in the announcement of the course, so that participants know what to
7+
expect.
8+
9+
This phase of the course is a chance for participants to see Rust in action on a
10+
codebase they might be familiar with. You can choose from the topics already
11+
defined here, or plan your own.
12+
13+
Some topics need additional preparation:
14+
15+
## Android
16+
17+
If you chose Android for Day 4 afternoon, you will need an [AOSP checkout][1].
18+
Make a checkout of the [course repository][2] on the same machine and move the
19+
`src/android/` directory into the root of your AOSP checkout. This will ensure
20+
that the Android build system sees the `Android.bp` files in `src/android/`.
21+
22+
Ensure that `adb sync` works with your emulator or real device and pre-build
23+
all Android examples using `src/android/build_all.sh`. Read the script to see
24+
the commands it runs and make sure they work when you run them by hand.
25+
26+
[1]: https://source.android.com/docs/setup/download/downloading
27+
[2]: https://github.com/google/comprehensive-rust

src/welcome-day-4.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Welcome to Day 4
22

3-
Today we will look at two main topics:
3+
This morning, we will focus on Concurrency: threads, channels, shared state, `Send` and `Sync`.
4+
In the afternoon, we will have a chance to see Rust in action.
45

5-
* Concurrency: threads, channels, shared state, `Send` and `Sync`.
6+
<details>
67

7-
* Android: building binaries and libraries, using AIDL, logging, and
8-
interoperability with C, C++, and Java.
8+
This is a good time to give an outline of what you will cover in the afternoon
9+
section, as announced in the course offering.
910

10-
> We will attempt to call Rust from one of your own projects today. So try to
11-
> find a little corner of your code base where we can move some lines of code to
12-
> Rust. The fewer dependencies and "exotic" types the better. Something that
13-
> parses some raw bytes would be ideal.
11+
</details>

0 commit comments

Comments
 (0)