News for hackers. Stuff that matters.
Re:The Future of Markdown by greggman on Friday October 26, 2012 @12:09AM (#4700840)
Specs are important but I'd argue a conformance test is equally or even more important.

With a conformance test people can test their implementations and when ambiguities arrise new tests can be added or old tests fixed. Without, conformance tests different interpretations of a spec lead to divergent behavior. Once that behavior is out there long enough it becomes difficult to fix as people are depended on it and/or its quirks.

Re:The Future of Markdown by mistercow on Friday October 26, 2012 @03:13AM (#4701199)
I'm confused. How are you supposed to have a conformance test without first having a spec? To what would the implementations be conforming, if not a spec?
Re:The Future of Markdown by greggman on Friday October 26, 2012 @03:39AM (#4701247)
Sorry, What I meant to really say is specs are not sufficient. Sure specs are important. But even with specs, without comprehensive conformance tests implementations will diverge.

I work on the WebGL spec and tests based off the OpenGL ES spec and tests. Even though the OpenGL ES spec is long and detailed, every edge case for which there is no test is broken or different in one driver or another.

Re:The Future of Markdown by jamesrom on Friday October 26, 2012 @09:21AM (#4702019)
In an ideal world, the spec would be the test. A spec is just a human readable test. A test is just a machine readable spec.
Re:The Future of Markdown by ZeroGravitas on Friday October 26, 2012 @07:29AM (#4701741)
It's entirely possible to build a conformance test suite around an existing 'black box' of code and accept that whatever it does, even stuff that might be considered a bug, is what any compliant implementation should also do.

(You could also fix some of the more egregious bugs, and then expect implementations to follow your new behaviour)

Re:The Future of Markdown by SideburnsOfDoom on Friday October 26, 2012 @04:49AM (#4701408)
> Specs are important but I'd argue a conformance test is equally or even more important.

I agree, but the article mentions tests prominently. They didn't miss that out.

Re:The Future of Markdown by bergie on Friday October 26, 2012 @05:02AM (#4701438)
Here are the tests we wrote for HTML-to-Markdown conversion. Could be useful when switched the other way around :-)

https://github.com/bergie/to-markdown/blob/master/test/tests...

Re:The Future of Markdown by draegtun on Friday October 26, 2012 @07:05AM (#4701666)
Also worth looking at the tests for Text::Markdown which is the canonical version of Markdown on CPAN.

https://metacpan.org/source/BOBTFISH/Text-Markdown-1.000031/...

Re:The Future of Markdown by th on Friday October 26, 2012 @03:39AM (#4701246)
> Without, conformance tests different interpretations of a spec lead to divergent behavior.

I think you mean either:

> Without conformance tests incorrect interpretations of a spec lead to divergent behavior

Or

> Without conformance tests different interpretations of an ambiguous spec lead to divergent behavior.

Conformance tests should test specific behavior defined in the spec. Tests will never (or rarely) prove spec conformance but spec conformance should always prove test conformance.

Re:The Future of Markdown by lmm on Friday October 26, 2012 @05:26AM (#4701491)
I have yet to encounter a spec that was not in some way ambiguous.
Re:The Future of Markdown by jjr on Friday October 26, 2012 @08:20AM (#4701843)
1 + 1 = 2 Is fairly unambiguous until you introduce operator overloading (and why i despise overloading).
Re:The Future of Markdown by _pferreir_ on Saturday October 27, 2012 @04:45AM (#4705753)
> 1 + 1 = 2 Is fairly unambiguous until you introduce operator overloading (and why i despise overloading).

It is only unambiguous if you specify the numbering system you are using ;)

</pedantic>

Re:The Future of Markdown by cynicalkane on Saturday October 27, 2012 @12:06PM (#4706412)
Is there actually a notation and + operator for which 1 + 1 = 2 is ambiguous? Only being semi-rhetorical, I'd be interested to know if there is one. (Modular arithmetic is not considered ambiguous, at least not in the math neck of the woods.)
Re:The Future of Markdown by josch on Saturday October 27, 2012 @05:09PM (#4707246)
Not really answering your question, but more to the point of the discussion in my opinion, a() + b() could be ambiguous if a() and b() are functions with side effects and the evaluation order of the +-operator is not specified.
Re:The Future of Markdown by ramses0 on Saturday October 27, 2012 @03:40PM (#4707009)
1 + 1 = 10b is what he's saying.
Re:The Future of Markdown by _pferreir_ on Monday October 29, 2012 @02:34PM (#4713732)
Yes, that's what I meant - even "1 + 1 = 2" can be ambiguous if no context is provided.
Re:The Future of Markdown by JadeNB on Friday October 26, 2012 @02:29PM (#4703522)
> 1 + 1 = 2 Is fairly unambiguous until you introduce operator overloading (and why i despise overloading).

What is it specifying—or, perhaps a better question, what would an implementation look like? It might be more precise to say "I have yet to encounter an implemented spec that was not in some way ambiguous."

Re:The Future of Markdown by richbradshaw on Saturday October 27, 2012 @05:13PM (#4707262)
1 + 1 != 2 if the 1s are magnitudes of vectors - if the directions are opposite, then they can be 0. In fact, 0 <= 1 + 1 <= 2 in that system.
Re:The Future of Markdown by Dylan16807 on Wednesday October 31, 2012 @02:31PM (#4724364)
That's not how addition works. You're either adding the vectors or you're adding the magnitudes. You don't get to sleight of hand by writing one and adding the other.
Re:The Future of Markdown by nollidge on Friday October 26, 2012 @11:10AM (#4702452)
Overloading is a feature of natural language though, and therefore completely unavoidable in writing a spec.
Re:The Future of Markdown by anthonyb on Friday October 26, 2012 @07:18AM (#4701704)
Hee hee, your interpretation of his sentence is introducing ambiguities :)