Upgrade to Pro — share decks privately, control downloads, hide ads and more …

自作言語にモジュールを実装した話

Yuya Kono
December 20, 2020

 自作言語にモジュールを実装した話

第33回 #hiro_it で発表したスライド
https://github.com/takoeight0821/kagami

Yuya Kono

December 20, 2020
Tweet

More Decks by Yuya Kono

Other Decks in Programming

Transcript

  1. ࣗ࡞ݴޠ(SJ f module HelloImport = { import Prelude; main =

    { putStr (String# "hello"#); putStrLn |> { f -> f (String# " world"#) }; }; } ੺͍ͱ͜ΖΛ࡞ͬͨ
  2. (SJ f f ͷϞδϡʔϧͷจ๏ module Hello = { -- ϞδϡʔϧHelloͷએݴ

    import Prelude; -- ϞδϡʔϧPreludeͷΠϯϙʔτ main = { putStr (String# "hello"#); putStrLn |> { f -> f (String# " world"#) }; }; }
  3. ίϯύΠϧͷྲྀΕ  1BSFOUHSGͷίϯύΠϧ  1BSFOUPɺ1BSFOUHS f i ͷੜ੒  $IJMEHSGͷίϯύΠϧ

     1BSFOUHS f i ͷಡΈࠐΈ  $IJMEPɺ$IJMEHS f i Oͷੜ੒  1BSFOUPͱ$IJMEPͷϦϯΫ
  4. ·ͱΊ w ࣗ࡞ݴޠ(SJ f f ʹϞδϡʔϧΛ࣮૷ͨ͠ w ͍͔ͭ͘ͷ%FTJHODIPJDF͕͋ͬͨ w จ๏ɺػೳɺ࣮૷ํ๏

    50%0ɿϞδϡʔϧͷґଘؔ܎ΛࣗಈͰղܾ͢ΔϏϧυγεςϜ 
 ɹɹɹɹΑΓߴػೳͳϞδϡʔϧͷ࣮ݱ 
 ɹɹɹɹඪ४ϥΠϒϥϦͷ੔උ