Metasepi team meeting #14: ATS programming on MCU

22
Metasepi team meeting #14: ATS programming on MCU Metasepi team meeting #14: ATS programming on MCU Metasepi team meeting #14: ATS programming on MCU Metasepi team meeting #14: ATS programming on MCU Metasepi team meeting #14: ATS programming on MCU Kiwamu Okabe @ Metasepi Project Kiwamu Okabe @ Metasepi Project Kiwamu Okabe @ Metasepi Project Kiwamu Okabe @ Metasepi Project Kiwamu Okabe @ Metasepi Project

description

Agenda * [1] What is Ajhc? * [2] What is Metasepi? * [3] Demo using ATS language * [4] What is ATS? * [5] ATS programming on MCU

Transcript of Metasepi team meeting #14: ATS programming on MCU

Page 1: Metasepi team meeting #14: ATS programming on MCU

Metasepi team meeting #14: ATS programming on MCUMetasepi team meeting #14: ATS programming on MCUMetasepi team meeting #14: ATS programming on MCUMetasepi team meeting #14: ATS programming on MCU

Metasepi team meeting #14:ATS programming on MCU

Kiwamu Okabe @ Metasepi ProjectKiwamu Okabe @ Metasepi ProjectKiwamu Okabe @ Metasepi ProjectKiwamu Okabe @ Metasepi ProjectKiwamu Okabe @ Metasepi Project

Page 2: Metasepi team meeting #14: ATS programming on MCU

Who am I?Who am I?Who am I?Who am I?Who am I?

☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/☆ http://www.masterq.net/

☆ Self employed software engineer☆ Self employed software engineer☆ Self employed software engineer☆ Self employed software engineer☆ Self employed software engineer

☆ Trade name := METASEPI DESIGN☆ Trade name := METASEPI DESIGN☆ Trade name := METASEPI DESIGN☆ Trade name := METASEPI DESIGN☆ Trade name := METASEPI DESIGN

☆ Founder of Metasepi Project☆ Founder of Metasepi Project☆ Founder of Metasepi Project☆ Founder of Metasepi Project☆ Founder of Metasepi Project

☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer☆ A Debian Maintainer

☆ 10 years' experience in developing OS using NetBSD☆ 10 years' experience in developing OS using NetBSD☆ 10 years' experience in developing OS using NetBSD☆ 10 years' experience in developing OS using NetBSD☆ 10 years' experience in developing OS using NetBSD

Page 3: Metasepi team meeting #14: ATS programming on MCU

Demo: NetBSD driver in HaskellDemo: NetBSD driver in HaskellDemo: NetBSD driver in HaskellDemo: NetBSD driver in HaskellDemo: NetBSD driver in Haskell

☆ NetBSD audio driver play sound☆ NetBSD audio driver play sound☆ NetBSD audio driver play sound☆ NetBSD audio driver play sound☆ NetBSD audio driver play sound

☆ The driver's interrupt handler rewrited using Haskell☆ The driver's interrupt handler rewrited using Haskell☆ The driver's interrupt handler rewrited using Haskell☆ The driver's interrupt handler rewrited using Haskell☆ The driver's interrupt handler rewrited using Haskell

☆ Watch the movie at following☆ Watch the movie at following☆ Watch the movie at following☆ Watch the movie at following☆ Watch the movie at followinghttps://www.youtube.com/watch?v=XEYcR5RG5cAhttps://www.youtube.com/watch?v=XEYcR5RG5cAhttps://www.youtube.com/watch?v=XEYcR5RG5cAhttps://www.youtube.com/watch?v=XEYcR5RG5cAhttps://www.youtube.com/watch?v=XEYcR5RG5cA

☆ Paper for Haskell Symposium 2014☆ Paper for Haskell Symposium 2014☆ Paper for Haskell Symposium 2014☆ Paper for Haskell Symposium 2014☆ Paper for Haskell Symposium 2014http://metasepi.org/doc/metasepi-icfp2014.pdfhttp://metasepi.org/doc/metasepi-icfp2014.pdfhttp://metasepi.org/doc/metasepi-icfp2014.pdfhttp://metasepi.org/doc/metasepi-icfp2014.pdfhttp://metasepi.org/doc/metasepi-icfp2014.pdf

Page 4: Metasepi team meeting #14: ATS programming on MCU

Ajhc Haskell compilerAjhc Haskell compilerAjhc Haskell compilerAjhc Haskell compilerAjhc Haskell compiler

http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/http://ajhc.metasepi.org/

☆ Ajhc := Arafura designed jhc☆ Ajhc := Arafura designed jhc☆ Ajhc := Arafura designed jhc☆ Ajhc := Arafura designed jhc☆ Ajhc := Arafura designed jhc

