dxml 0.1.0 released

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sun Feb 11 10:34:11 UTC 2018


On Sunday, February 11, 2018 10:11:05 Russel Winder via Digitalmars-d-
announce wrote:
> On Fri, 2018-02-09 at 13:47 -0800, H. S. Teoh via Digitalmars-d-
>
> announce wrote:
> > On Fri, Feb 09, 2018 at 02:15:33PM -0700, Jonathan M Davis via
> >
> > Digitalmars-d-announce wrote:
> > > I have multiple projects that need an XML parser, and
> > > std_experimental_xml is clearly going nowhere, with the guy who
> > > wrote
> > > it having disappeared into the ether, so I decided to break down
> > > and
> > > write one. I've kind of wanted to for years, but I didn't want to
> > > spend the time on it. However, sometime last year I finally decided
> > > that I had to, and it's been what I've been working on in my free
> > > time
> > > for a while now. And it's finally reached the point when it makes
> > > sense to release it - hence this post.
> >
> > Hooray!  Finally, a glimmer of hope for XML parsing in D!
>
> I wonder why no-one has tried using DStep to create a D binding for
> libxml2 and libxslt.
>
> Whilst Python has a SAX and DOM parsing capability, well three
> different ones in the standard library, anyone doing serious XML work
> in Python uses lxml which is just a Python binding to libxml2 and
> libxslt.
>
> If Python people have given up on the XML stuff in it's standard
> library and use a binding to a well known and distributed one, is this
> a good path for D?

Given how strings work in D, parsing is something that we should easily be
able to do faster than other languages - or at least, other languages
typically have to write much less idiomatic code and go to a lot more effort
to reach the speeds that we can easily reach with idiomatic D code. So, in
general, IMHO, parsers are one of those things that we should typically be
writing natively.

That being said, if someone really wants full DTD support, I have no problem
sending them off to deal with bindings to C/C++ libraries, since I for one
am not willing to put in the time or effort to support that part of the XML
spec, since it complicates things considerably while adding nothing positive
IMHO. I'm sure that a D solution could compete excellently with a C/C++
solution, but it's sure not worth my time and effort, and no one else has
stepped up to implement anything along those lines.

Also, we're not about to put bindings to a C/C++ library for XML in Phobos
(it's already been argued quite a bit that doing so with curl was a big
mistake), so if we want to replace std.xml, that calls for writing a
replacement in D.

- Jonathan M Davis



More information about the Digitalmars-d-announce mailing list