Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ネットワーク機器の中の OCaml
Search
Masayuki Mizuno
January 25, 2024
1
670
ネットワーク機器の中の OCaml
第五回関数型プログラミング(仮)の会発表スライド
Masayuki Mizuno
January 25, 2024
Tweet
Share
More Decks by Masayuki Mizuno
See All by Masayuki Mizuno
RubyでSlackのbotを作ろう
fetburner
0
87
継続オペレータの話
fetburner
0
120
Rubyでリストモナドを使う
fetburner
0
120
次世代のプロファイラVernierを試す
fetburner
0
91
数値計算とメモリ最適化
fetburner
0
180
3/14なので円周率を計算する
fetburner
0
360
Gotanda.rb#56
fetburner
0
93
遅延評価を使ってOSSのバグを修正した話
fetburner
1
210
Featured
See All Featured
KATA
mclloyd
29
14k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
What's new in Ruby 2.0
geeforr
343
31k
Adopting Sorbet at Scale
ufuk
73
9.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Happy Clients
brianwarren
98
6.7k
How GitHub (no longer) Works
holman
310
140k
Transcript
© 2023 Wantedly, Inc. ωοτϫʔΫػثͷதͷ OCaml Jan. 26 2023 -
Masayuki Mizuno (@fetburner)
ࠓ͢͜ͱ © 2023 Wantedly, Inc.
ࠓ͢͜ͱ ؔܕݴޠ OCaml ͕ΘΕ͍ͯΔ OSS ͷհ • ωοτϫʔΫ OS VyOS
VyOS ͰͲͷΑ͏ʹ OCaml ͕ΘΕ͍ͯΔ͔ • ઃఆϑΝΠϧͷॲཧܥ • ͷόϦσʔλ © 2023 Wantedly, Inc. VyOS झຯͰ͍ͬͯΔ͚ͩͰɺۀͷग़͖ͯ·ͤΜ
VyOS ͱ © 2023 Wantedly, Inc.
VyOS ͱ ΦʔϓϯιʔεͷωοτϫʔΫ OS • Debian ϕʔε • Vyatta ແঈ൛ͷϑΥʔΫ
• ϕΞϝλϧ্͚ͩͰͳ͘ɺԾԽج൫Ϋϥυ্Ͱͷಈ࡞αϙʔτ ۀ༻ϧʔλ૬ͷػೳΛඋ͑Δ • OSPFɺBGP4+ ͷϧʔςΟϯάϓϩτίϧ • IPsecɺSSL ʹجͮ͘ VPN ػೳ • VRF-lite ʹΑΔϧʔλԾԽ © 2023 Wantedly, Inc.
VyOS ͷ༻ײ JUNOS ϥΠΫͳ CUI ͰઃఆͰ͖Δ • ϧʔςΟϯάϓϩτίϧ VPNɺՌͯίϯςφ·Ͱ୯ҰͷઃఆϑΝΠϧͰཧ ©
2023 Wantedly, Inc.
OCaml ͕ͲͷΑ͏ʹΘΕ͍ͯΔ͔ © 2023 Wantedly, Inc.
എܠ: VyOS ͷΞʔΩςΫνϟ Linux ͷػߏ OSS ΛΈ߹ΘͤͯछʑͷػೳΛఏڙ • VyOS ͷઃఆϑΝΠϧΛ֤छιϑτͷͦΕʹม
© 2023 Wantedly, Inc. vyconf FRR strongSwan iptables … ݸผͷઃఆϑΝΠϧ VyOS ͷઃఆϑΝΠϧ
ͲͷΑ͏ʹ OCaml ͕ΘΕ͍ͯΔ͔ ઃఆϑΝΠϧͷॲཧܥ • ߏจղੳ AST ͷૢ࡞ͷͨΊͷϥΠϒϥϦ࣮ʹΘΕ͍ͯΔ • ࣮ࡍͷίʔυੜ
OCaml Ͱॻ͔ΕͨϥΠϒϥϦΛͬͯ Python Ͱ࣮ ઃఆͷόϦσʔλ • ೖྗ͕ਖ਼͍͠ IPv6 ΞυϨεʹͳ͍ͬͯΔ͔ • ߴԽͷͨΊʹݩʑ Python Ͱॻ͔Ε͍ͯͨόϦσʔλΛஔ͖͍͑ͯΔ © 2023 Wantedly, Inc.
OCaml Ͱॻ͔ΕͨίʔυΛಡΉ (1/2) © 2023 Wantedly, Inc. ϰΝϦΞϯτΛ׆༻ͯ͠ AST ͕ఆٛ͞Ε͍ͯΔ
https://github.com/vyos/vyconf/blob/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/src/ vytree.ml#L1-L7
OCaml Ͱॻ͔ΕͨίʔυΛಡΉ (2/2) © 2023 Wantedly, Inc. ύλʔϯϚονΛͬͯ AST ͷૢ࡞͕࣮͞Ε͍ͯΔ
https://github.com/vyos/vyconf/blob/dd9271b4304c6b1a5a2576821d1b2b8fd3aa6bf5/src/ vytree.ml#L22-L30
·ͱΊ © 2023 Wantedly, Inc.
·ͱΊ ωοτϫʔΫ OS ͷ VyOS Ͱ OCaml ͕ΘΕ͍ͯΔ • ઃఆϑΝΠϧͷॲཧܥ
• ֤छͷόϦσʔλ ҙ֎ͳॴʹؔܕݴޠͷً͚Δ໘͕͋Δ • ϰΝϦΞϯτύλʔϯϚονͷԸܙͰݴޠॲཧܥΛ؆୯ʹ࣮Ͱ͖Δͷ͕ڧ͍ • DSL ؚΊΕɺݴޠॲཧܥͷԠ༻ൣғ͍ © 2023 Wantedly, Inc.