☆ jhc := John's Haskell Compiler☆ jhc := John's Haskell Compiler☆ jhc := John's Haskell Compiler☆ jhc := John's Haskell Compiler☆ jhc := John's Haskell Compiler

☆ http://repetae.net/computer/jhc/☆ http://repetae.net/computer/jhc/☆ http://repetae.net/computer/jhc/☆ http://repetae.net/computer/jhc/☆ http://repetae.net/computer/jhc/

☆ Jhc outputs binary that has low-memory-footprint and runs fast.☆ Jhc outputs binary that has low-memory-footprint and runs fast.☆ Jhc outputs binary that has low-memory-footprint and runs fast.☆ Jhc outputs binary that has low-memory-footprint and runs fast.☆ Jhc outputs binary that has low-memory-footprint and runs fast.

☆ Good for embedded software.☆ Good for embedded software.☆ Good for embedded software.☆ Good for embedded software.☆ Good for embedded software.

Page 5: Metasepi team meeting #14: ATS programming on MCU

AgendaAgendaAgendaAgendaAgenda

☆ [1] What is Ajhc?☆ [1] What is Ajhc?☆ [1] What is Ajhc?☆ [1] What is Ajhc?☆ [1] What is Ajhc?

☆ [2] What is Metasepi?☆ [2] What is Metasepi?☆ [2] What is Metasepi?☆ [2] What is Metasepi?☆ [2] What is Metasepi?

☆ [3] Demo using ATS language☆ [3] Demo using ATS language☆ [3] Demo using ATS language☆ [3] Demo using ATS language☆ [3] Demo using ATS language

☆ [4] What is ATS?☆ [4] What is ATS?☆ [4] What is ATS?☆ [4] What is ATS?☆ [4] What is ATS?

☆ [5] ATS programming on MCU☆ [5] ATS programming on MCU☆ [5] ATS programming on MCU☆ [5] ATS programming on MCU☆ [5] ATS programming on MCU

Page 6: Metasepi team meeting #14: ATS programming on MCU

What is Metasepi?What is Metasepi?What is Metasepi?What is Metasepi?What is Metasepi?

http://metasepi.org/http://metasepi.org/http://metasepi.org/http://metasepi.org/http://metasepi.org/

☆ Unix-like OS designed by strong type.☆ Unix-like OS designed by strong type.☆ Unix-like OS designed by strong type.☆ Unix-like OS designed by strong type.☆ Unix-like OS designed by strong type.

☆ Using ML or more strong type lang.☆ Using ML or more strong type lang.☆ Using ML or more strong type lang.☆ Using ML or more strong type lang.☆ Using ML or more strong type lang.

Page 7: Metasepi team meeting #14: ATS programming on MCU

Why need Metasepi?Why need Metasepi?Why need Metasepi?Why need Metasepi?Why need Metasepi?

☆ We have already Linux or Windows.☆ We have already Linux or Windows.☆ We have already Linux or Windows.☆ We have already Linux or Windows.☆ We have already Linux or Windows.

☆ But the developers are suffering.☆ But the developers are suffering.☆ But the developers are suffering.☆ But the developers are suffering.☆ But the developers are suffering.

☆ If use the kernel changed by you,☆ If use the kernel changed by you,☆ If use the kernel changed by you,☆ If use the kernel changed by you,☆ If use the kernel changed by you,

☆ you will get many runtime error.☆ you will get many runtime error.☆ you will get many runtime error.☆ you will get many runtime error.☆ you will get many runtime error.

☆ Difficult even to reproduce it.☆ Difficult even to reproduce it.☆ Difficult even to reproduce it.☆ Difficult even to reproduce it.☆ Difficult even to reproduce it.

Page 8: Metasepi team meeting #14: ATS programming on MCU

Type safetyType safetyType safetyType safetyType safety

☆ Less runtime errors.☆ Less runtime errors.☆ Less runtime errors.☆ Less runtime errors.☆ Less runtime errors.

☆ "数理科学的バグ撲滅方法論のすすめ"☆ "数理科学的バグ撲滅方法論のすすめ"☆ "数理科学的バグ撲滅方法論のすすめ"☆ "数理科学的バグ撲滅方法論のすすめ"☆ "数理科学的バグ撲滅方法論のすすめ"http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/http://itpro.nikkeibp.co.jp/article/COLUMN/20060915/248230/

Page 9: Metasepi team meeting #14: ATS programming on MCU

How create Metasepi?How create Metasepi?How create Metasepi?How create Metasepi?How create Metasepi?

Page 10: Metasepi team meeting #14: ATS programming on MCU

Snatch-driven developmentSnatch-driven developmentSnatch-driven developmentSnatch-driven developmentSnatch-driven development

