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

Contributing to Crystal

Dea1add99f4cf942792c0f185aa2f2fd?s=47 Linda_pp
January 21, 2016

Contributing to Crystal

Contributing to being-developed language is so fun!

Dea1add99f4cf942792c0f185aa2f2fd?s=128

Linda_pp

January 21, 2016
Tweet

Transcript

  1. Contributing to Crystal LT at ౦ژ Crystal ษڧձ #3 @Linda_pp

    @rhysd
  2. is:pr author:rhysd repo:manastech/crystal • Random::Mt19937 ࣮૷ • Array#transpose ࣮૷ •

    ͦͷଞɼࡉ͔͍मਖ਼΍վળ • vim-crystal
  3. Crystal ͱ͸… • ݱࡏ 0.10.2 Ͱ։ൃதͷݴޠ • ഁյతมߋ͕ೖΓ·͘Γɼ·ͩ production ready

    Ͱ͸ͳ͍ʢ #1824 ʹͯ·ͨେ͖͍ม ߋ͕དྷͦ͏ʣ • ٯʹݴ͏ͱഁյతมߋΛ൐͏ఏҊͰ΋ൺֱ త؆୯ʹऔΓࠐ·ΕΔঢ়ଶ
  4. ഁյతมߋͰ΋ൺֱత؆୯ʹ औΓࠐ·ΕΔ ޓ׵ੑʹनΘΕͣʹվળΛߟ͑ΒΕΔɽϓϧ ϦΫ࣌΋มߋͷྑ͠ѱ͠ʹूதͯٞ͠࿦Ͱ͖ Δ ݴޠॲཧܥ͍͡Γ͍ͨ੎ʹͱͬͯ͸ָ͍͠ʂ

  5. ✌('ω'✌ )ࡾ✌('ω')✌ࡾ( ✌'ω')✌

  6. গ͚ͩ͠ Crystal ͷίϯύΠϥʹ ͍ͭͯ • Crystal Ͱॻ͔Ε͍ͯΔʢself hostedʣ • AST

    ͷఆٛʢ·ͣ͸σʔλߏ଄Λ஌Δ΂͖ʣɹɹɹɹɹɹɹ crystal/src/compiler/crystal/semantic/ast.cr • LexerɼParser ͸ͱͯ΋ૉ๿ͳ࣮૷ͰಡΈ΍͍͢ɽߏจΛ௥Ճɾ मਖ਼͍ͨ͠ͳΒ͜͜Λ͍͡Δɹɹɹɹɹɹɹɹɹɹɹɹɹ crystal/src/compiler/crystal/syntax • ίʔυੜ੒͸ LLVM ͷ C binding Λݺͼग़ͯ͠࢖͍ͬͯΔ ʢLLVM IR Builder)ɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹ crystal/src/compiler/crystal/codegen
  7. Crystal ʹ contribute ͢Δํ๏ • ҰൠతͳϦϙδτϦͱಉ͡ • खݩͰमਖ਼ͯ͠ spec Λ࣮ߦͯ͠໰୊ແ͍ࣄΛ

    ֬ೝ͢Δ • ϓϧϦΫΛॻ͘ • େମ @asterite ͞ΜͷҰଘͰϚʔδʢυΩϡϝ ϯτमਖ਼΍؆୯ͳमਖ਼ͳΒ @jhass ͞Μ΋ʣ
  8. ஫ҙ఺ʢmakeʣ • make (crystal/bin/crystal) ͸ίϯύΠϧͨ͠ίϯύΠ ϥͰίϯύΠϧ͢Δ • ↓Ͳ͕͜·͍͔ͣ෼͔Γ·͔͢ʁ 1. ίϯύΠϥͷίʔυΛ͍͡Δ

    2. make ͰίϯύΠϧ 3. 1. ͷมߋ͕·͔ͣͬͨͷͰमਖ਼͢Δ 4. make ͰίϯύΠϧ
  9. ஫ҙ఺ʢmakeʣ 1. ίϯύΠϥͷίʔυΛ͍͡Δ 2. make ͰίϯύΠϧ ← ෆద੾ͳίϯύΠϥAΛੜ ੒ʣ 3.

    1. ͷมߋ͕·͔ͣͬͨͷͰमਖ਼͢Δ 4. make ͰίϯύΠϧ ← ෆద੾ͳίϯύΠϥ A Λ ࢖ͬͯ৽ͨʹίϯύΠϥ B Λੜ੒ • ݁Ռͱͯ͠ग़དྷ্͕ͬͨίϯύΠϥ B ͸ਖ਼͠ ͘ಈ͔ͳ͍Մೳੑ͕͋Δ
  10. ͳΔ΄ͲΘ͔ΒΜ ϓϧϦΫϒϥϯνʹ push ͢Δલʹɼͻͱ· ͣ make clean ͔ͯ͠Β make ͯ͠ςετ͕

    ௨Δ͔֬ೝ͢Ε͹ OK
  11. ·ͱΊ • ݴޠॲཧܥ͍͡Δͷ͸ָ͍͠ • Ͱ΋…ʢϋʔυϧ͕ʣ͓ߴ͍ΜͰ͠ΐ͏ʁ • Crystal ͳΒߴ͘ͳ͍ • Crystal

    ͳΒഁյతมߋͰ΋ؾܰʹϓϧϦΫͰ͖Δ • ΋ͪΖΜυΩϡϝϯτमਖ਼ͳͲ΋׻ܴ͞ΕΔ by ɹɹɹ@Linda_pp