5 ms·
Great comment, simoncion. Let's define a simple empirical test to compare "X" to "Y" in terms of complexity: How long would it take for a person to write code
by breck 13y ago
Great comment, simoncion.
Let's define a simple empirical test to compare "X" to "Y" in terms of complexity:
How long would it take for a person to write code that reads and writes code in format "X"?
How long would it take for a person to write code that reads and writes code in format "Y"?
Let's call the current status quo of Bind/Zone "X".
My prediction, is there exists a Space based DSL that is functionally equivalent to X, let's call it "Y", that measures an order of magnitude better than X in terms of the complexity measure I defined above.
And why is this important? If it were a lot easier to write code that reads and writes code that operates at one of the lowest levels of the Internet, it would unleash a wave of innovation that is hard to predict the magnitude of.
- simoncion 13y agoI'm certainly not one to dismiss someone's hobby project; if it's a thing that is fun to work on, more power to you. You might even get a really useful result out of tinkering with it! I'm having a hard time imagining anything that's simpler than this p-code parser for a simple BIND-style zone file: if syntax error is encountered, abort with error read host read ttl optionally read class read type load expected rdata format for type read rdata if record read was duplicate data, abort with error Things get slightly more complicated when you add in $KEYWORDS, but not all that much. Anyway, if you can find a format that's an order-of-magnitude easier to work with than this, my hat's off to you. (If I were the sort of person that regularly found these sorts of things, I'd own an apartment building, rather than renting space in one. ;) )
- breck 13y agoGreat code example simoncion! Thanks for taking the time to write up that comment. You're example does indeed show a simple reader of BIND-style zone files. But, to write that, you brought to the table an understanding of BIND that I'm sure took you a long time to develop. A good Space DSL does not require a lot of domain knowledge to pick up. In other words, while the current BIND zone format uses punctation to indicate meaning, which then requires domain knowledge to read/write (or a textbook by your side), a good Space DSL is self documenting. So, my example using things like A and CNAME and TTL would be bad. Better would be something like this: breckyunits.com ip4 123.123.123.123 ip6 ::ffff:192.0.2.128 updateEvery 3600seconds
- simoncion 13y agoIt took me an afternoon of reading the docs on Wikipedia and Zytrax to grasp the basics of both zone files and BIND config files, and another hour or three with the tunnelbroker.net "certification" tests to grasp stuff like glue records. That's... not a long time to invest for such a useful thing. Also, the only punctuation I see in a zone file is for comments, $KEYWORDS, the SOA record, and "@" to indicate that a record is meant to apply the $ORIGIN. Did I miss something? If you don't like "A", "CNAME", and "TTL", let me propose a preprocessor that lets you do the following: host1.example.com update-3600-secs ip4 1.1.1.1 host1.example.com update-12-hours ip6 2001::1 host2.example.com update-24-hours alias host1.example.com host1.example.com update-1-week physical-location 52 22 23.000 N 4 53 32.000 E -2.00m 0.00m 10000m 10m This format retains the greppability of the existing zone file format as well as its drive-by appendability, while allowing one to ease one's way into the actual zone file syntax that's being used by your DNS server.
- vidarh 13y agoWhat is updated every 3600 seconds here? The entire breckyunits.com zone? The "ipv4" record? the ipv6 record? both? Zone files can express all of those easily, and need to. To be able to replicate their functionality, your DSL would need to be able to handle TTL's for each and every record. To me, your example is extremely ambiguous. It is certainly not self documenting. Because I happen to know DNS, I'd assume you're assigning a TTL for all the records of 3600. But how can I set the TTL only for one of them? And how do I add records for subdomains? Do I have to repeat the full name every time? Because that's a non-starter. And do you realize you've actually made this massively harder to work on with simple tools? Bind zone files keeps all except the SOA record on one line. This means that with some simple conventions, a site can easily format everything so that a single record can always be manipulated simply by operating on a single line of text. That makes it trivial to e.g. modify zones files in shell scripts with tools like "awk" etc. Almost anyone that needs to read and write zone files have advanced requirements - or we'd use a more user friendly, high level tool. And so a replacement would need to meet those requirements, including being able to write records on a single line, and being able to refer to the origin and use relative names.
- 13y ago
- vidarh 13y agoYou don't need to read or write zone files to write DNS servers. Zone files are irrelevant unless you want to be able to import Bind zone files for interoperability. So why exactly do you think this "operates at one of the lowest levels of the internet"? It does not. DNS servers do not talk to each other using this format.
- breck 13y ago> DNS servers do not talk to each other using this format. Right. I'm talking about all the formats.