Dogfooding style.Dogfooding style.Dogfooding style.Dogfooding style.Dogfooding style.

Page 11: Metasepi team meeting #14: ATS programming on MCU

Demo: ATS on raw ArduinoDemo: ATS on raw ArduinoDemo: ATS on raw ArduinoDemo: ATS on raw ArduinoDemo: ATS on raw Arduinohttps://github.com/fpiot/arduino-mega2560-atshttps://github.com/fpiot/arduino-mega2560-atshttps://github.com/fpiot/arduino-mega2560-atshttps://github.com/fpiot/arduino-mega2560-atshttps://github.com/fpiot/arduino-mega2560-ats

Page 12: Metasepi team meeting #14: ATS programming on MCU

Demo: ATS on mbed platformDemo: ATS on mbed platformDemo: ATS on mbed platformDemo: ATS on mbed platformDemo: ATS on mbed platformhttps://github.com/fpiot/mbed-atshttps://github.com/fpiot/mbed-atshttps://github.com/fpiot/mbed-atshttps://github.com/fpiot/mbed-atshttps://github.com/fpiot/mbed-ats

Page 13: Metasepi team meeting #14: ATS programming on MCU

What is ATS language?What is ATS language?What is ATS language?What is ATS language?What is ATS language?

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

☆ Dependent types☆ Dependent types☆ Dependent types☆ Dependent types☆ Dependent types

☆ Linear types☆ Linear types☆ Linear types☆ Linear types☆ Linear types

☆ Without any runtime☆ Without any runtime☆ Without any runtime☆ Without any runtime☆ Without any runtime

☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC☆ Optional GC

Page 14: Metasepi team meeting #14: ATS programming on MCU

ATS compile flowATS compile flowATS compile flowATS compile flowATS compile flow

Page 15: Metasepi team meeting #14: ATS programming on MCU

ATS programming on MCUATS programming on MCUATS programming on MCUATS programming on MCUATS programming on MCU

You can choose the following 2-way.You can choose the following 2-way.You can choose the following 2-way.You can choose the following 2-way.You can choose the following 2-way.

On BareMetal hardwareOn BareMetal hardwareOn BareMetal hardwareOn BareMetal hardwareOn BareMetal hardware

☆ Arduino (8-bit AVR)☆ Arduino (8-bit AVR)☆ Arduino (8-bit AVR)☆ Arduino (8-bit AVR)☆ Arduino (8-bit AVR)

☆ Cortex-M (32-bit ARM)☆ Cortex-M (32-bit ARM)☆ Cortex-M (32-bit ARM)☆ Cortex-M (32-bit ARM)☆ Cortex-M (32-bit ARM)

On RTOSOn RTOSOn RTOSOn RTOSOn RTOS

☆ mbed☆ mbed☆ mbed☆ mbed☆ mbed

☆ ChibiOS/RT☆ ChibiOS/RT☆ ChibiOS/RT☆ ChibiOS/RT☆ ChibiOS/RT

Page 16: Metasepi team meeting #14: ATS programming on MCU

ATS on BareMetal hardwareATS on BareMetal hardwareATS on BareMetal hardwareATS on BareMetal hardwareATS on BareMetal hardware

Read/write memory using pointer.Read/write memory using pointer.Read/write memory using pointer.Read/write memory using pointer.Read/write memory using pointer.

Page 17: Metasepi team meeting #14: ATS programming on MCU

ATS on RTOSATS on RTOSATS on RTOSATS on RTOSATS on RTOS

Interaction with C.Interaction with C.Interaction with C.Interaction with C.Interaction with C.

Page 18: Metasepi team meeting #14: ATS programming on MCU

Produce/Consume Linear TypeProduce/Consume Linear TypeProduce/Consume Linear TypeProduce/Consume Linear TypeProduce/Consume Linear Type

Page 19: Metasepi team meeting #14: ATS programming on MCU

At-viewAt-viewAt-viewAt-viewAt-view

Page 20: Metasepi team meeting #14: ATS programming on MCU

Japan ATS User GroupJapan ATS User GroupJapan ATS User GroupJapan ATS User GroupJapan ATS User Group

http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/http://jats-ug.metasepi.org/

☆ In a parody of http://jaws-ug.jp/☆ In a parody of http://jaws-ug.jp/☆ In a parody of http://jaws-ug.jp/☆ In a parody of http://jaws-ug.jp/☆ In a parody of http://jaws-ug.jp/

☆ Translate ATS docs into Japanese☆ Translate ATS docs into Japanese☆ Translate ATS docs into Japanese☆ Translate ATS docs into Japanese☆ Translate ATS docs into Japanese

