rabbit-slide-hasumikin-RubyWorldConference2022 2022.11.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ee2ad31b6425367bfd8e0beb0755bfc0d6fc1d6f70e93e81db8824b1ff768217
4
+ data.tar.gz: 16ad4618b185dbf7f39591687f888a84ffcfa09895c53b4e4fd255cb57991cb3
5
+ SHA512:
6
+ metadata.gz: 20e248bdfb9b05b168b511719faa4cd11084ee7e95cebfd146460025b40f77153f4b9735e1222f2fc3fb85047ae9d8e7f0b748e923c27383e885aa1af31fca8e
7
+ data.tar.gz: 8ca0edddbb3a38da8ab160b017aa427e375569f038263680b822cf8816b1ba49831939a6382af60b75222987a5a0a120dde45c155a6a1e2a5a474cc09690c4c0
data/.rabbit ADDED
@@ -0,0 +1 @@
1
+ PicoRuby_ep3.rab
data/PicoRuby_ep3.png ADDED
Binary file
data/PicoRuby_ep3.rab ADDED
@@ -0,0 +1,629 @@
1
+ = pico
2
+
3
+ : subtitle
4
+ ruby
5
+ : author
6
+ Episode Ⅲ\nREVENGE OF THE STDIN
7
+ : content-source
8
+ RubyWorld Conference 2022
9
+ : institution
10
+ hasumikin>&Monstarlab
11
+ : date
12
+ Nov. 10, 2022
13
+ : allotted-time
14
+ 24m
15
+ : theme
16
+ theme
17
+
18
+ = sub_chapter
19
+ Episode Ⅱ
20
+ \n
21
+ (('tag:large:ATTACK OF THE RAKE'))
22
+ \n
23
+ find on the internet
24
+ \n
25
+ == prop
26
+ : hide-title
27
+ true
28
+
29
+ = This slot has Q&A time
30
+ # image
31
+ # src = images/picoruby-t-shirt.jpg
32
+ # relative_height = 80
33
+
34
+ (('tag:center'))PicoRuby@SUZURI
35
+
36
+ = sub_chapter
37
+ (('tag:xx-large:📱'))
38
+ == prop
39
+ : hide-title
40
+ true
41
+
42
+ = PicoRuby: An alternative mruby
43
+ puts "Hello World"
44
+
45
+ * mruby = mruby VM + mruby compiler\n=> ((*136 KB*))
46
+ * MicroRuby = mruby VM + PicoRuby compiler\n=> ((*88 KB*))
47
+ * PicoRuby = mruby/c VM + PicoRuby compiler\n=> ((*11 KB*))
48
+ (('tag:center'))
49
+ (('tag:small:\\nAll measurement on 64-bit Ubuntu'))
50
+
51
+ = PicoRuby: An alternative mruby
52
+ # image
53
+ # src = images/QR_picoruby.png
54
+ # relative_height = 80
55
+
56
+ (('tag:center'))github.com/picoruby/picoruby
57
+
58
+ = PRK Firmware: Keyboard firmware
59
+ # image
60
+ # src = images/rubykaigi_2.png
61
+ # relative_height = 80
62
+
63
+ (('tag:center'))Displayed in Large exhibition hall (1F)
64
+
65
+ = PRK Firmware: Keyboard firmware
66
+ # image
67
+ # src = images/QR_prk_firmware.png
68
+ # relative_height = 80
69
+
70
+ (('tag:center'))github.com/picoruby/prk_firmware
71
+
72
+ = Raspberry Pi Pico
73
+ * RP2040
74
+ * Arm Cortex-M0+ (dual)
75
+ * 264 KB RAM
76
+ * 2 MB ROM
77
+ * (RP2040 supports upto 16 MB)
78
+ * $4~ (ï¿¥600~)
79
+ * "Pi Pico W" supports WiFi
80
+ * Got 技適 (new!)
81
+ # image
82
+ # align = right
83
+ # src = images/rp2.jpg
84
+ # relative_height = 100
85
+
86
+ = chapter
87
+ (('tag:x-large:demo'))
88
+ == prop
89
+ : hide-title
90
+ true
91
+
92
+ = Serial port terminal emulator
93
+ * Traditional CUI/TUI tools have fallen to\nthe dark side (apparently CR/LF issue)
94
+ * cu🙅
95
+ * screen😖
96
+ * minicom🤦
97
+ * Linux -> ((*GTKTerm*))😍
98
+ * Windows -> Tera Term? (not sure)
99
+ * macOS -> PuTTY? 🤷
100
+
101
+ = Summary: It's still a PoC, though...
102
+ * An integrated Micon programming environment
103
+ * Ruby compiler inside
104
+ * Shell ready
105
+ * Text editor equipped
106
+ * Your own commands available
107
+ * Accelerates developing an IoT system with Ruby
108
+
109
+ = chapter
110
+ (('tag:x-large:implementation'))
111
+ == prop
112
+ : hide-title
113
+ true
114
+
115
+ = Command: builtin and executable
116
+ * Builtin commands are implemented in shell
117
+ * cd, echo, export, pwd, type, etc.
118
+ * Executable commands are located in storage
119
+ * cat, ls, rm, vim, etc.
120
+
121
+
122
+ = Command: builtin
123
+ # enscript ruby
124
+ # picoruby/mrbgems/picoruby-shell/mrblib/command.rb
125
+ def exec(params)
126
+ args = params[1, params.length - 1]
127
+ case params[0]
128
+ when "echo"
129
+ _echo(*args)
130
+ when "type"
131
+ _type(*args)
132
+ when "pwd"
133
+ puts Dir.pwd
134
+ when "cd"
135
+ puts if Dir.chdir(args[0] || ENV['HOME']) != 0
136
+ when "free"
137
+ Object.memory_statistics.each do |k, v|
138
+ print "#{k.to_s.ljust(5)}: #{v.to_s.rjust(8)}", @feed
139
+ end
140
+
141
+ = Command: executable
142
+ # enscript sh
143
+ picoruby/mrbgems/picoruby-shell/
144
+ ├─ mrbgem.rake
145
+ ├─ mrblib
146
+ │ ├─ command.rb
147
+ │ └─ shell.rb
148
+ ├─ shell_executables 👈
149
+ │ ├─ cat.rb
150
+ │ ├─ hello.rb
151
+ │ ├─ ls.rb
152
+ │ ├─ rm.rb
153
+ │ └─ vim.rb
154
+ └─ src
155
+ └─ shell.c
156
+
157
+ # Search path
158
+ ENV["PATH"] => ["/bin"]
159
+
160
+ = Command: executable
161
+ * You can write your own executable in PicoRuby
162
+
163
+ # enscript sh
164
+ $ vim hello_ruby.rb
165
+ ```
166
+ puts "Hello RubyWorld"
167
+ ```
168
+ $ install hello_ruby.rb /bin/hello_ruby
169
+ $ hello_ruby
170
+ Hello RubyWorld
171
+
172
+
173
+ = Filesystem
174
+ * Computer has filesystem(s)
175
+ * MS-DOS: ((*M*))icro((*s*))oft ((*D*))isk ((*O*))perating ((*S*))ystem
176
+ * NTFS, ext{2,3,4}, etc.
177
+ * Micon generally doesn't have a filesystem
178
+
179
+ = FAT filesystem
180
+ * File Allocation Table (FAT)
181
+ * Developed by Microsoft along with MS-DOS
182
+ * 8-bit FAT, FAT12, FAT16, FAT32, exFAT
183
+ * Under construction for Flash ROM 😅
184
+ * Today's demo is working on RAM disk
185
+
186
+ = VFS (Virtual File System)
187
+ * VFS-like system written in PicoRuby
188
+ * Different devices and even different filesystems can mount under the root
189
+
190
+ # enscript ruby
191
+
192
+ VFS.mount(FAT.new(:flash), "/")
193
+ VFS.mount(FAT.new(:ram), "/ram")
194
+ VFS.mount(FAT.new(:sdcard), "/sdcard")
195
+
196
+ /
197
+ ├─ bin/
198
+ ├─ home/
199
+ ├─ ram/
200
+ │ └─ tmp/
201
+ ├─ sdcard/ # SPI not impemented yet
202
+ │ └─ data.sqlite
203
+
204
+ = mruby's build system
205
+ * mrbgems is a library management system for mruby
206
+ * You can freely host your own gem
207
+ * Matz says it's an advanced one (('tag:xx-small:(than MicroPython?)'))
208
+ * Bundled mgems are automatically loaded
209
+
210
+ = mruby's build system
211
+ # enscript sh
212
+ mruby
213
+ ├─ Rakefile
214
+ ├─ bin/
215
+ ├─ build/
216
+ ├─ build_config/
217
+ ├─ include/
218
+ ├─ lib/
219
+ │ └─ mruby/ # MRuby module
220
+ ├─ mrbgems/
221
+ ├─ mrblib/
222
+ ├─ src/
223
+ ├─ tasks/
224
+ │ ├─
225
+ │ ├─ mrbgems.rake
226
+ │ ├─
227
+
228
+ = PicoRuby's build system
229
+ # enscript sh
230
+ picoruby
231
+ ├─ Rakefile 👈 modified
232
+ ├─ bin/
233
+ ├─ build/
234
+ ├─ build_config/
235
+ ├─ include/
236
+ ├─ lib/
237
+ │ ├─ mruby/ # `module MRuby`
238
+ │ └─ picoruby/
239
+ │ └─ build.rb 👈 MRuby overridden
240
+ ├─ mrbgems/
241
+ ├─ mrblib/
242
+ ├─ src/
243
+ ├─ tasks/
244
+ │ ├─
245
+ │ ├─ mrbgems.rake
246
+ │ ├─
247
+ │ ├─ picogems.rake 👈 MRuby.each_target overridden
248
+ │ ├─
249
+
250
+ = PicoRuby's build system
251
+ # enscript sh
252
+ picoruby
253
+ ├─ build/repos/host/
254
+ │ ├─ mruby-bin-picorbc/ # picorbc
255
+ │ └─ mruby-pico-compiler/
256
+ ├─
257
+ ├─ mrbgems/
258
+ ├─ default.gembox
259
+ ├─ picoruby-bin-picoirb/ # picoirb
260
+ ├─ picoruby-bin-picoruby/ # picoruby
261
+ ├─ picoruby-bin-prsh/ # prsh [pəːrʃ]
262
+ ├─ picoruby-filesystem-fat/ # FAT filesystem
263
+ ├─ picoruby-io/ # io gem
264
+ ├─ picoruby-mrubyc/ # mruby/c VM
265
+ ├─ picoruby-sandbox/
266
+ ├─ picoruby-shell/
267
+ ├─ picoruby-terminal/
268
+ ├─ picoruby-vfs/
269
+ └─ picoruby-vim/
270
+
271
+ = PicoRuby's build system
272
+ # enscript ruby
273
+ # picoruby/mrbgems/default.gembox
274
+ MRuby::GemBox.new do |conf|
275
+ conf.gem github: 'picoruby/mruby-pico-compiler'
276
+ conf.gem github: 'picoruby/mruby-bin-picorbc'
277
+ conf.gem core: 'picoruby-bin-picoruby'
278
+ conf.gem core: 'picoruby-bin-picoirb'
279
+ conf.gem core: 'picoruby-mrubyc'
280
+ end
281
+
282
+ (('tag:center'))
283
+ `mruby-pico-compiler` and `mruby-bin-picorbc`
284
+ \n
285
+ can be bundled in mruby (MicroRuby)
286
+
287
+ = A typical picogem
288
+ picoruby/
289
+ └─ mrbgems/picoruby-io/
290
+ ├─ mrbgem.rake
291
+ ├─ mrblib
292
+ │ └─ io.rb
293
+ └─ src/
294
+ ├─ hal/
295
+ │ ├─ hal.h
296
+ │ └─ posix
297
+ │ └─ hal.c
298
+ └─ io.c
299
+
300
+ = `require`
301
+ * mruby doesn't have `require` out of the box
302
+ * Neither does mruby/c
303
+ * PicoRuby has introduced `require`
304
+ * Bundled Picogem code already consumed ROM, but
305
+ * It isn't loaded onto RAM automatically
306
+ * Consumes RAM only after `require`
307
+
308
+ = Making a PicoRuby app elegantly
309
+ * CRuby code compatible with PicoRuby
310
+ * PicoRuby for PC (MRBC_USE_HAL_POSIX)
311
+ * Write minimum HAL for POSIX
312
+ * Extend PicoRuby's builtin class if necessary
313
+ * Keep the app code independent from Picoruby
314
+ * ((*Do not copy and paste files any longer*))
315
+
316
+ = Keep the app code independent
317
+ # enscript sh
318
+ example-IoT-app
319
+ ├─ CMakeLists.txt # Just link src/*.c and libmruby.a
320
+ ├─ Rakefile
321
+ ├─ build
322
+ │ ├─ ...
323
+ ├─ include
324
+ │ ├─ ...
325
+ ├─ lib
326
+ │ └─ picoruby # libmruby.a created by `rake`
327
+ ├─ mrblib
328
+ │ ├─ main_task.rb
329
+ │ └─ temperature_sensor_task.rb
330
+ ├─ pico_sdk_import.cmake
331
+ └─ src
332
+ ├─ hal.c # Micon dependent hal
333
+ ├─ temperature_sensor.c
334
+ ├─ main.c
335
+ ├─ ...
336
+
337
+ = Compatible CRuby with PicoRuby
338
+ # enscript ruby
339
+ # picoruby-vim/mrblib/vim.rb
340
+ case RUBY_ENGINE
341
+ when "ruby", "jruby"
342
+ require_relative "../../picoruby-terminal/mrblib/terminal"
343
+ when "mruby/c"
344
+ require "terminal"
345
+ else
346
+ raise "Unknown RUBY_ENGINE: #{RUBY_ENGINE}"
347
+ end
348
+
349
+ class Vim
350
+ (...)
351
+ end
352
+
353
+ = Compatible CRuby with PicoRuby
354
+ (('tag:center'))
355
+ Run with CRuby on your PC, then
356
+
357
+ # enscript sh
358
+ $ ruby -r./mrbgems/picoruby-vim/mrblib/vim.rb \
359
+ -e 'Vim.new("myfile.txt").start'
360
+
361
+ (('tag:center'))
362
+ You can easily implement and debug\na "Pure" PicoRuby app with CRuby
363
+
364
+ = chapter
365
+ (('tag:x-large:demo'))
366
+ == prop
367
+ : hide-title
368
+ true
369
+
370
+ = chapter
371
+ (('tag:x-large:back to'))
372
+ \n
373
+ (('tag:x-large:implementation'))
374
+ == prop
375
+ : hide-title
376
+ true
377
+
378
+ = Shell and text editor
379
+ * Without Curses and Readline
380
+ * Pure Ruby just like Reline (irb of CRuby3.0+)
381
+
382
+ = Shell and text editor
383
+ * Without Curses and Readline
384
+ * Pure Ruby just like Reline (irb of CRuby3.0+)
385
+
386
+ (('tag:center'))
387
+ (('tag:large'))
388
+ \n
389
+ \n
390
+ ((*STDIN confuses you*))😈
391
+
392
+ = Standard INPUT
393
+ * Cooked mode ((*(by default on Unix-like OS)*))
394
+ * Blocked until submit (recall Kernel#gets)
395
+ * "a" "b" "c" "[BSPACE]" "d" "[ENTER]" => "abd"
396
+ * Raw mode ((*(obviously by default on bare metals)*))
397
+ * Immediately receives any input
398
+ * "a" "b" "c" "[BSPACE]" "d" => "abc[BSPACE]d"
399
+
400
+ (('tag:center'))
401
+ \n
402
+ Really confusing in making compatible code
403
+
404
+ = Standard INPUT
405
+ # enscript c
406
+ static struct termios save_settings;
407
+ static int save_flags;
408
+
409
+ /* Turn into raw mode on Linux (Windows has another solution) */
410
+ struct termios settings;
411
+ tcgetattr(fileno(stdin), &save_settings);
412
+ settings = save_settings;
413
+ settings.c_iflag = ~(BRKINT | ISTRIP | IXON);
414
+ settings.c_lflag = ~(ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHONL);
415
+ settings.c_cc[VMIN] = 1;
416
+ settings.c_cc[VTIME] = 0;
417
+ tcsetattr(fileno(stdin), TCSANOW, &settings);
418
+ save_flags = fcntl(fileno(stdin), F_GETFL, 0);
419
+ fcntl(fileno(stdin), F_SETFL, save_flags | O_NONBLOCK);
420
+
421
+ /* Turn back to cooked mode */
422
+ fcntl(fileno(stdin), F_SETFL, save_flags);
423
+ tcsetattr(fileno(stdin), TCSANOW, &save_settings);
424
+
425
+ = Standard INPUT
426
+ # enscript ruby
427
+ # picoruby/mrbgems/picoruby-terminal/mrblib/terminal.rb
428
+ case RUBY_ENGINE
429
+ when "ruby", "jruby"
430
+ require "io/console"
431
+
432
+ def IO.get_nonblock(max)
433
+ STDIN.noecho{ |input| input.read_nonblock(max) }
434
+ rescue IO::EAGAINWaitReadable => e
435
+ nil
436
+ end
437
+
438
+ when "mruby/c"
439
+ require "io"
440
+
441
+ def IO.get_nonblock(max)
442
+ str = read_nonblock(max) # calls C implementation
443
+ str&.length == 0 ? nil : str
444
+ end
445
+
446
+ end
447
+
448
+ = C object in RVALUE: mruby
449
+ # enscript c
450
+
451
+ #define MRB_VTYPE_FOREACH(f) \
452
+ /* mrb_vtype */ /* c type */ /* ruby class */ \
453
+ f(MRB_TT_FALSE, void, "false") \
454
+ ...
455
+ f(MRB_TT_OBJECT, struct RObject, "Object") \
456
+ ...
457
+ f(MRB_TT_DATA, struct RData, "Data") \ // 👈
458
+ ...
459
+
460
+ struct RData {
461
+ MRB_OBJECT_HEADER;
462
+ struct iv_tbl *iv;
463
+ const mrb_data_type *type;
464
+ void *data; // 👈 You can pin any object here
465
+ };
466
+
467
+ = C object in RVALUE: mruby((*/c*))
468
+ # enscript c
469
+
470
+ typedef struct RInstance {
471
+ MRBC_OBJECT_HEADER;
472
+ struct RClass *cls;
473
+ struct RKeyValueHandle ivar;
474
+ uint8_t data[]; // 👈 The last member can extend
475
+ } mrbc_instance;
476
+ // File.new
477
+ mrbc_value obj = mrbc_instance_new(vm, v->cls, sizeof(FIL));
478
+ // ^^^^^^^^^^^
479
+ // extend RVALUE
480
+ FIL *file_stream_ptr = (FIL *)obj.instance->data;
481
+ SET_RETURN(obj); // File.new => #<File:200098a0>
482
+
483
+ (('tag:center'))No need to `free(file_stream_ptr);`
484
+
485
+ = sub_chapter
486
+ (('tag:large'))
487
+ Finally, the shell works🎉
488
+ == prop
489
+ : hide-title
490
+ true
491
+
492
+ = sub_chapter
493
+ (('tag:large:By the way,'))
494
+ == prop
495
+ : hide-title
496
+ true
497
+
498
+ = sub_chapter
499
+ (('tag:large:How should I name\\nthis product'))🤔
500
+ == prop
501
+ : hide-title
502
+ true
503
+
504
+ = sub_chapter
505
+ (('tag:large:Ruby on Raspberry Pi Pico'))
506
+ == prop
507
+ : hide-title
508
+ true
509
+
510
+ = sub_chapter
511
+ (('tag:large:((*R*))uby on ((*R*))aspberry ((*P*))i ((*P*))ico'))
512
+ == prop
513
+ : hide-title
514
+ true
515
+
516
+ = chapter
517
+ (('tag:xx-large:r2-p2'))
518
+ == prop
519
+ : hide-title
520
+ true
521
+
522
+ = chapter
523
+ # image
524
+ # src = images/R2D2_mosaic.png
525
+ # relative_height = 100
526
+ == prop
527
+ : hide-title
528
+ true
529
+
530
+ = chapter
531
+ (('tag:xx-large:r2((*-*))p2'))
532
+ == prop
533
+ : hide-title
534
+ true
535
+
536
+ = cite
537
+ # blockquote
538
+ # title = @kakutani
539
+ \n
540
+ “It is said that (account) names
541
+ \n
542
+ should not contain
543
+ \n
544
+ hyphens or underscores.”
545
+ \n\n
546
+ == prop
547
+ : hide-title
548
+ true
549
+
550
+ = chapter
551
+ (('tag:xx-large:r2((*-*))p2'))
552
+ == prop
553
+ : hide-title
554
+ true
555
+
556
+ = chapter
557
+ (('tag:xx-large:r2p2'))
558
+ == prop
559
+ : hide-title
560
+ true
561
+
562
+ = sub_chapter
563
+ Be one the first stargazers of
564
+ \n
565
+ (('tag:large:github.com/picoruby/R2P2'))
566
+ \n
567
+ (turned public repo today!)
568
+ == prop
569
+ : hide-title
570
+ true
571
+
572
+ = Wrap-up
573
+ * R2P2 is an all-in-one programming Micon
574
+
575
+ = Wrap-up
576
+ * R2P2 is an all-in-one programming Micon
577
+ * Runs on Raspi Pico which has 264 KB RAM and 2 MB ROM
578
+
579
+ = Wrap-up
580
+ * R2P2 is an all-in-one programming Micon
581
+ * Runs on Raspi Pico which has 264 KB RAM and 2 MB ROM
582
+ * Picogem ecosystem easily builds your app
583
+
584
+ = Wrap-up
585
+ * R2P2 is an all-in-one programming Micon
586
+ * Runs on Raspi Pico which has 264 KB RAM and 2 MB ROM
587
+ * Picogem ecosystem easily builds your app
588
+ * Filesystem ly makes you happy
589
+ * Filesystem will make you happy
590
+
591
+ = Wrap-up
592
+ * R2P2 is an all-in-one programming Micon
593
+ * Runs on Raspi Pico which has 264 KB RAM and 2 MB ROM
594
+ * Picogem ecosystem easily builds your app
595
+ * Filesystem will make you happy
596
+ * STDIN is evil
597
+
598
+ = Future work
599
+ * PicoRuby and Shell
600
+ * More functionality of vim and the name
601
+ * UTF-8 support
602
+ * Multi-task controll on the fly
603
+ * Redirect and pipeline
604
+ * Peripherals
605
+ * FAT filesystem with SD card (SPI)
606
+ * Real-time clock (RTC)
607
+ * WiFi and TCP/IP on Raspberry Pi Pico W
608
+
609
+ = chapter
610
+ (('tag:xx-large:q'))
611
+ (('tag:x-large:and'))
612
+ (('tag:xx-large:a'))
613
+ # image
614
+ # src = images/QR_R2P2.png
615
+ # relative_height = 80
616
+ (('tag:center'))github.com/picoruby/r2p2
617
+ == prop
618
+ : hide-title
619
+ true
620
+
621
+ = chapter
622
+ (('tag:x-large:may the'))
623
+ \n
624
+ (('tag:xx-large:source'))
625
+ \n
626
+ (('tag:x-large:be with you'))
627
+ == prop
628
+ : hide-title
629
+ true
data/README.rd ADDED
@@ -0,0 +1,24 @@
1
+ = PicoRuby epsode 3
2
+
3
+ Presentation slide for RubyWorld Conference 2022
4
+
5
+ == For author
6
+
7
+ === Show
8
+
9
+ rake
10
+
11
+ === Publish
12
+
13
+ rake publish
14
+
15
+ == For viewers
16
+
17
+ === Install
18
+
19
+ gem install rabbit-slide-hasumikin-RubyWorldConference2022
20
+
21
+ === Show
22
+
23
+ rabbit rabbit-slide-hasumikin-RubyWorldConference2022.gem
24
+
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require "rabbit/task/slide"
2
+
3
+ # Edit ./config.yaml to customize meta data
4
+
5
+ spec = nil
6
+ Rabbit::Task::Slide.new do |task|
7
+ spec = task.spec
8
+ # spec.files += Dir.glob("doc/**/*.*")
9
+ # spec.files -= Dir.glob("private/**/*.*")
10
+ # spec.add_runtime_dependency("rabbit-theme-YOUR-THEME")
11
+ end
12
+
13
+ desc "Tag #{spec.version}"
14
+ task :tag do
15
+ sh("git", "tag", "-a", spec.version.to_s, "-m", "Publish #{spec.version}")
16
+ sh("git", "push", "--tags")
17
+ end
data/config.yaml ADDED
@@ -0,0 +1,24 @@
1
+ ---
2
+ id: RubyWorldConference2022
3
+ base_name: PicoRuby_ep3
4
+ tags:
5
+ - PicoRuby
6
+ - Shell
7
+ - Filesystem
8
+ presentation_date: '2022-11-10'
9
+ presentation_start_time:
10
+ presentation_end_time:
11
+ version: 2022.11.10.0
12
+ licenses: ["MIT License"]
13
+ slideshare_id:
14
+ speaker_deck_id:
15
+ ustream_id:
16
+ vimeo_id:
17
+ youtube_id:
18
+ author:
19
+ markup_language: :rd
20
+ name: HASUMI Hitoshi
21
+ email: hasumikin@gmail.com
22
+ rubygems_user: hasumikin
23
+ slideshare_user:
24
+ speaker_deck_user:
Binary file
Binary file
Binary file
data/images/R2D2.jpg ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
data/images/hasumi.jpg ADDED
Binary file
data/images/mark_g.png ADDED
Binary file
data/images/mark_y.png ADDED
Binary file
data/images/matz.jpg ADDED
Binary file
Binary file
data/images/rp2.jpg ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,127 @@
1
+ 以下すべて、スライドに書かれるとは限りませんが、発表の中で言う可能性があります
2
+
3
+ ## 一見すると一般名詞だが、ソフトウェア用語(固有名詞)であるもの
4
+
5
+ - Lemon
6
+ - Bison
7
+ - Rails
8
+ - gem
9
+ - library
10
+ - steep
11
+ - terminal
12
+ - shell
13
+ - fish(shellの一種)
14
+ - thread
15
+ - fiber
16
+ - task
17
+ - builtin
18
+ - executable(実行ファイルのこと)
19
+ - null
20
+ - nil
21
+ - true
22
+ - false
23
+ - array
24
+ - string
25
+ - hash
26
+
27
+ ちなみにこれらは他のセッションでも頻出すると思います。
28
+ 英語セッションを日本語へ通訳するときは、すべてそのまま発声すればよいです。
29
+ たとえばgemを宝石と訳すとNGで、たんにジェムと言えばよいです
30
+
31
+ ## そのほか登場する可能性のある専門用語
32
+
33
+ カッコ内は発音。書いていない場合は単にアルファベット読みすればOK
34
+
35
+ ### ハードウェア用語
36
+
37
+ - MCU
38
+ - CPU
39
+ - Cortex m0+ (コーテクスエムゼロプラス)
40
+ - Cortex m4などのバリエーションあり
41
+ - LED
42
+ - 以下をまとめてperipheralと言うことがあります。マイコン用語です
43
+ - GPIO
44
+ - ADC(アナログ→デジタルコンバータのこと)
45
+ - DAC(↑の逆)
46
+ - SPI
47
+ - I2C(アイスクエアドスィー)
48
+
49
+ ### ソフトウェア用語
50
+
51
+ - RBS
52
+ - GUI(ジーユーアイ。グイでも通じます)
53
+ - CUI
54
+ - TUI
55
+ - IREP(アイレップ。internal representation = 内部表現)
56
+ - VM(たんにヴィーエムと言っても通じますが、virtual machineと言い換える方がいいかもしれません)
57
+ - VM code
58
+ - RVALUE(アールヴァリュー。Rubyにおける値の内部表現)
59
+ - Rake(レイク。ビルドシステムの一種)
60
+ - Make(メイク。ビルドシステムの一種)
61
+ - CMake(シーメイク。ビルドシステムの一種)
62
+ - mrbgem(エムアールビージェム。mgemエムジェムと言うこともあり、同じ意味)
63
+ - picogem(ピコジェム)
64
+ - 以上の3つは単数形で言ったり複数形で言ったりします。単数形は特定のgemを指し、複数形はその仕組み全体を指します
65
+ - POSIX(パズィクス。OSの仕様の一種)
66
+ - FAT(ファットまたはエフエーティー。ファイルシステムの一種。FAT12、FAT16、FAT32という3種類のバリエーションあり)
67
+
68
+ ### 個別のソフトウェア名称
69
+
70
+ - Rubygem(ルビージェム)
71
+ - Ruby on Rails(ルビーオンレイルズ。これが単数形になることは決してありません)
72
+ - IRB(バリエーションにMIRB、PicoIRBがあります)
73
+ - vim(ヴィム)
74
+ - emacs(イーマクス)
75
+ - textbringer(テクストブリンガ)
76
+ - SQLite(エスキューライト)
77
+ - YACC(ヤック。Lemonの仲間)
78
+ - sh(シェル。shellとおなじ)
79
+ - bash(バッシュ。shellの一種)
80
+ - zsh(ズィーシェル。shellの一種)
81
+ - Curses(カースィズ)
82
+ - Readline(リードライン)
83
+ - Git(ギット)
84
+ - libc(リブシー)
85
+
86
+ ### OS
87
+
88
+ - Android
89
+ - iOS
90
+ - macOS
91
+ - MS-DOS
92
+ - Linux(リーヌクス)
93
+ - Ubuntu(ウブントゥ)
94
+
95
+ ### Webサービス
96
+
97
+ - GitHub(ギットハブ)
98
+ - GitLab(ギットラブ)
99
+
100
+ ## シェルコマンド
101
+
102
+ 基本的にそのままアルファベット読みすればよいです。
103
+ カッコ内に意味を書きます
104
+
105
+ - cd (change directory。ワーキングディレクトリを変更する)
106
+ - pwd (print working directory。現在のワーキングディレクトリのパスを表示する)
107
+ - ls (list。ファイルのリストを表示する)
108
+ - mv (moveファイルの場所や名前を変更する)
109
+ - cat(concatenate = 連結。「キャット」と発音することが多い)
110
+
111
+ ## 適切な翻訳がある日本語
112
+
113
+ - 規約 -> convention
114
+ - 構造体 -> Struct(ストラクト)。IREP構造体、mrb構造体のように使う
115
+ - (キーボードが)「割れてる」やつ -> Split type keyboard
116
+ - ラズパイ -> Raspberry Pi(ラズベリーパイ)
117
+ - ラズパイピコまたはラズピコ -> Raspberry Pi Pico(ラズベリーパイピコ)
118
+ - ラズパイ財団 -> Raspberry Pi Foundation
119
+ - マイコン -> Microcontroller(Microcomputerではないので注意)
120
+ - RP2040 -> RP-twenty-forty
121
+ - ウブンツ -> Ubuntu(ウブントゥ)
122
+ - 標準入力 -> Standard input
123
+ - 標準出力 -> Standard output
124
+ - 標準入出力 -> Standard IO(アイオー)。STDIO(エスティーディーアイオーとも)
125
+ - GCされる -> being garbage collected
126
+ - 静的型 -> Static typing
127
+ - 型チェック -> Type check
@@ -0,0 +1,13 @@
1
+ = たのしいマイコンRuby
2
+
3
+ : author
4
+ 羽角 均
5
+ : content-source
6
+ RubyWorld Conference 2022
7
+ : institution
8
+ Monstarlab
9
+ : date
10
+ Nov. 10, 2022
11
+ : theme
12
+ tanoshiimiconruby_theme
13
+
data/theme.rb ADDED
@@ -0,0 +1,176 @@
1
+ # puts font_families.sort
2
+ @xxx_large_font_size = screen_size(22 * Pango::SCALE)
3
+ @xx_large_font_size = screen_size(18 * Pango::SCALE)
4
+ @x_large_font_size = screen_size(11 * Pango::SCALE)
5
+ @large_font_size = screen_size(7.5 * Pango::SCALE)
6
+ @normal_font_size = screen_size(5 * Pango::SCALE)
7
+ @small_font_size = screen_size(4.5 * Pango::SCALE)
8
+ @x_small_font_size = screen_size(3.5 * Pango::SCALE)
9
+ @xx_small_font_size = screen_size(3 * Pango::SCALE)
10
+
11
+ @font_family = find_font_family('Franklin Gothic Medium')
12
+ @monospace_font_family = 'Ricty Discord'
13
+ @title_font_family = find_font_family('Star Jedi Hollow')
14
+
15
+ @default_headline_line_color = '#ffff00'
16
+ @default_headline_line_width = 2
17
+ @default_headline_line_expand = false
18
+
19
+ @default_emphasis_color = "#ff0000"
20
+ @default_emphasis_level2_color = "#ffffff"
21
+
22
+ set_graffiti_color "#FF2B22"
23
+ set_graffiti_line_width 5
24
+
25
+ #@table_frame_color = "#ffffff"
26
+ #@table_fill_color = "#0f0428"
27
+ #@table_body_frame_color = "#ffffff"
28
+ #@table_body_fill_color = "#3f3468"
29
+ #@table_head_frame_color = "#ffffff"
30
+ #@table_head_fill_color = "#rf0428"
31
+
32
+ @preformatted_fill_color = '#000000'
33
+ # @preformatted_centering = true
34
+ @space = screen_y(1)
35
+
36
+ # @margin_left = 300
37
+
38
+ @image_slide_number_start_flag_color = "#53575a"
39
+ @image_slide_number_goal_flag_color = "#a81313"
40
+
41
+ #@slide_headline_hide = true
42
+
43
+ @slide_background_image = 'images/star-background.jpg'
44
+ include_theme("slide-background-image")
45
+
46
+ @title_slide_background_image = 'images/star-background.jpg'
47
+ include_theme("title-slide-background-image")
48
+
49
+ include_theme('default')
50
+
51
+ match(Slide, HeadLine) do |heads|
52
+ #heads.prop_set("size", 0)
53
+ heads.prop_set("weight", "normal")
54
+ set_font_family(heads)
55
+ end
56
+ match(Slide) do |slides|
57
+ slides.prop_set("foreground", "#ffff00")
58
+ end
59
+
60
+ match TitleSlide do |slides|
61
+ slides.margin_left = @margin_right
62
+ slides.prop_set("foreground", "#ffff00")
63
+ end
64
+ match TitleSlide, Title do |title|
65
+ title.margin_top = -120
66
+ title.prop_set "size", @xxx_large_font_size
67
+ title.prop_set "font-family", @title_font_family
68
+ title.prop_set "weight", "normal"
69
+ end
70
+ match TitleSlide, Subtitle do |subtitle|
71
+ subtitle.margin_top = -290
72
+ subtitle.prop_set "size", @xxx_large_font_size
73
+ subtitle.prop_set "font-family", @title_font_family
74
+ end
75
+ match TitleSlide, Author do |authors|
76
+ authors.margin_top = -70
77
+ end
78
+ match TitleSlide, ContentSource do |cs|
79
+ cs.margin_top = 0
80
+ cs.prop_set "size", @xx_small_font_size
81
+ cs.prop_set "style", "normal"
82
+ end
83
+ match TitleSlide, Date do |date|
84
+ date.prop_set "size", @xx_small_font_size
85
+ date.prop_set "style", "normal"
86
+ end
87
+ match TitleSlide, Institution do |i|
88
+ i.prop_set "size", @xx_small_font_size
89
+ i.prop_set "style", "normal"
90
+ end
91
+
92
+ #@slide_logo_image = 'images/mark_g.png'
93
+ #include_theme('slide-logo')
94
+
95
+ @item_image_1 = 'images/r2d2_icon-icons.com_76952.png'
96
+ @item_image_2 = 'images/c3p0_icon-icons.com_76936.png'
97
+ @item_image_3 = 'images/ewok_icon-icons.com_76943.png'
98
+
99
+ include_theme("default-item-mark")
100
+
101
+ add_image_path("rabbit-images")
102
+
103
+ slide_body = [Slide, Body]
104
+ item_list_item = [ItemList, ItemListItem]
105
+
106
+ indent = 50
107
+
108
+ match(*(slide_body + (item_list_item * 1))) do |items|
109
+ name = "item1"
110
+ items.delete_pre_draw_proc_by_name(name)
111
+ items.delete_post_draw_proc_by_name(name)
112
+ draw_image_mark(items, @item_image_1, name, indent: indent)
113
+ end
114
+
115
+ match(*(slide_body + (item_list_item * 2))) do |items|
116
+ name = "item2"
117
+ items.delete_pre_draw_proc_by_name(name)
118
+ items.delete_post_draw_proc_by_name(name)
119
+ draw_image_mark(items, @item_image_2, name, indent: indent)
120
+ end
121
+
122
+ match(*(slide_body + (item_list_item * 3))) do |items|
123
+ name = "item3"
124
+ items.delete_pre_draw_proc_by_name(name)
125
+ items.delete_post_draw_proc_by_name(name)
126
+ draw_image_mark(items, @item_image_3, name, indent: indent)
127
+ end
128
+
129
+ enum_list_item = [EnumList, EnumListItem]
130
+
131
+ match(*(slide_body + enum_list_item + item_list_item)) do |items|
132
+ name = "enum-item1"
133
+ items.delete_pre_draw_proc_by_name(name)
134
+ items.delete_post_draw_proc_by_name(name)
135
+ draw_image_mark(items, @item_image_1, name, indent: indent)
136
+ end
137
+
138
+ match(*(slide_body + enum_list_item + (item_list_item * 2))) do |items|
139
+ name = "enum-item2"
140
+ items.delete_pre_draw_proc_by_name(name)
141
+ items.delete_post_draw_proc_by_name(name)
142
+ draw_image_mark(items, @item_image_2, name, indent: indent)
143
+ end
144
+
145
+ # table
146
+ all_table = ["**", Table]
147
+ match(*(all_table + [TableBody, TableRow, TableCell])) do |cells|
148
+ set_font_family(cells, @monospace_font_family)
149
+ end
150
+ match(*(all_table + [TableHead, TableRow, TableHeader])) do |headers|
151
+ set_font_family(headers, @monospace_font_family)
152
+ end
153
+
154
+ match("**", Emphasis, Emphasis) do |texts|
155
+ texts.prop_set("foreground", @default_emphasis_level2_color)
156
+ texts.prop_set("weight", "normal")
157
+ end
158
+
159
+ # Chapter
160
+ match Slide do |slides|
161
+ slides.each do |slide|
162
+ if slide.match?(/sub_chapter/)
163
+ slide.horizontal_centering = true
164
+ elsif slide.match?(/chapter/)
165
+ set_font_family slide, @title_font_family
166
+ slide.horizontal_centering = true
167
+ elsif slide.match?(/cite/)
168
+ slide.prop_set "foreground", "#222222"
169
+ slide.horizontal_centering = true
170
+ end
171
+ end
172
+ end
173
+
174
+ match("**", PreformattedBlock) do |blocks|
175
+ blocks.prop_set("foreground", "#00FFAF")
176
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rabbit-slide-hasumikin-RubyWorldConference2022
3
+ version: !ruby/object:Gem::Version
4
+ version: 2022.11.10.0
5
+ platform: ruby
6
+ authors:
7
+ - HASUMI Hitoshi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rabbit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.2
27
+ description: Presentation slide for RubyWorld Conference 2022
28
+ email:
29
+ - hasumikin@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rabbit"
35
+ - PicoRuby_ep3.png
36
+ - PicoRuby_ep3.rab
37
+ - README.rd
38
+ - Rakefile
39
+ - config.yaml
40
+ - images/Monstarlab_Logo_Grey_CMYK.png
41
+ - images/Monstarlab_Logo_Yellow_CMYK.png
42
+ - images/QR_R2P2.png
43
+ - images/QR_picoruby.png
44
+ - images/QR_prk_firmware.png
45
+ - images/R2D2.jpg
46
+ - images/R2D2_mosaic.png
47
+ - images/architecture_1.png
48
+ - images/architecture_2.png
49
+ - images/architecture_3.png
50
+ - images/c3p0_icon-icons.com_76936.png
51
+ - images/ewok_icon-icons.com_76943.png
52
+ - images/hasumi.jpg
53
+ - images/mark_g.png
54
+ - images/mark_y.png
55
+ - images/matz.jpg
56
+ - images/picoruby-t-shirt.jpg
57
+ - images/r2d2_icon-icons.com_76952.png
58
+ - images/rp2.jpg
59
+ - images/rubyconf_1.png
60
+ - images/rubyconf_2.png
61
+ - images/rubykaigi_1.png
62
+ - images/rubykaigi_2.png
63
+ - images/star-background.jpg
64
+ - images/title-background.png
65
+ - memo_同時通訳用語集.md
66
+ - pdf/RubyWorldConference2022-PicoRuby_ep3.pdf
67
+ - tanoshiimiconruby.rab
68
+ - theme.rb
69
+ homepage: https://slide.rabbit-shocker.org/authors/hasumikin/RubyWorldConference2022/
70
+ licenses:
71
+ - MIT License
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.3.7
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: PicoRuby epsode 3
92
+ test_files: []