rabbit-slide-hasumikin-RAGrant2020Report 2021.7.6.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: 9f0464412e831ba3fdfb85be50f3713f764f230cb3cab2419b573e26fb03addc
4
+ data.tar.gz: c75133723e5235cca05cdb37bd1dc152f70b70fbf9d2844fb987e219d04d0f60
5
+ SHA512:
6
+ metadata.gz: e10c3aaa782050eaa65f37bf7f3065112be49a9b3150a81bf175cfb48e8e461e8ce301355d01ac303768d2b827b317bec2a37359338da8f1a4724e88a239d2d6
7
+ data.tar.gz: fbc4c4cb869e4aa13ee5e0fda60c6ac213b46aaf1b07899eb08390282dc88eeb9d52103b34bce45362a4696d550265dffb730ae3dcf1f15f109ee409dac5414f
data/.rabbit ADDED
@@ -0,0 +1 @@
1
+ PicoRubyCompiler.rab
@@ -0,0 +1,673 @@
1
+ = PicoRuby Compiler
2
+
3
+ : author
4
+ Monstarlab
5
+ : content-source
6
+ Ruby Association Grant 2020 Report
7
+ : date
8
+ July 6, 2021
9
+ : allotted-time
10
+ 30m
11
+ : theme
12
+ theme
13
+
14
+ = We are
15
+ * Monstarlab
16
+ * Established in 2006
17
+ * 85 Million USD of Capital (Nov. 2020)
18
+ * 1200+ Members in 25 Cities, 16 Countries
19
+ * Full-Time Remoties in Japan even before the pandemic
20
+ * Now Hiring! Reach out to me👦
21
+
22
+ = ((* *))
23
+ # image
24
+ # src = images/monstarlab.png
25
+ # relative_width = 110
26
+ # relative_margin_top = -3
27
+ == prop
28
+ : hide-title
29
+ true
30
+
31
+ = I am
32
+ * HASUMI Hitoshi
33
+ * Shimane development branch
34
+ * hasumikin@GitHub
35
+ * hasumikin@Twitter
36
+ * 🙅hasumin(はすみん)
37
+ * 🙆hasumikin(はすみきん)
38
+ # image
39
+ # src = images/hasumi.jpg
40
+ # align = right
41
+ # relative-height = 70
42
+ # relative_margin_left = 0
43
+
44
+ = chapter
45
+ (('tag:center'))
46
+ \n\n\n
47
+ (('tag:xx-large:PicoRuby Compiler'))\n\n
48
+ (('tag:xx-large:Why? What?'))
49
+ == prop
50
+ : hide-title
51
+ true
52
+ : background-image
53
+ images/gray-background.png
54
+ : background-image-relative-width
55
+ 100
56
+ : background-image-relative-height
57
+ 100
58
+
59
+ = Ruby for embedded system
60
+ # image
61
+ # src = images/architecture_2.png
62
+ # relative_width = 100
63
+ # relative_margin_top = 0
64
+
65
+ = Ruby for embedded system
66
+ # image
67
+ # src = images/architecture_3.png
68
+ # relative_width = 100
69
+ # relative_margin_top = 0
70
+ (('tag:center'))
71
+ Doesn't make sense 🤔
72
+
73
+ = Why doesn't make sense?
74
+ * mruby-compiler depends on mruby (mrb_state)
75
+ * You can use mruby VM if you use mruby-compiler
76
+ * However, mruby requires bigger RAM than mruby/c
77
+ * OK,
78
+
79
+ = Ruby for embedded system
80
+ # image
81
+ # src = images/architecture_3.png
82
+ # relative_width = 100
83
+ # relative_margin_top = 0
84
+ (('tag:center'))
85
+ Doesn't make sense 🤔
86
+
87
+ = Ruby for embedded system
88
+ # image
89
+ # src = images/architecture_1.png
90
+ # relative_width = 100
91
+ # relative_margin_top = 0
92
+ (('tag:center'))
93
+ PicoRuby Compiler for one-chip microcontrollers 💪
94
+
95
+ = PicoRuby Compiler on microcontrollers❓
96
+ * REPL
97
+ * Debugging on an actual device
98
+ * One stop solution
99
+ * For newbies, education, Smalruby etc.
100
+ * Just for fun 😊
101
+
102
+ # image
103
+ # src = images/hatti.png
104
+ # align = right
105
+ # relative-height = 70
106
+ # relative_margin_left = 10
107
+
108
+ (('tag:right'))\n\n
109
+ (('tag:xx-small:Copyright © Hikari Arakawa (Ruby Programming Shounendan and Smalruby) 2013'))
110
+
111
+ = chapter
112
+ (('tag:center'))
113
+ \n\n
114
+ (('tag:xx-large:PicoRuby Compiler'))\n\n
115
+ (('tag:xx-large:History'))\n\n
116
+ (('tag:large:July 2019 -'))
117
+ == prop
118
+ : hide-title
119
+ true
120
+ : background-image
121
+ images/gray-background.png
122
+ : background-image-relative-width
123
+ 100
124
+ : background-image-relative-height
125
+ 100
126
+
127
+ = ((* *))
128
+ == prop
129
+ : hide-title
130
+ true
131
+ : background-image
132
+ images/osaka.jpg
133
+ : background-image-relative-width
134
+ 100
135
+
136
+ = ((* *))
137
+ (('tag:center'))
138
+ \n\n
139
+ "Lemon would generate smaller binary than Bison."
140
+ \n\n
141
+ == prop
142
+ : hide-title
143
+ true
144
+ : background-image
145
+ images/matz.jpg
146
+ : background-image-relative-width
147
+ 20
148
+
149
+ = ((* *))
150
+ # image
151
+ # src = images/ToyamaRubyKaigi01.png
152
+ # relative_width = 90
153
+ # relative_margin_top = -2
154
+ == prop
155
+ : hide-title
156
+ true
157
+
158
+ = github.com/hasumikin/mmrbc.gem
159
+ * mini mruby compiler
160
+ * Tokenizer and Generator
161
+ * CRuby
162
+ * Parser
163
+ * C (Lemon) + ffi gem
164
+ * Able to compile only `puts "Hello World!"`
165
+ * `[Identifier] "[String literal]"`
166
+
167
+ = chapter
168
+ (('tag:center'))
169
+ \n\n\n
170
+ (('tag:large:Jan 2020 -'))\n\n
171
+ (('tag:large:Writing `mmruby` in C'))\n\n
172
+ (('tag:large:then, `mv mmruby picoruby`'))
173
+ == prop
174
+ : hide-title
175
+ true
176
+ : background-image
177
+ images/gray-background.png
178
+ : background-image-relative-width
179
+ 100
180
+ : background-image-relative-height
181
+ 100
182
+
183
+ = chapter
184
+ (('tag:center'))
185
+ \n\n\n
186
+ (('tag:xx-large:RA Grant'))\n\n
187
+ (('tag:xx-large:Outcome'))
188
+ == prop
189
+ : hide-title
190
+ true
191
+ : background-image
192
+ images/gray-background.png
193
+ : background-image-relative-width
194
+ 100
195
+ : background-image-relative-height
196
+ 100
197
+
198
+ = Goals
199
+ * Sufficient portion of the Ruby syntax to write IoT firmware
200
+ * Reduce RAM usage to execute on microcontrollers
201
+
202
+ = Syntax - before RA Grant
203
+ # enscript ruby
204
+ # larger_script.rb
205
+ ary = Array.new(3)
206
+ ary[0] = {a: 123e2}
207
+ ary[0][:key] = "string"
208
+ ary[1] = %w(abc ABC Hello)
209
+ ary[2] = 0x1f
210
+ ary[3] = !true
211
+ puts "my name is #{self.class}, result is #{ary[2] * ary[0][:a]}"
212
+ p ary
213
+
214
+ => my name is Object, result is 381300
215
+ [{:a=>12300, :key=>"string"}, ["abc", "ABC", "Hello"], 31, false]
216
+
217
+
218
+ (('tag:center'))
219
+ class, def, return, block, if/unless, case-when,\n
220
+ while/until, break, etc were unimplemented yet
221
+
222
+ = Syntax - after RA Grant
223
+ # image
224
+ # src = images/keyboard.rb.png
225
+ # relative_width = 100
226
+
227
+ = RAM consumption
228
+ $ valgrind \
229
+ --tool=massif \
230
+ --stacks=yes \
231
+ path/to/(mrbc|picorbc) \
232
+ source.rb
233
+
234
+ $ ms_print massif.out.xxx | less
235
+
236
+
237
+ = RAM consumption
238
+ ----------------------------------------------------------------------------------
239
+ Command: ../picoruby/build/host-production/bin/picorbc larger_script.rb
240
+ Massif arguments: --stacks=yes
241
+ ms_print arguments: massif.out.13414
242
+ ----------------------------------------------------------------------------------
243
+ KB
244
+ 53.20^ #
245
+ | #
246
+ | @# :::
247
+ | @# : :
248
+ | @# : :
249
+ | @@# : :
250
+ | @@# :: :
251
+ | @@#::: :
252
+ | @@#::: :
253
+ | @@::@@#::: :
254
+ | @@: @@#::: :
255
+ | @@:@:::@::::@@: @@#::: ::
256
+ | @::@::@ :@:: @:: :@@: @@#::: ::
257
+ | @:::@@@:@::@: @ :@:: @:: :@@: @@#::: ::
258
+ | @@:@::@:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
259
+ | ::@@@ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
260
+ | :::::: :::::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
261
+ | :::::@@:: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
262
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
263
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
264
+ 0 +----------------------------------------------------------------------->Mi
265
+ 0 1.616
266
+
267
+ = RAM consumption
268
+ # before Grant after Grant
269
+ mrbc picorbc mrbc(3.0.0) picorbc
270
+ ==================================================================
271
+ puts "Hello World!" 157.8 KB 11.17 KB 133.6 KB 15.43 KB
272
+ ------------------------------------------------------------------
273
+ larger_script.rb 162.9 KB 53.20 KB 135.2 KB 24.21 KB
274
+
275
+ * Note:
276
+ * using glibc and Linux file system
277
+ * on 64-bit architecture
278
+ * All figures should possibly be about 35% smaller on 32-bit
279
+
280
+ = RAM consumption
281
+ # before Grant after Grant
282
+ mrbc picorbc mrbc(3.0.0) picorbc
283
+ ==================================================================
284
+ puts "Hello World!" 157.8 KB 11.17 KB 133.6 KB 15.43 KB
285
+ ------------------------------------------------------------------
286
+ larger_script.rb 162.9 KB 53.20 KB 135.2 KB 24.21 KB
287
+
288
+ * picorbc made a great progress on larger_script.rb 🎉
289
+ * 53.20 KB -> 24.21 KB
290
+ * but got worse on `puts "Hello World!"`
291
+ * 11.17 KB -> 15.43 KB ...🤔What happened?
292
+
293
+ = chapter
294
+ (('tag:center'))
295
+ \n\n\n
296
+ (('tag:xx-large:PicoRuby Compiler'))\n\n
297
+ (('tag:xx-large:What happened?'))
298
+ == prop
299
+ : hide-title
300
+ true
301
+ : background-image
302
+ images/gray-background.png
303
+ : background-image-relative-width
304
+ 100
305
+ : background-image-relative-height
306
+ 100
307
+
308
+ = What happened?
309
+ * 1. Reusing literal data as much as possible
310
+ * 2. Pooled allocation
311
+ * 3. Freeing in loop instead of recursion
312
+
313
+ = Reusing literal data as much as possible
314
+ * There were many wasteful, duplicated memory allocations of literal data
315
+ * eg) Reallocates memory when Tokenizer gives data to Parser
316
+ * Refactored the code to keep data common in a compilation cycle as much as possible
317
+ * eg) Token data puts on memory should be reused as it is until exactly before generating VM code
318
+
319
+ = Reusing literal data as much as possible
320
+ # enscript ruby
321
+
322
+ array[0] = :data
323
+
324
+ * Tokens
325
+ * `array`, `[`, `0`, `]`, `=`, `:`, `data`
326
+ * Method name should be `[]=`, but where? how?
327
+ * Thus, some literal data should be exceptional
328
+ * Kind of a strategic decision
329
+
330
+ = Padding in a struct
331
+ # enscript c
332
+ struct LinkedList {
333
+ struct LinkedList *next; // 4 bytes (in 32-bit architecture)
334
+ uint8_t value; // 1 byte
335
+ }
336
+
337
+ sizeof(LinkedList);
338
+ => 5 🙅
339
+ => 8 🙆
340
+
341
+ (('tag:center'))
342
+ ✔Data structure alignment (at least in C99)\n
343
+ pointer[4] + uint8_t[1] + ((*padding[3]*)) = sum[8]\n
344
+ 👉You need to pack them well
345
+
346
+ = Pooled allocation
347
+ # enscript c
348
+ LinkedList *top;
349
+ (...)
350
+ top->next->next->next->next; // 5 items in the list
351
+
352
+ * Consumes 40 bytes to store 5 values of uint8_t
353
+ * Total size of pointers will be 1 KB if there are 250 items in a list
354
+
355
+ (('tag:center'))
356
+ \nPooled allocation 💡
357
+
358
+ = Pooled allocation
359
+ # enscript c
360
+ typedef struct node_pool {
361
+ NodePool *next;
362
+ uint16_t size;
363
+ uint16_t index;
364
+ Node *nodes;
365
+ } NodePool;
366
+
367
+ NodePool *newNodePool() {
368
+ size_t size = sizeof(NodePool) + sizeof(Node) * POOL_SIZE;
369
+ NodePool *node_pool = (NodePool *)alloc(size);
370
+ memset(node_pool, 0, size);
371
+ node_pool->next = NULL;
372
+ node_pool->size = POOL_SIZE;
373
+ node_pool->index = 0;
374
+ return node_pool;
375
+ }
376
+
377
+ /* node_pool.nodes[index] */
378
+ (Node *)((Node *)(&node_pool->nodes) + node_pool->index);
379
+
380
+ = Pooled allocation
381
+ # enscript bash
382
+ [n]: bytes
383
+
384
+ *next[4] -----------> *next[4] -----------> *next[4] ------------>
385
+ size[2] size[2] size[2]
386
+ index[2] index[2] index[2]
387
+ node[sizeof(Node)] node[sizeof(Node)] node[sizeof(Node)]
388
+ node[sizeof(Node)] node[sizeof(Node)] node[sizeof(Node)]
389
+ ... ... ...
390
+ node[sizeof(Node)] node[sizeof(Node)] node[sizeof(Node)]
391
+
392
+ * Reduces paddings of data structure alignment
393
+ * Reduces the number of pointers
394
+ * Reduces fragmentation
395
+
396
+ = Stack spike
397
+ (('tag:center'))
398
+ Before RA Grant
399
+ --------------------------------------------------------------------------------
400
+ Command: ../picoruby/build/host-production/bin/picorbc larger_script.rb
401
+ Massif arguments: --stacks=yes
402
+ ms_print arguments: massif.out.13414
403
+ --------------------------------------------------------------------------------
404
+ KB
405
+ 53.20^ #
406
+ | #
407
+ | @# :::
408
+ | @# : :
409
+ | @# : :
410
+ | @@# : :
411
+ | @@# :: :
412
+ | @@#::: :
413
+ | @@#::: :
414
+ | @@::@@#::: :
415
+ | @@: @@#::: :
416
+ | @@:@:::@::::@@: @@#::: ::
417
+ | @::@::@ :@:: @:: :@@: @@#::: ::
418
+ | @:::@@@:@::@: @ :@:: @:: :@@: @@#::: ::
419
+ | @@:@::@:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
420
+ | ::@@@ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
421
+ | :::::: :::::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
422
+ | :::::@@:: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
423
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
424
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
425
+ 0 +----------------------------------------------------------------------->Mi
426
+ 0 1.616
427
+
428
+ = Stack spike
429
+ # image
430
+ # src = images/freeTree_0.png
431
+ # relative_width = 100
432
+
433
+ = Stack spike
434
+ # image
435
+ # src = images/freeTree_1.png
436
+ # relative_width = 100
437
+
438
+ = Stack spike
439
+ # image
440
+ # src = images/freeTree_2.png
441
+ # relative_width = 100
442
+
443
+ = Stack spike
444
+ # image
445
+ # src = images/freeTree_3.png
446
+ # relative_width = 100
447
+
448
+ = Stack spike
449
+ # image
450
+ # src = images/freeTree_4.png
451
+ # relative_width = 100
452
+
453
+ = Stack spike
454
+ # image
455
+ # src = images/freeTree_5.png
456
+ # relative_width = 100
457
+
458
+ = Stack spike
459
+ # image
460
+ # src = images/freeTree_6.png
461
+ # relative_width = 100
462
+
463
+ = Stack spike
464
+ # image
465
+ # src = images/freeTree_7.png
466
+ # relative_width = 100
467
+
468
+ = Stack spike
469
+ # image
470
+ # src = images/freeTree_8.png
471
+ # relative_width = 100
472
+
473
+ = Stack spike
474
+ # image
475
+ # src = images/freeTree_9.png
476
+ # relative_width = 100
477
+
478
+ = Stack spike
479
+ # image
480
+ # src = images/freeTree_a.png
481
+ # relative_width = 100
482
+
483
+ = Stack spike
484
+ # image
485
+ # src = images/freeTree_b.png
486
+ # relative_width = 100
487
+
488
+ = Stack spike
489
+ # image
490
+ # src = images/freeTree_c.png
491
+ # relative_width = 100
492
+
493
+ = Stack spike
494
+ # image
495
+ # src = images/freeTree_d.png
496
+ # relative_width = 100
497
+
498
+ = Freeing in loop instead of recursion
499
+ # enscript c
500
+ // Recursion is elegant but a big eater
501
+ void freeList_in_recursion(List *list) {
502
+ if (!list) return;
503
+ freeList_in_recursion(list->next);
504
+ free(list);
505
+ }
506
+
507
+ // Loop is somehow clumsy but thrifty
508
+ void freeList_in_loop(List *list) {
509
+ List *next;
510
+ while (list) {
511
+ next = list->next;
512
+ free(list);
513
+ list = next;
514
+ }
515
+ }
516
+
517
+ = Freeing in loop instead of recursion
518
+ (('tag:center'))
519
+ before Grant
520
+ --------------------------------------------------------------------------------
521
+ Command: ../picoruby/build/host-production/bin/picorbc larger_script.rb
522
+ Massif arguments: --stacks=yes
523
+ ms_print arguments: massif.out.13414
524
+ --------------------------------------------------------------------------------
525
+ KB
526
+ 53.20^ #
527
+ | #
528
+ | @# :::
529
+ | @# : :
530
+ | @# : :
531
+ | @@# : :
532
+ | @@# :: :
533
+ | @@#::: :
534
+ | @@#::: :
535
+ | @@::@@#::: :
536
+ | @@: @@#::: :
537
+ | @@:@:::@::::@@: @@#::: ::
538
+ | @::@::@ :@:: @:: :@@: @@#::: ::
539
+ | @:::@@@:@::@: @ :@:: @:: :@@: @@#::: ::
540
+ | @@:@::@:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
541
+ | ::@@@ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
542
+ | :::::: :::::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
543
+ | :::::@@:: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
544
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
545
+ | : :: @ :: :::::: ::@ @ :@: @:: @@ :@::@: @ :@:: @:: :@@: @@#::: ::
546
+ 0 +----------------------------------------------------------------------->Mi
547
+ 0 1.616
548
+
549
+ = Freeing in loop instead of recursion
550
+ (('tag:center'))
551
+ after Grant
552
+ --------------------------------------------------------------------------------
553
+ Command: ./build/host-production/bin/picorbc test/fixtures/larger_script.rb
554
+ Massif arguments: --stacks=yes
555
+ ms_print arguments: massif.out.3082
556
+ --------------------------------------------------------------------------------
557
+ KB
558
+ 24.21^ #
559
+ | @ @:@:@:#
560
+ | @:@@@:@:@:@:#: @
561
+ | @@:::@:@@@:@:@:@:#::::::@
562
+ | @ :::@:@@@:@:@:@:#::::::@
563
+ | @ :::@:@@@:@:@:@:#::::::@
564
+ | @ :::@:@@@:@:@:@:#::::::@
565
+ | @ :::@:@@@:@:@:@:#::::::@
566
+ | @@:::::::::::::::@::::: ::::@::@::::::@ :::@:@@@:@:@:@:#::::::@
567
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
568
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
569
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
570
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
571
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
572
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
573
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
574
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
575
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
576
+ | @ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
577
+ | ::::@ ::::::: :::: : @:: ::@:: :@::@:: :: @ :::@:@@@:@:@:@:#::::::@
578
+ 0 +----------------------------------------------------------------------->Mi
579
+ 0 1.082
580
+
581
+ = What happened?
582
+ * RAM usage when compiling a very small statement like `puts "Hello World!"` became bigger than before due to Pooled allocation
583
+ * Because Pooled allocation allocates a fixed size of array of struct in advance
584
+ * However, when a Ruby script becomes larger, measures of reducing RAM consumption including Pooled allocation work effectively
585
+
586
+ = chapter
587
+ (('tag:center'))
588
+ \n\n\n
589
+ (('tag:xx-large:PicoRuby Compiler'))\n\n
590
+ (('tag:xx-large:Future work'))
591
+ == prop
592
+ : hide-title
593
+ true
594
+ : background-image
595
+ images/gray-background.png
596
+ : background-image-relative-width
597
+ 100
598
+ : background-image-relative-height
599
+ 100
600
+
601
+ = hide-title
602
+ (('tag:center'))
603
+ \n\n\n\n
604
+ (('tag:xx-large:Killer Application'))
605
+ == prop
606
+ : hide-title
607
+ true
608
+
609
+ = hide-title
610
+ (('tag:center'))
611
+ \n\n\n\n
612
+ (('tag:x-large:Programming languages need'))\n
613
+ (('tag:x-large:a killer application'))
614
+ == prop
615
+ : hide-title
616
+ true
617
+
618
+ = hide-title
619
+ (('tag:center'))
620
+ \n
621
+ (('tag:xx-large:C ... UNIX'))\n\n
622
+ (('tag:xx-large:PHP ... WordPress'))\n\n
623
+ (('tag:xx-large:CRuby ... Rails'))
624
+ == prop
625
+ : hide-title
626
+ true
627
+
628
+ = hide-title
629
+ (('tag:center'))
630
+ \n\n\n\n
631
+ (('tag:xx-large:How about PicoRuby?'))
632
+ == prop
633
+ : hide-title
634
+ true
635
+
636
+ = ((* *))
637
+ # image
638
+ # src = images/helix_rev3.jpg
639
+ # relative_width = 107
640
+ # relative_margin_top = 1
641
+ == prop
642
+ : hide-title
643
+ true
644
+
645
+ = hide-title
646
+ (('tag:center'))\n\n
647
+ (('tag:xx-large:To be continued on RubyKaigi Takeout 2021 or RubyConf 2021'))\n(('🤞if proposals.any?(&:accepted?)🤞'))
648
+ == prop
649
+ : hide-title
650
+ true
651
+ : background-image
652
+ images/yellow-background.png
653
+ : background-image-relative-width
654
+ 100
655
+ : background-image-relative-height
656
+ 100
657
+
658
+ = hide-title
659
+ (('tag:center'))\n\n\n\n
660
+ (('tag:xx-large:Thank you!'))\n\n\n\n
661
+ # image
662
+ # src = images/Monstarlab_Logo_Grey_CMYK.png
663
+ # relative_width = 30
664
+ # relative_margin_top = 1
665
+ == prop
666
+ : hide-title
667
+ true
668
+ : background-image
669
+ images/yellow-background.png
670
+ : background-image-relative-width
671
+ 100
672
+ : background-image-relative-height
673
+ 100
data/README.rd ADDED
@@ -0,0 +1,24 @@
1
+ = PicoRuby Compiler
2
+
3
+ Presentation slide for Ruby Association Grant 2020 Report
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-RAGrant2020Report
20
+
21
+ === Show
22
+
23
+ rabbit rabbit-slide-hasumikin-RAGrant2020Report.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: RAGrant2020Report
3
+ base_name: PicoRubyCompiler
4
+ tags:
5
+ - PicoRuby
6
+ - compiler
7
+ - smallfootprint
8
+ presentation_date: '2021-07-06'
9
+ presentation_start_time:
10
+ presentation_end_time:
11
+ version: 2021.7.6.0
12
+ licenses: []
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/images/hasumi.jpg ADDED
Binary file
data/images/hatti.png ADDED
Binary file
Binary file
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/osaka.jpg ADDED
Binary file
Binary file
Binary file
data/theme.rb ADDED
@@ -0,0 +1,142 @@
1
+ # puts font_families.sort
2
+ @xx_large_font_size = screen_size(10 * Pango::SCALE)
3
+ @x_large_font_size = screen_size(7 * Pango::SCALE)
4
+ @large_font_size = screen_size(6 * Pango::SCALE)
5
+ @normal_font_size = screen_size(4.5 * Pango::SCALE)
6
+ @small_font_size = screen_size(4 * Pango::SCALE)
7
+ @x_small_font_size = screen_size(3 * Pango::SCALE)
8
+ @xx_small_font_size = screen_size(2 * Pango::SCALE)
9
+
10
+ @font_family = find_font_family('Neue Haas Grotesk Text Pro')
11
+ @monospace_font_family = 'Ricty Discord'
12
+
13
+ @default_headline_line_color = '#ffff00'
14
+ @default_headline_line_width = 3
15
+ @default_headline_line_expand = false
16
+
17
+ set_graffiti_color "#FF2B22"
18
+ set_graffiti_line_width 10
19
+
20
+ #@table_frame_color = "#ffffff"
21
+ #@table_fill_color = "#0f0428"
22
+ #@table_body_frame_color = "#ffffff"
23
+ #@table_body_fill_color = "#3f3468"
24
+ #@table_head_frame_color = "#ffffff"
25
+ #@table_head_fill_color = "#rf0428"
26
+
27
+ #@preformatted_fill_color = '#000000'
28
+ # @preformatted_centering = true
29
+ @space = screen_y(1)
30
+
31
+ # @margin_left = 300
32
+
33
+ @image_slide_number_start_flag_color = "#53575a"
34
+ @image_slide_number_goal_flag_color = "#a81313"
35
+
36
+ include_theme('default')
37
+
38
+ match(Slide, HeadLine) do |heads|
39
+ heads.prop_set("size", @large_font_size)
40
+ heads.prop_set("weight", "normal")
41
+ set_font_family(heads)
42
+ end
43
+ match(Slide) do |slides|
44
+ slides.prop_set("foreground", "#53575a")
45
+ end
46
+
47
+ @slide_headline_hide = true
48
+
49
+ @title_background_color = '#ffff00'
50
+ include_theme('title-background-color')
51
+
52
+ match TitleSlide do |slides|
53
+ slides.margin_left = @margin_right
54
+ slides.prop_set("foreground", "#53575a")
55
+ end
56
+ match TitleSlide, Title do |titles|
57
+ titles.margin_top = 260
58
+ end
59
+ match TitleSlide, Subtitle do |subtitle|
60
+ end
61
+ match TitleSlide, Author do |authors|
62
+ authors.margin_top = 240
63
+ end
64
+ match TitleSlide, Date do |date|
65
+ end
66
+
67
+ #@title_slide_background_image = 'images/Monstarlab_Logo_Grey_CMYK.png'
68
+ #include_theme("title-slide-background-image")
69
+
70
+ #@slide_background_image = 'images/Powerpoint Content Slide.png'
71
+ #include_theme("slide-background-image")
72
+
73
+ #@slide_logo_image = 'images/mark_g.png'
74
+ #include_theme('slide-logo')
75
+
76
+ @item_image = 'images/mark_y.png'
77
+
78
+ include_theme("default-item-mark")
79
+
80
+ add_image_path("rabbit-images")
81
+
82
+ slide_body = [Slide, Body]
83
+ item_list_item = [ItemList, ItemListItem]
84
+
85
+ indent = 70
86
+
87
+ match(*(slide_body + (item_list_item * 1))) do |items|
88
+ name = "item1"
89
+ items.delete_pre_draw_proc_by_name(name)
90
+ items.delete_post_draw_proc_by_name(name)
91
+ draw_image_mark(items, @item_image, name, indent: indent)
92
+ end
93
+
94
+ match(*(slide_body + (item_list_item * 2))) do |items|
95
+ name = "item2"
96
+ items.delete_pre_draw_proc_by_name(name)
97
+ items.delete_post_draw_proc_by_name(name)
98
+ draw_image_mark(items, @item_image, name, indent: indent)
99
+ end
100
+
101
+ match(*(slide_body + (item_list_item * 3))) do |items|
102
+ name = "item3"
103
+ items.delete_pre_draw_proc_by_name(name)
104
+ items.delete_post_draw_proc_by_name(name)
105
+ draw_image_mark(items, @item_image, name, indent: indent)
106
+ end
107
+
108
+ enum_list_item = [EnumList, EnumListItem]
109
+
110
+ match(*(slide_body + enum_list_item + item_list_item)) do |items|
111
+ name = "enum-item1"
112
+ items.delete_pre_draw_proc_by_name(name)
113
+ items.delete_post_draw_proc_by_name(name)
114
+ draw_image_mark(items, @item_image, name, indent: indent)
115
+ end
116
+
117
+ match(*(slide_body + enum_list_item + (item_list_item * 2))) do |items|
118
+ name = "enum-item2"
119
+ items.delete_pre_draw_proc_by_name(name)
120
+ items.delete_post_draw_proc_by_name(name)
121
+ draw_image_mark(items, @item_image, name, indent: indent)
122
+ end
123
+
124
+ # table
125
+ all_table = ["**", Table]
126
+ match(*(all_table + [TableBody, TableRow, TableCell])) do |cells|
127
+ set_font_family(cells, @monospace_font_family)
128
+ end
129
+ match(*(all_table + [TableHead, TableRow, TableHeader])) do |headers|
130
+ set_font_family(headers, @monospace_font_family)
131
+ end
132
+
133
+ # Chapter
134
+ match Slide do |slides|
135
+ slides.each do |slide|
136
+ if slide.match?(/chapter/)
137
+ slide.prop_set("foreground", "#ffff00")
138
+ elsif slide.match?(/To be continued/)
139
+ slide.prop_set("foreground", "#53575a")
140
+ end
141
+ end
142
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rabbit-slide-hasumikin-RAGrant2020Report
3
+ version: !ruby/object:Gem::Version
4
+ version: 2021.7.6.0
5
+ platform: ruby
6
+ authors:
7
+ - HASUMI Hitoshi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-07-06 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 Ruby Association Grant 2020 Report
28
+ email:
29
+ - hasumikin@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rabbit"
35
+ - PicoRubyCompiler.rab
36
+ - README.rd
37
+ - Rakefile
38
+ - config.yaml
39
+ - images/Monstarlab_Logo_Grey_CMYK.png
40
+ - images/Monstarlab_Logo_Yellow_CMYK.png
41
+ - images/ToyamaRubyKaigi01.png
42
+ - images/architecture_1.png
43
+ - images/architecture_2.png
44
+ - images/architecture_3.png
45
+ - images/freeTree_0.png
46
+ - images/freeTree_1.png
47
+ - images/freeTree_2.png
48
+ - images/freeTree_3.png
49
+ - images/freeTree_4.png
50
+ - images/freeTree_5.png
51
+ - images/freeTree_6.png
52
+ - images/freeTree_7.png
53
+ - images/freeTree_8.png
54
+ - images/freeTree_9.png
55
+ - images/freeTree_a.png
56
+ - images/freeTree_b.png
57
+ - images/freeTree_c.png
58
+ - images/freeTree_d.png
59
+ - images/gray-background.png
60
+ - images/hasumi.jpg
61
+ - images/hatti.png
62
+ - images/helix_rev3.jpg
63
+ - images/keyboard.rb.png
64
+ - images/mark_g.png
65
+ - images/mark_y.png
66
+ - images/matz.jpg
67
+ - images/monstarlab.png
68
+ - images/osaka.jpg
69
+ - images/title-background.png
70
+ - images/yellow-background.png
71
+ - pdf/RAGrant2020Report-PicoRubyCompiler.pdf
72
+ - theme.rb
73
+ homepage: https://slide.rabbit-shocker.org/authors/hasumikin/RAGrant2020Report/
74
+ licenses: []
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubygems_version: 3.2.17
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: PicoRuby Compiler
95
+ test_files: []