2 ms·
> name me one feature of declarative puppet language that definitively rules out possibility to classify it as functional language? Out of order operations? II
by jldugger 9y ago
> name me one feature of declarative puppet language that definitively rules out possibility to classify it as functional language?
Out of order operations? IIRC puppet is free to reorder operations, and thus you need to explicitly declare any dependencies between operations, and the runtime has a solver to decide what order is appropriate.
But it's kind of a silly dichtomy. Your article screams "I wish I had used Chef." It's technically a functional language, but looks very declarative:
acme_certificate site do
crt "/etc/apache2/ssl/#{site}.crt"
key "/etc/apache2/ssl/#{site}.key"
chain "/etc/apache2/ssl/#{site}.pem"
wwwroot '/var/www/website'
end
There's two general options for creating a DSL: define a formal grammar (Puppet) or extend an existing one to needs (ruby+chef). The latter gives you easy access to a community of existing developers, but ties you heavily to the language and runtime you extended. A formal grammar is more work to create, and more work to learn, but allows for multiple implemenations in languages and runtimes other than Ruby.
When you're courting the likes of Apple, Google, and Facebook, suddenly the scalability of the solution matters. Chef Server is in Erlang, which is neat, but chef-client will basically always be a slow ruby app.