commonmark-d: A fast CommonMark and Github Flavoured Markdown parser, translation of MD4C
Guillaume Piolat
first.last at gmail.com
Mon Sep 30 23:06:42 UTC 2019
Hello,
commonmark-d is a D translation of MD4C, a fast SAX-like Markdown
parser.
MD4C achieves remarkable parsing speed through the lack of AST
and careful memory usage.
The route of translation was choosen because parsing Markdown is
much more involved that first thought. The D translation largely
preserve the speed benefits of M4DC.
Usage:
// Parse CommonMark, generate HTML
import commonmarkd;
string html = convertMarkdownToHTML(markdown);
Key Performance Numbers:
- commonmark-d compiles 3x faster than dmarkdown and 40x
faster than hunt-markdown.
- commonmark-d parses Markdown 2x faster than dmarkdown and
15x faster than hunt-markdown (see GitHub for benchmark details)
I haven't measured memory usage of either compile time or run
time, but I feel like it's also better.
Available now on DUB: http://code.dlang.org/packages/commonmark-d
GitHub page: https://github.com/p0nce/commonmark-d
More information about the Digitalmars-d-announce
mailing list