3 ms·
Python is a Turing complete language that can do anything. Dhall isn't. That lack of power means that a configuration language can still do a lot, but stick to
by KirinDave 8y ago
Python is a Turing complete language that can do anything. Dhall isn't. That lack of power means that a configuration language can still do a lot, but stick to its mission of configuration. It produces a final value (probably a map or list). Your real program reads that value and does the real work. Why complicate your real program with that? Offload it to dhall and you get a consistent configuration for free!
Think of all those places (e.g., Chef and Circle) where people try to encode graphs and processes in YAML. Dhall could do much of the same work of producing a simple spec, but without the fear of infinite loops or nonsensical Bash parameters hitting a function.
Dhall is such a simple language (really just function application and and some built-in datatypes and access principles) that it doesn't seem terribly costly as opposed to, say, embedding a complex graph into YAML (risking structural errors) or Python (risking extremely complex behavior and execute-only configuration). If what you really want is a declarative set of instructions to your real program, Dhall is probably one of the most awesome tools in the open source world for making it.
- antpls 8y agoYou sound like a marketer trying to sell a fridge on a phone call. > Why complicate your real program with that? Offload it to dhall and you get a consistent configuration for free! Why complicate my projects pipeline and force my team to learn yet another tool that may just be abandonned in 3 months? > Dhall could do much of the same work of producing a simple spec, but without the fear of infinite loops or nonsensical Bash parameters hitting a function. Last time I wrote an infinite loop in Python was... I can't remember. Maybe 5 years ago? Nonsensical is subjective. Maybe Dhall only makes sense to you. > Dhall is such a simple language There is no objective criteria to define a "simple" language. Perl was simple to some people. > If what you really want is a declarative set of instructions to your real program, Dhall is probably one of the most awesome tools in the open source world for making it. Or you could write a nice Python library, with clean API, and eventually a linter that makes sure the Python configuration file is a restricted subset of Python.
- KirinDave 8y ago> You sound like a marketer trying to sell a fridge on a phone call. I've got no stake in Dhall and I'm not a contributor. Check my submission history to see the sorts of things I try to do at HN if you're curious what my agenda here is. > Why complicate my projects pipeline and force my team to learn yet another tool that may just be abandonned in 3 months? Dhall's substantially older than this and open source, so its not really an attrition risk in 2018. But I'd argue your pipeline is already complicated. My CircleCI2 flow got enourmously simpler when I was no longer struggling to represent complex concepts in YAML and could just produce an object graph in Dhall and then render it to the right YAML. I've also switched to using it to generate json for mesos API calls to make sure I get the fields right. > Or you could write a nice Python library, with clean API, and eventually a linter that makes sure the Python configuration file is a restricted subset of Python. I grant, this is possible. But why does having it "in Python" matter? How does that help people writing Golang or C# or Ocaml or Scala or Ruby? Dhall's decision to template out more standard files is a smart one, it means it can serve as a stand-in and let programs that do the heavy lifting of a product or process (e.g., a Python ML binding or airflow process) use their normal tooling and do what they love. If you're mad it is written in Haskell, I dunno what to tell you other than that it's like "jq". The host language doesn't matter because you invoke it for its outputs.
- antpls 8y ago> Check my submission history to see the sorts of things I try to do at HN if you're curious what my agenda here is. I don't care where you come from, I'm judging the arguments in this thread. > My CircleCI2 flow got enourmously simpler "Enormously" is relative. Do you have any numbers? > But why does having it "in Python" matter? Because of the Bus factor. Many more people already know Python. > Dhall's decision to template out more standard files is a smart one The smartest move is the one that makes the most economical sense. Do you have number to prove it's a smart decision?
- haskellandchill 8y agoActually, believe it or not, economics is not the only measure we have to respect. There is joy in simplicity and understandability that does not need to be mapped to costs on a number line.