☆ Push the Facebook like button, now!☆ Push the Facebook like button, now!☆ Push the Facebook like button, now!☆ Push the Facebook like button, now!☆ Push the Facebook like button, now!

Page 21: Metasepi team meeting #14: ATS programming on MCU

Many translated documentsMany translated documentsMany translated documentsMany translated documentsMany translated documents* ATSプログラミング入門 http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/index.html* ATSプログラミングチュートリアル http://jats-ug.metasepi.org/doc/ATS2/ATS2TUTORIAL/index.html* Effective ATS https://github.com/jats-ug/translate/blob/master/Manual/EffectiveATS.md* MLプログラマ向けATS言語ガイド https://github.com/jats-ug/translate/blob/master/Web/cs.likai.org/ats/ml-programmers-guide-to-ats.md* 安全なプログラミング言語を使って heartbleed を防ぐには https://github.com/jats-ug/translate/blob/master/Web/bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.md* 状態を持つ観 (view) を通じてポインタを扱う安全なプログラミング https://github.com/jats-ug/translate/blob/master/Paper/SPPSV-padl05/SPPSV-padl05.md

* ATSプログラミング入門 http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/index.html* ATSプログラミングチュートリアル http://jats-ug.metasepi.org/doc/ATS2/ATS2TUTORIAL/index.html* Effective ATS https://github.com/jats-ug/translate/blob/master/Manual/EffectiveATS.md* MLプログラマ向けATS言語ガイド https://github.com/jats-ug/translate/blob/master/Web/cs.likai.org/ats/ml-programmers-guide-to-ats.md* 安全なプログラミング言語を使って heartbleed を防ぐには https://github.com/jats-ug/translate/blob/master/Web/bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.md* 状態を持つ観 (view) を通じてポインタを扱う安全なプログラミング https://github.com/jats-ug/translate/blob/master/Paper/SPPSV-padl05/SPPSV-padl05.md

* ATSプログラミング入門 http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/index.html* ATSプログラミングチュートリアル http://jats-ug.metasepi.org/doc/ATS2/ATS2TUTORIAL/index.html* Effective ATS https://github.com/jats-ug/translate/blob/master/Manual/EffectiveATS.md* MLプログラマ向けATS言語ガイド https://github.com/jats-ug/translate/blob/master/Web/cs.likai.org/ats/ml-programmers-guide-to-ats.md* 安全なプログラミング言語を使って heartbleed を防ぐには https://github.com/jats-ug/translate/blob/master/Web/bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.md* 状態を持つ観 (view) を通じてポインタを扱う安全なプログラミング https://github.com/jats-ug/translate/blob/master/Paper/SPPSV-padl05/SPPSV-padl05.md

* ATSプログラミング入門 http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/index.html* ATSプログラミングチュートリアル http://jats-ug.metasepi.org/doc/ATS2/ATS2TUTORIAL/index.html* Effective ATS https://github.com/jats-ug/translate/blob/master/Manual/EffectiveATS.md* MLプログラマ向けATS言語ガイド https://github.com/jats-ug/translate/blob/master/Web/cs.likai.org/ats/ml-programmers-guide-to-ats.md* 安全なプログラミング言語を使って heartbleed を防ぐには https://github.com/jats-ug/translate/blob/master/Web/bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.md* 状態を持つ観 (view) を通じてポインタを扱う安全なプログラミング https://github.com/jats-ug/translate/blob/master/Paper/SPPSV-padl05/SPPSV-padl05.md

* ATSプログラミング入門 http://jats-ug.metasepi.org/doc/ATS2/INT2PROGINATS/index.html* ATSプログラミングチュートリアル http://jats-ug.metasepi.org/doc/ATS2/ATS2TUTORIAL/index.html* Effective ATS https://github.com/jats-ug/translate/blob/master/Manual/EffectiveATS.md* MLプログラマ向けATS言語ガイド https://github.com/jats-ug/translate/blob/master/Web/cs.likai.org/ats/ml-programmers-guide-to-ats.md* 安全なプログラミング言語を使って heartbleed を防ぐには https://github.com/jats-ug/translate/blob/master/Web/bluishcoder.co.nz/2014/04/11/preventing-heartbleed-bugs-with-safe-languages.md* 状態を持つ観 (view) を通じてポインタを扱う安全なプログラミング https://github.com/jats-ug/translate/blob/master/Paper/SPPSV-padl05/SPPSV-padl05.md

Page 22: Metasepi team meeting #14: ATS programming on MCU

Follow me!Follow me!Follow me!Follow me!Follow me!

https://twitter.com/jats_ughttps://twitter.com/jats_ughttps://twitter.com/jats_ughttps://twitter.com/jats_ughttps://twitter.com/jats_ug