tcp to $webserver port www \ (max-src-conn-rate 100/10, \ overload <bad_hosts> flush global) pass out on em0 inet proto tcp \ from $developerhosts to any port 80 \ set queue developers pass out on em0 inet proto tcp \ from any to any port 25 • macros, quick implies flow control
rule ensures that all local mail is delivered using the # smtp transport, everything else will go via the smart host. R$* < @ $* .$m. > $* $#smtp $@ $2.$m. $: $1 < @ $2.$m. > $3 • no comments
around describing resources (and the rela6onships between them) in a declara6ve way, several parts of the language do depend on evalua6on order case $operatingsystem { centos, redhat: { $service_name = 'ntpd' } debian, ubuntu: { $service_name = 'ntp' } } package { $service_name: ensure => installed, }
manually just this once" • when repeated 5 9mes, wrap with a string interpola9on library • if not enough, try to add flow control as a "declara9ve" construct • when failed, embed a random PL with unclear boundaries • of course, error handling is ad-hoc trial-and-error • weep
of old RedHat 6 servers • adhoc apps were exposed to global state • adop+ng runc • +me to PoC - 3 hours • +me to produc+on - 12 hours (8 wasted tracing kernel code) • running on 2.6.32.602 with minor libcontainer patches
- automated MySQL replica1on • zalora/sproxy - proxy that handles OAuth2 + ACL interface • zalora/aws-ec2 - EC2 extensions for aris1db/aws • unicron, a single-user cron • a lot more on Zalora's GitHub
type-safe APIs data Expr :: * -> * where E :: Executable -> e -> Expr e Pipe :: Expr e -> Expr e -> Expr e Seq :: Expr e -> Expr e -> Expr e Or :: Expr e -> Expr e -> Expr e Redir :: Expr e -> FilePath -> Expr e Env :: [Pair] -> Expr e -> Expr e Sudo :: Expr e -> Expr e SSH :: Hostname -> e -> Expr e -> Expr e
* where Null :: Nix () Lit :: Literal -> Nix a -- ... Var :: Index -> Nix a Lam :: Index -> Nix a -> Nix (Nix input -> Nix a) Ap :: Nix (Nix input -> Nix a) -> Nix input -> Nix a -- ... List1 :: Nix a -> Nix [Nix a]
is a minefield for experimen5ng with parser combinators! • a lot of perf analysis or systems explora5on is done by analysing streams of text • use haskell if lost in awk+perl+sed • see proger/lxkit and zalora/gctuner
filled with adhoc interfaces with poor composablity and/or expressiveness • "tradi=onal" composi=on prac=ces are too error- prone and divert your precious a?en=on to fixing irrelevant bugs • basic PLT tools like transforma=onal programming and type systems keep you sane