Slide 1

Slide 1 text

NimͰ5෼ΫοΩϯά #iotlt (SIer) 2018/3/27 IoT޲͚ݴޠ(ओ؍)NimͰLINE BOTΛ࡞ͬͯΈΑ͏

Slide 2

Slide 2 text

ੁݪ ͷͼ͚͢ dotstudio, Inc. ɾWebΤϯδχΞ ɾMicrosoft MVP (Node.js) ɾLINE API Expert (ࠃ಺5ਓ) ɾσδλϧϋϦ΢ουେֶେֶӃ ඇৗۈߨࢣ ɾIoTLT ओ࠵ (࣍ճ3/26 vol37) nobisuke sugawara

Slide 3

Slide 3 text

dotstudio, inc. ཧ೦ : Ϟϊͮ͘ΓΛָ͠ΉਓΛ૿΍͍ͨ͠ 2016೥૑ۀ

Slide 4

Slide 4 text

IoT޲͚ݴޠ(ओ؍)Nimͷ঺հ ࠓ೔ͷ࿩

Slide 5

Slide 5 text

Nimͱ͸ ඒ͋͘͠Γͳ͕Β ύϑΥʔϚϯε͕͔ͳΓߴ͘ ϝλϓϩάϥϛϯάʹ௕͚ͨ ίϯύΠϧݴޠ Ͱ͢ɻ Nimͱ͸ (ࢀߟ) ࢸߴͷݴޠɺNimΛ࢝ΊΔΤϯδχΞ΁ by @rigani https://qiita.com/rigani/items/6e87c7cee6903ed65ed2

Slide 6

Slide 6 text

https://nim-lang.org/

Slide 7

Slide 7 text

ͷͼ͚͕͢ࢥ͏IoT޲͚ݴޠ => σόΠεͱWeb։ൃ྆ํ͕Մೳɺ଎౓͕ग़ͯॻ͖΍͍͢ IoT޲͚ݴޠͷ޲͖ෆ޲͖(ओ؍) ݴޠ Web։ൃ σόΠε։ൃ ଎౓ ॻ͖қ͞ JavaScript ˕ ̋ ˚ ˕ Python ˕ ̋ ˚ ˕ C++ ˚ ˕ ˕ × Go ˕ × ˕ ̋ Rust ˚ ˚ ˕ ˚ Nim ̋ ˚ ˕ ˕ ※֤ք۾ͰౖΒΕͦ͏ͳͷͰౖΒΕͨΒमਖ਼[wip]

Slide 8

Slide 8 text

JS΍PythonͰ࢝ΊΒΕΔ͚Ͳ݁ہ଎౓΍ϥΠϒϥϦͷ༗ແͰC++ʹ ߦ͖ண͚͘ͲɺC++Λॻ͘ͷ͸ਏ͍ IoT޲͚ݴޠͷ޲͖ෆ޲͖(ओ؍) ݴޠ Web։ൃ σόΠε։ൃ ଎౓ ॻ͖қ͞ JavaScript ˕ ̋ ˚ ˕ Python ˕ ̋ ˚ ˕ C++ ˚ ˕ ˕ × Go ˕ × ˕ ̋ Rust ˚ ˚ ˕ ˚ Nim ̋ ˚ ˕ ˕ ※֤ք۾ͰౖΒΕͦ͏ͳͷͰౖΒΕͨΒमਖ਼[wip]

Slide 9

Slide 9 text

Alt C++తͳϙδγϣϯͰRust͕ग़ͯདྷ͚ͨͲɺRustͷॻ͖ํ͸ ݸਓతʹ͸ཧղ͕ͳ͔ͳ͔௥͍͔ͭͳ͍(ಛʹॴ༗ݖपΓ͕೉͍͠ͳͱײͨ͡) IoT޲͚ݴޠͷ޲͖ෆ޲͖(ओ؍) ݴޠ Web։ൃ σόΠε։ൃ ଎౓ ॻ͖қ͞ JavaScript ˕ ̋ ˚ ˕ Python ˕ ̋ ˚ ˕ C++ ˚ ˕ ˕ × Go ˕ × ˕ ̋ Rust ˚ ˚ ˕ ˚ Nim ̋ ˚ ˕ ˕ ※֤ք۾ͰౖΒΕͦ͏ͳͷͰౖΒΕͨΒमਖ਼[wip]

Slide 10

Slide 10 text

C΍C++ͱಉ౳͘Β͍ͷ଎౓Λ୲อͭͭ͠ɺॻ͖ຯ΋PythonϥΠΫͰ (εΫϦϓτݴޠग़਎ͷਓʹ͸ಛʹ)ཧղ͠΍͍͢ɻ IoT޲͚ݴޠͷ޲͖ෆ޲͖(ओ؍) ݴޠ Web։ൃ σόΠε։ൃ ଎౓ ॻ͖қ͞ JavaScript ˕ ̋ ˚ ˕ Python ˕ ̋ ˚ ˕ C++ ˚ ˕ ˕ × Go ˕ × ˕ ̋ Rust ˚ ˚ ˕ ˚ Nim ̋ ˚ ˕ ˕ ※֤ք۾ͰౖΒΕͦ͏ͳͷͰౖΒΕͨΒमਖ਼[wip]

Slide 11

