Nimで5分クッキング - IoT向け言語Nimの紹介 #iotlt
by
n0bisuke
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
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
JSPythonͰ࢝ΊΒΕΔ͚Ͳ݁ہϥΠϒϥϦͷ༗ແͰ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
CC++ͱಉ͘Β͍ͷΛ୲อͭͭ͠ɺॻ͖ຯ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
ɾNimIoT͚ݴޠ - C/C++ͱ࿈ܞͰ͖ɺग़Δ - Webαʔόʔͱͯ͠ར༻͍͢͠ - ॻ͖͍͢(ಛʹLLܥग़ऀ) - ͷͼ͚͕͍ͯ͢͠Δ ͭ·Γ
Slide 13
Slide 13 text
͞ΒʹNimC/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
ؾʹͳΔϕϯνϚʔΫ (:20151݄࣌) (Ҿ༻) ͜ͷࠒ ྲྀߦΓͷ ݴޠͨͪʢଞʣͰϕϯνϚʔΫ ʢ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৮ͬͯΈΑ͏ ·ͱΊ