Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.c Subject: Re: C vs Haskell for XML parsing Date: Thu, 17 Aug 2023 00:23:11 +0100 Organization: A noiseless patient Spider Lines: 36 Message-ID: <87o7j6fu74.fsf@bsb.me.uk> References: <576801fa-2842-40dc-bf19-221a5b1cf660n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="c666b555a840b444cd6c032219f8b5e7"; logging-data="3657358"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SWkpZNmoYYo3Sw7jv888/OTlt27hXohU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:6MQXpymSd/Y81b3afJ857PSNhww= sha1:Rt7FEsqRhDqIiLdeao13R916B+8= X-BSB-Auth: 1.26de6dc6c6a614f16297.20230817002311BST.87o7j6fu74.fsf@bsb.me.uk Xref: csiph.com comp.lang.c:172423 Bart writes: > On 16/08/2023 08:31, Malcolm McLean wrote: >> Some people here are interested in Haskell. >> They might be interested in this: >> https://chrisdone.com/posts/fast-haskell-c-parsing-xml/ >> Of course it's written from a pro-Haskell point of view, and writing an >> improved version when you've got the C in front of you isn't really a >> fair test. But he does match C for speed. >> > > "Portability (i.e. Windows) is a pain in the arse with C." > > I wonder what makes them say that? Yes, I wondered that too, since the cut-down XML parsing they are doing is one of the most potentially portable bits of C one could write (as you say yourself): > Reading from a file must be the world's most portable kind of > program. But reading more closely, the remark is a general one about dropping out of a high-level language for some part of a program rather than being specific to this task. None the less, I'd have liked a citation or link. > While issues with filenames and paths will be the same whatever > the language. Not always. Some languages have standard library functions to handle such things (e.g. Python and Haskell). I imagine that's what the author was thinking about. -- Ben.