5 ms·
Great 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. B
by breck 13y ago
Great 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.
- breck 13y agoGreat questions. Now I'm having to think about implementation more. Here's the basics of a system: /domains/ /domains/google.com.space Let's say the key requirements are: 1.) Domain pattern + ip address 2.) Some expiration timestamp 3.) Some property that tells you who told you that domain matched that IP The contents of file "google.com.space" then could be something like this: ip4 123.123.123.123 expiresEvery 3600seconds lastUpdated 2/2/2013 4:00pm receivedFrom dns.verizon.com For subdomains, you could do a "/domains/foobar.google.com.space" file, or maybe a "/domains/*.google.com.space" file, or maybe you just put them in the file above like so: ip4 123.123.123.123 expiresEvery 3600seconds lastUpdated 2/2/2013 4:00pm receivedFrom dns.verizon.com subdomains mail.google.com ip4 123.123.123.123 ttl 3600 Et cetera. The implementation details would be very important. There are plenty of sub decisions to make to come up with a great DSL. But I'm fundamentally confident that at the root level, the decision to create a Space based, object oriented domain system is not only correct, it is inevitable. It just feels right to me. Again, I've had the benefit of working with this structure for a while now, and am amazed at how so many things simplify down to it. Space is object oriented programming in an extremely simple, concise, robust, human readable way. Just as most (if not all) major computer programs nowadays are written in an object oriented way, I am predicting there will come a time when most major message passing systems are written in a Space encoded way. > That makes it trivial to e.g. modify zones files in shell scripts with tools like "awk" etc. I look at awk and I think that's something that will at some point be buried, and should be. awk is kind of like a neanderthal or some other species in between ape and human. Served it's purpose, helped the evolutionary chain, is a very honorable tool, but at some point will go extinct.