Slide 11 text

ͷͼ͚͕͢ࢥ͏IoT޲͚ݴޠ(࠶ܝ) => σόΠεͱWeb։ൃ྆ํ͕Մೳɺ଎౓͕ग़ͯॻ͖΍͍͢ IoT޲͚ݴޠͷ޲͖ෆ޲͖(ओ؍) ݴޠ Web։ൃ σόΠε։ൃ ଎౓ ॻ͖қ͞ JavaScript ˕ ̋ ˚ ˕ Python ˕ ̋ ˚ ˕ C++ ˚ ˕ ˕ × Go ˕ × ˕ ̋ Rust ˚ ˚ ˕ ˚ Nim ̋ ˚ ˕ ˕ ※֤ք۾ͰౖΒΕͦ͏ͳͷͰౖΒΕͨΒमਖ਼[wip] ϥΠϒϥϦ΍ϓϥοτϑΥʔϜͷࠓޙ ͷ֦ॆͰ؀ڥ͸มΘΔ -> ظ଴஋෦෼ ݴޠͱͯ͠ͷࠜװ෦෼ʹྑ͞Έ

Slide 12

Slide 12 text

ɾNim͸IoT޲͚ݴޠ - C/C++ͱ࿈ܞͰ͖ɺ଎౓΋ग़Δ - Webαʔόʔͱͯ͠΋ར༻͠΍͍͢ - ॻ͖΍͍͢(ಛʹLLܥग़਎ऀ) - ͷͼ͚͕͢஫໨͍ͯ͠Δ ͭ·Γ

Slide 13

Slide 13 text

͞ΒʹNim͸C/C++ͷ࿈ܞػೳ͕͋Γ·͢ɻ NimͷC/C++࿈ܞ ”Nim͸جຊతʹCΛ௨ͯ͠ίϯύΠϧ͢Δʢ͍ΘΏΔτϥϯεύΠϥʣͷ ͰɺCίϯύΠϥͷ࠷దԽͷԸܙΛड͚ΒΕΔ͚ͩͰͳ͘ɺCͷࢿ࢈ͱͷ ૬ੑ΋ͱͯ΋ྑ͍Ͱ͢ɻ” proc printf(formatstr: cstring) {.header: "", importc: "printf", varargs.} ɾimportc - cݴޠͷؔ਺ΛNimʹΠϯϙʔτ # file: fib.nim proc fib(a: cint): cint {.exportc.} = if a <= 2: result = 1 else: result = fib(a - 1) + fib(a - 2) ɾexportc - NimͷίʔυΛcݴޠ͔Βݺͼग़͢ // file: export_test.c #include "fib.h" #include int main() { NimMain(); printf("%d\n", fib(10)); // output: 55 } (Ҿ༻) NimͰଞͷݴޠͱͷ࿈ܞํ๏·ͱΊ by @snowlt23 https://qiita.com/snowlt23/items/1696687cca61bfedb1cc

Slide 14

Slide 14 text

ͭ·ΓArduinoͱ࿈ܞͰ͖Δ…? (׆ൃͰ͸ͳͦ͞͏……׆ൃʹͳͬͯ΄͍͠)

Slide 15

Slide 15 text

ؾʹͳΔϕϯνϚʔΫ (஫:2015೥1݄࣌఺) (Ҿ༻) ͜ͷࠒ ྲྀߦΓͷ ݴޠͨͪʢଞʣͰϕϯνϚʔΫ ʢDart, Go, Julia, Nim, Python, Rust ଞʣ by Blank File http://h-miyako.hatenablog.com/entry/2015/01/23/060000

Slide 16

Slide 16 text

NimݴޠͰLINE BOT։ൃʹνϟϨϯδ खܰ͞Λ࣮ײͯ͠΋Β͓͏

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

࠷ۙNim͕ΩςΔΒ͍͠ͷͰɺ LINE BotͰࢼͯ͠Έͨ by @enta0701 ࢀߟ https://qiita.com/enta0701/items/ead034f13fa7cf7a1fe9 ͜ΕಡΊ͹ͨͿΜ୭Ͱ΋࡞Ε·͢ɻ

Slide 19

Slide 19 text

ͷͼ͚͢ͷNimྺ 30෼ఔ౓ (൒ଂ໳Ӻۙ͘υτʔϧͰ18:30ࠒʹ৮Γ͸͡Ί·ͨ͠) ͔͠΋

Slide 20

Slide 20 text

೔ຊޠ৘ใͷௐ΂ํ - NimͷDiscord × URL͸ #iotlt πΠʔτͰ!

Slide 21

Slide 21 text

೔ຊޠ৘ใͷௐ΂ํ - NimͷDiscord ࣭໰ͯ͠1෼Ͱճ౴͕……!

Slide 22

Slide 22 text

೔ຊޠ৘ใͷௐ΂ํ - NimͷDiscord ·ͩ4ਓʂ ࠓ೔(2018/2/27)ͷ15:00ࠒʹ্ཱ͕ͪͬͨ

Slide 23

Slide 23 text

ɾNim͕࠷ۙΩς͍ΔΒ͍͠ ɾIoTքͰ͸ಛʹ஫໨ͳͷͰ͸ ɾNim৮ͬͯΈΑ͏ ·ͱΊ