about summary refs log tree commit diff stats
path: root/tutorial/index.md
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-09 08:52:02 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-09 08:52:02 -0800
commitb72aed920bfc01b4de1d31526e9b31804748c220 (patch)
tree5264d930cb38083bb37d6cd92fe80b1dbd3a584e /tutorial/index.md
parentd253a3182859c7c989449122a60d5f362f19ded0 (diff)
downloadmu-b72aed920bfc01b4de1d31526e9b31804748c220.tar.gz
reword the tutorial after dropping 'grapheme'
Diffstat (limited to 'tutorial/index.md')
-rw-r--r--tutorial/index.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/tutorial/index.md b/tutorial/index.md
index 3c7f781f..b3056076 100644
--- a/tutorial/index.md
+++ b/tutorial/index.md
@@ -550,10 +550,11 @@ fn main screen: (addr screen), keyboard: (addr keyboard) {
 
 `read-line-from-keyboard` reads keystrokes from the keyboard until you press
 the `Enter` (also called `newline`) key, and accumulates them into a _stream_
-of bytes. The loop then repeatedly reads _code-point-utf8s_ from the stream. A
-code-point-utf8 can consist of multiple bytes, particularly outside of the Latin
-alphabet and Arabic digits most prevalent in the West. Mu doesn't yet support
-non-Qwerty keyboards, but support for other keyboards should be easy to add.
+of bytes. The loop then repeatedly reads _code points_ from the stream, and
+these code points are encoded in a special encoding of Unicode called UTF-8.
+Mu doesn't yet support non-Qwerty keyboards, but support for keyboards in
+other parts of the world should be easy to add thanks to our support for
+UTF-8.
 
 This is a good time to skim the section in the Mu reference on
 [streams](https://github.com/akkartik/mu/blob/main/mu.md#streams), just to
@@ -561,14 +562,14 @@ give yourself a sense of what you can do with them. Does the above program
 make sense now?  Feel free to experiment to make sense of it.
 
 Can you modify it to print out the line a second time, after you've typed it
-out until the `Enter` key? Can you print a space after every code-point-utf8 when you
-print the line out a second time? You'll need to skim the section on
+out until the `Enter` key? Can you print a space after every code point when
+you print the line out a second time? You'll need to skim the section on
 [printing to screen](https://github.com/akkartik/mu/blob/main/vocabulary.md#printing-to-screen)
-from Mu's vocabulary. Pay particular attention to the difference between a
-code-point-utf8 and a _code-point_. Mu programs often read characters in units of
-code-point-utf8s, but they must draw in units of code-points that the font manages.
-(This adds some complexity but helps combine multiple code-points into a
-single glyph as needed for some languages.)
+from Mu's vocabulary. One common pattern: Mu programs read characters in
+UTF-8, but print raw `code-point`s. Use `to-code-point` to decode UTF-8 and
+get at the underlying raw `code-point`, and use `to-utf8` to encode a
+`code-point` into a `code-point-utf8`. (This stuff is still under
+construction; I hope to simplify it over time.)
 
 ## Task 15: generating cool patterns
 
6' href='#n226'>226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382