when rational discussion was still a possibility
mofosyne at gmail.com
Sat Sep 6 07:40:46 EDT 2014
I heard about llvm and how it lets you compile to nearly everything using
Maybe possible to use that for cross compiling commonmark c implementation
to pho perhaps? Would wonder about speed penalties.
On 06/09/2014 9:26 pm, "Michel Fortin" <michel.fortin at michelf.ca> wrote:
> Le 6-sept.-2014 à 0:16, John MacFarlane <jgm at berkeley.edu> a écrit :
> > Michel,
> > What you did at the beginning, I gather, was to port (and then extend)
> > an existing implementation, Markdown.pl. The same will be possible with
> > CommonMark, which provides two implementations that use the same parsing
> > port to other dynamic languages: perl, python, ruby, PHP. (Or you could
> > rendering.) Those who work with compiled languages will be able to use
> > the C library directly.
> > The parsers are both fast and accurate. The original C parser I wrote
> > was about as fast as discount. An expert C coder is now working on
> > otimizing it and, without changing the algorithm, has managed to make it
> > about as fast as sundown, which is very fast indeed (0.01 seconds to
> > parse a 1MB document, for example). When optimization is complete, it
> > seconds for the above-mentioned 1MB document, running in the Chrome
> > browser). By comparising, Markdown.pl takes 250 seconds on the same
> > input, and pandoc takes 3.19 seconds.
> gets executed with JIT compilers) will beat PHP Markdown. I also have no
> doubt that your algorithm can be ported to PHP. I have some doubt it'll be
> fast enough in PHP.
> But regardless of performance, I can't swap my algorithm with your
> algorithm and still call it PHP Markdown if it gives significantly
> different results. CommonMark does not pass the PHP Markdown test suite,
> neither does it pass the original test suite made by John Gruber.
> Failing tests from the original test suite:
> Failing tests from PHP Markdown test suite:
> Some of these are obviously bugs on your side you'll likely fix. Some of
> these are degenerate cases I don't really care about the result as long as
> it produces valid HTML. But for some there is an obvious intent do produce
> something different (and there are probably more of these than the test
> suite can catch).
> My understanding is that CommonMark is a different flavor of Markdown that
> chose to diverge in a couple of small ways from the original. I could
> obviously fork it and "fix" things so they can pass my test suite and John
> Gruber's test suite and behave more like the original Markdown behave, but
> that's going to take a lot of time and it'll just create one more flavor
> situated in between PHP Markdown and CommonMark. That's not a worthy goal
> to me.
> - - -
> With all that said, if I do port CommonMark to PHP I'd probably call it
> PHP CommonMark and promote it as an alternative, better defined,
> Markdown-like syntax.
> Michel Fortin
> michel.fortin at michelf.ca
> Markdown-Discuss mailing list
> Markdown-Discuss at six.pairlist.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Markdown-Discuss