Re: [MLton] cost of _export

Bernard Berthomieu <[email protected]> Wed, 10 Dec 2014 21:43:37 +0100
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
On 12/10/14 6:39 PM, Florian Weimer wrote:
> I have a toy implementation which uses C callbacks to serialize the
> events to a buffer on the C heap.  No C-to-SML callbacks are needed as
> a result, and there is only one SML-to-C-and-back transition per input
> buffer (4 KiB or so).
>
> Interested?  I could publish the sources as-is if you want to play
> with it.

I'd surely like to play with, thanks !

This looks like the solution I was using before, but I did not put
much effort on it. I find the current solution with callbacks in SML much
cleaner. Our parser makes use of a wrapper of expat into SML written
by a colleague and available with a BSD-style license at:

     https://github.com/ahamez/expatSML

Due to the issue discussed, it can be very slow on large files, but 
Matthew's
patch pretty much solves the problem. To benefit from the improvement
(and in addition to compiling the patched mlton), attribute "runtime"
must be added to the _import of function "XML_Parse" in file expat.sml.

Best,
   Bernard.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk