2 ms·
I think "natural language" is underspecified. E.g. it probably wouldn't be that hard to write some kind of templating engine that takes an XSL schema and output
by xg15 5y ago
I think "natural language" is underspecified. E.g. it probably wouldn't be that hard to write some kind of templating engine that takes an XSL schema and outputs something resembling plain English. Except, the output would likely read like the most horrible legalese you can imagine.
Then you have some like the algorithmic definitions that proliferate most of the web platform/HTML5 specs. Those are all "cookbook style" lists of steps written in plain English - and it's easy to understand what an individual step does. However, understanding what the whole algorithm does - or even more, why it does what the spec says - is just as hard as it would be with code or pseudocode.
- pfdietz 5y agoThe reason I want this is not to make the standards easier for people to understand. Sure, the standards will be in legalese. But they are already in legalese. The goal is to make the standards more comprehensible to machines as well, without further degrading their (already problematic) comprehensibility to humans. Kill two birds with one stone.
- xg15 5y agoHave a look at the WHATWG specs then - this might be a lot like what you want. E.g. Fetch [1]. Effectively, most of the spec could be written in pseudocode, except they expanded each pseudocode line into a complete sentence and annotated the whole thing with markers, links and commentary. The result is the afromentioned "cookbook style". I'm not sure if this is actually easier to read than pseudocode though. [1] https://fetch.spec.whatwg.org/#fetching https://fetch.spec.whatwg.org/#fetching
- pfdietz 5y agoThis is feeling like it has too much repetition. It might be better to compile that repetition to a table. Also, a compiler-to-natural-language should insert anaphora when appropriate. One might also ask how one encodes motivational statements into a more formal spec. For example, what does it mean to say what the "purpose" of something is? Also, general specifications ("whenever you do X, also do Y") should be possible. Considerations like that are interesting even without the translation-to-NL aspect.
- xg15 5y ago> One might also ask how one encodes motivational statements into a more formal spec. Well, you can always add preambles or annotations that are not machine-readable. If you really want to stay machine-readable, you could try to work with logical proposition languages, such as PROLOG. Also, I think goal trees (or goal DAGs) could be interesting. Something along the lines of "Our top-level is to help the user maintain invariant A. To archieve this, we implement features B, C, D. Feature B requires technical change E in service X while features C and D must be developed jointly and will require changes F and G in services X and Y..." Of course something like this always looks vastly simpler than it actually is. I think in many cases, you'll be hard-pressed to even formulate a top-level goal in ordinary language. (Apart from the real goal: Someone from the C-Suite wants this feature) The question also remains: What do you want to do with that machine-readable representation. The best representation will be strongly dependent on your use-cases - and formal languages without clear use-cases have a risk of devolving into cargo-cults and empty rituals. (See the whole navel-gazing around REST and HATEOAS)
- pfdietz 5y agoThere are many things one might do with such a representation. One that I am particularly interested in is connecting it to a program that implements the specification. That is, link the functions, variables, types, etc. of the program to corresponding parts of the spec. One could use this to generate documentation, traceability matrices, to generate unit tests for parts of the program, and to support evolution of the program as the specification changes.