O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Safer IoT using functional language

2.072 visualizações

Publicada em

Safer IoT using functional language

Publicada em: Tecnologia
  • Seja o primeiro a comentar

Safer IoT using functional language

  1. 1. Safer IoT using functional languageSafer IoT using functional languageSafer IoT using functional languageSafer IoT using functional languageSafer IoT using functional language Kiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICSKiwamu Okabe @ RIKEN AICS
  2. 2. Hardware: ESP8266Hardware: ESP8266Hardware: ESP8266Hardware: ESP8266Hardware: ESP8266 ☆ http://espressif.com/en/products/wroom/☆ http://espressif.com/en/products/wroom/☆ http://espressif.com/en/products/wroom/☆ http://espressif.com/en/products/wroom/☆ http://espressif.com/en/products/wroom/ ☆ 32-bit low power MCU Wi-Fi Module☆ 32-bit low power MCU Wi-Fi Module☆ 32-bit low power MCU Wi-Fi Module☆ 32-bit low power MCU Wi-Fi Module☆ 32-bit low power MCU Wi-Fi Module ☆ Having integrated TCP/IP network stacks☆ Having integrated TCP/IP network stacks☆ Having integrated TCP/IP network stacks☆ Having integrated TCP/IP network stacks☆ Having integrated TCP/IP network stacks ☆ Including ADC, SDIO, UART, PWM, I2C ...☆ Including ADC, SDIO, UART, PWM, I2C ...☆ Including ADC, SDIO, UART, PWM, I2C ...☆ Including ADC, SDIO, UART, PWM, I2C ...☆ Including ADC, SDIO, UART, PWM, I2C ... ☆ Small form factor of only 18mm x 20mm☆ Small form factor of only 18mm x 20mm☆ Small form factor of only 18mm x 20mm☆ Small form factor of only 18mm x 20mm☆ Small form factor of only 18mm x 20mm
  3. 3. Functional language: ATSFunctional language: ATSFunctional language: ATSFunctional language: ATSFunctional language: ATS ☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/☆ http://www.ats-lang.org/ ☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML☆ Syntax like ML ☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types☆ DML-style dependent types ☆ Linear types☆ Linear types☆ Linear types☆ Linear types☆ Linear types ☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC ☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free☆ Optional malloc/free ☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time☆ Optional run-time
  4. 4. DemoDemoDemoDemoDemo The code is found at following:The code is found at following:The code is found at following:The code is found at following:The code is found at following: https://github.com/fpiot/esp8266-atshttps://github.com/fpiot/esp8266-atshttps://github.com/fpiot/esp8266-atshttps://github.com/fpiot/esp8266-atshttps://github.com/fpiot/esp8266-ats
  5. 5. Demo environmentDemo environmentDemo environmentDemo environmentDemo environment
  6. 6. Software architectureSoftware architectureSoftware architectureSoftware architectureSoftware architecture
  7. 7. ATS finds forgetting free memoryATS finds forgetting free memoryATS finds forgetting free memoryATS finds forgetting free memoryATS finds forgetting free memory $�cd�esp8266-ats/ifttt_ats $�vi�user/user_main.dats �39�����val�json_open�=�string0_copy�"{"value1":�"" �40�����val�json_close�=�string0_copy�""�}" �41�����val�temp�=�esp_tostrptr_int�rand �42�����val�json_head�=�strptr_append�(json_open,�temp) �43�����val�json_data�=�strptr_append�(json_head,�json_close) �44�//��val�()�=�(free�json_open;�free�json_close;�free�temp;�free�json_head) �45�����val�()�=�(free�json_open;�free�json_close;�free�temp)�//�Error! $�make ATS�user/user_main.dats /home/kiwamu/src/esp8266-ats/ifttt_ats/user/user_main.dats:�985(line=32,� offs=43)�--�2237(line=55,�offs=4):�error(3):�the�linear�dynamic�variable� [json_head$3823(-1)]�needs�to�be�consumed�but�it�is�preserved�with�the�type� [S2Eapp(S2Ecst(strptr_addr_vtype);�S2EVar(4441))]�instead. $�cd�esp8266-ats/ifttt_ats $�vi�user/user_main.dats �39�����val�json_open�=�string0_copy�"{"value1":�"" �40�����val�json_close�=�string0_copy�""�}" �41�����val�temp�=�esp_tostrptr_int�rand �42�����val�json_head�=�strptr_append�(json_open,�temp) �43�����val�json_data�=�strptr_append�(json_head,�json_close) �44�//��val�()�=�(free�json_open;�free�json_close;�free�temp;�free�json_head) �45�����val�()�=�(free�json_open;�free�json_close;�free�temp)�//�Error! $�make ATS�user/user_main.dats /home/kiwamu/src/esp8266-ats/ifttt_ats/user/user_main.dats:�985(line=32,� offs=43)�--�2237(line=55,�offs=4):�error(3):�the�linear�dynamic�variable� [json_head$3823(-1)]�needs�to�be�consumed�but�it�is�preserved�with�the�type� [S2Eapp(S2Ecst(strptr_addr_vtype);�S2EVar(4441))]�instead. $�cd�esp8266-ats/ifttt_ats $�vi�user/user_main.dats �39�����val�json_open�=�string0_copy�"{"value1":�"" �40�����val�json_close�=�string0_copy�""�}" �41�����val�temp�=�esp_tostrptr_int�rand �42�����val�json_head�=�strptr_append�(json_open,�temp) �43�����val�json_data�=�strptr_append�(json_head,�json_close) �44�//��val�()�=�(free�json_open;�free�json_close;�free�temp;�free�json_head) �45�����val�()�=�(free�json_open;�free�json_close;�free�temp)�//�Error! $�make ATS�user/user_main.dats /home/kiwamu/src/esp8266-ats/ifttt_ats/user/user_main.dats:�985(line=32,� offs=43)�--�2237(line=55,�offs=4):�error(3):�the�linear�dynamic�variable� [json_head$3823(-1)]�needs�to�be�consumed�but�it�is�preserved�with�the�type� [S2Eapp(S2Ecst(strptr_addr_vtype);�S2EVar(4441))]�instead. $�cd�esp8266-ats/ifttt_ats $�vi�user/user_main.dats �39�����val�json_open�=�string0_copy�"{"value1":�"" �40�����val�json_close�=�string0_copy�""�}" �41�����val�temp�=�esp_tostrptr_int�rand �42�����val�json_head�=�strptr_append�(json_open,�temp) �43�����val�json_data�=�strptr_append�(json_head,�json_close) �44�//��val�()�=�(free�json_open;�free�json_close;�free�temp;�free�json_head) �45�����val�()�=�(free�json_open;�free�json_close;�free�temp)�//�Error! $�make ATS�user/user_main.dats /home/kiwamu/src/esp8266-ats/ifttt_ats/user/user_main.dats:�985(line=32,� offs=43)�--�2237(line=55,�offs=4):�error(3):�the�linear�dynamic�variable� [json_head$3823(-1)]�needs�to�be�consumed�but�it�is�preserved�with�the�type� [S2Eapp(S2Ecst(strptr_addr_vtype);�S2EVar(4441))]�instead. $�cd�esp8266-ats/ifttt_ats $�vi�user/user_main.dats �39�����val�json_open�=�string0_copy�"{"value1":�"" �40�����val�json_close�=�string0_copy�""�}" �41�����val�temp�=�esp_tostrptr_int�rand �42�����val�json_head�=�strptr_append�(json_open,�temp) �43�����val�json_data�=�strptr_append�(json_head,�json_close) �44�//��val�()�=�(free�json_open;�free�json_close;�free�temp;�free�json_head) �45�����val�()�=�(free�json_open;�free�json_close;�free�temp)�//�Error! $�make ATS�user/user_main.dats /home/kiwamu/src/esp8266-ats/ifttt_ats/user/user_main.dats:�985(line=32,� offs=43)�--�2237(line=55,�offs=4):�error(3):�the�linear�dynamic�variable� [json_head$3823(-1)]�needs�to�be�consumed�but�it�is�preserved�with�the�type� [S2Eapp(S2Ecst(strptr_addr_vtype);�S2EVar(4441))]�instead.
  8. 8. Functional IoT Meetup at January 30Functional IoT Meetup at January 30Functional IoT Meetup at January 30Functional IoT Meetup at January 30Functional IoT Meetup at January 30
  9. 9. License of photosLicense of photosLicense of photosLicense of photosLicense of photos *�About�time�I�had�a�whisky�glass!�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/toolmantim/14834817323/ ��Copyright:�Tim�Lucas�/�License:�CC�BY�2.0 *�Japanese�traditional�style�house�design�/�和⾵建築(わふうけんちく)�│� Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tanaka_juuyoh/10720411936/ ��Copyright:�TANAKA�Juuyoh�(⽥中⼗洋)�/�License:�CC�BY�2.0 *�Undirected�member-get-member�network�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/porternovelli/2587018053/ ��Copyright:�Porter�Novelli�Global�/�License:�CC�BY-SA�2.0 *�JTAG�board�1�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/amagill/2877921712/ ��Copyright:�Andrew�Magill�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�About�time�I�had�a�whisky�glass!�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/toolmantim/14834817323/ ��Copyright:�Tim�Lucas�/�License:�CC�BY�2.0 *�Japanese�traditional�style�house�design�/�和⾵建築(わふうけんちく)�│� Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tanaka_juuyoh/10720411936/ ��Copyright:�TANAKA�Juuyoh�(⽥中⼗洋)�/�License:�CC�BY�2.0 *�Undirected�member-get-member�network�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/porternovelli/2587018053/ ��Copyright:�Porter�Novelli�Global�/�License:�CC�BY-SA�2.0 *�JTAG�board�1�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/amagill/2877921712/ ��Copyright:�Andrew�Magill�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�About�time�I�had�a�whisky�glass!�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/toolmantim/14834817323/ ��Copyright:�Tim�Lucas�/�License:�CC�BY�2.0 *�Japanese�traditional�style�house�design�/�和⾵建築(わふうけんちく)�│� Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tanaka_juuyoh/10720411936/ ��Copyright:�TANAKA�Juuyoh�(⽥中⼗洋)�/�License:�CC�BY�2.0 *�Undirected�member-get-member�network�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/porternovelli/2587018053/ ��Copyright:�Porter�Novelli�Global�/�License:�CC�BY-SA�2.0 *�JTAG�board�1�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/amagill/2877921712/ ��Copyright:�Andrew�Magill�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�About�time�I�had�a�whisky�glass!�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/toolmantim/14834817323/ ��Copyright:�Tim�Lucas�/�License:�CC�BY�2.0 *�Japanese�traditional�style�house�design�/�和⾵建築(わふうけんちく)�│� Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tanaka_juuyoh/10720411936/ ��Copyright:�TANAKA�Juuyoh�(⽥中⼗洋)�/�License:�CC�BY�2.0 *�Undirected�member-get-member�network�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/porternovelli/2587018053/ ��Copyright:�Porter�Novelli�Global�/�License:�CC�BY-SA�2.0 *�JTAG�board�1�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/amagill/2877921712/ ��Copyright:�Andrew�Magill�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0 *�About�time�I�had�a�whisky�glass!�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/toolmantim/14834817323/ ��Copyright:�Tim�Lucas�/�License:�CC�BY�2.0 *�Japanese�traditional�style�house�design�/�和⾵建築(わふうけんちく)�│� Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/tanaka_juuyoh/10720411936/ ��Copyright:�TANAKA�Juuyoh�(⽥中⼗洋)�/�License:�CC�BY�2.0 *�Undirected�member-get-member�network�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/porternovelli/2587018053/ ��Copyright:�Porter�Novelli�Global�/�License:�CC�BY-SA�2.0 *�JTAG�board�1�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/amagill/2877921712/ ��Copyright:�Andrew�Magill�/�License:�CC�BY�2.0 *�Creative�Commons�BBB�│�Flickr�-�Photo�Sharing! ��https://www.flickr.com/photos/steren/2732488224/ ��Copyright:�Steren�Giannini�/�License:�CC�BY�2.0

×