[gambit-list] In Scheme, what's the benefits and disadvantages with using a Scheme or FFI library for a given purpose?

Cyrille Duret cduret at gmail.com
Mon Aug 6 03:37:57 EDT 2012

you're right mikael, most of the time is better to use the scheme library
if good implementation are available (wich is the case with ssax-sxml).

In my case I implemented my own module/compilation mechanism. I was not
brave enough to reshape the ssax-sxml source code to my needs. It was far
less difficult for me to "plug" the libxml library to my framework.

Maybe the debate would be if it is relevant to develop a 100% scheme
project as in my opinion the low-level code is hard to maintain in a
dynamic non-typed language.


On Mon, Aug 6, 2012 at 8:13 AM, Mikael <mikael.rcv at gmail.com> wrote:

> (repost w more suitable title)
> Below, I will understand that the use of SXML is made with the highly
> qualitative SSAX-SXML library, which has several parts (serialization,
> sxpath etc.) and is distributed for lots of Scheme implementations on a
> public domain basis. Essential parts of it are available as Black Hole
> modules for anyone for whom that might be of interest. Now:
> What is advantageous of using SXML or LIBXML depends on the application.
> Motivations for using a C library for a particular mechanism that is
> already implemented in very very well in Scheme would be, that you are
> using some code that requires you to use that C library anyhow, or, that
> there would happen to be some routines implemented in that C library that
> you need, are not in the Scheme library, and by some reason would be very
> time-consuming to implement.
>      Also of course, like Cyrille points out, there can be occasions when
> you want or need a specific library choice due to reasons relating to how
> you handle the code in your application, or the specific computer
> environment in which your application will execute.
> From a very wide perspective, I relate to such occasions as very rare.
> SXML is a data format standard that expresses the entire XML format
> in S-expression form. For several purposes this is highly usable.
> As a general rule, processing Scheme objects rather than FFI objects
> carries many benefits with it: the language and routines for processing and
> manipulation available is extremely rich already (sporadic examples:
> iteration and serialization), your need of custom code for many operations
> is zero, and also as a sidenote the memory handling is implicit in all
> steps, including safety of memory fragmentation.
> SXML is, generally speaking, an excellent example of when this applies.
> The only thing that SXML does not include, which a typical XML library does
> include, is a parent element attribute on (SXML/XML) elements. For the one
> for whom that would show to be relevant though, it's easy enough to
> implement, didn't hear anyone ask for that up to now though.
> If you have further thoughts or questions please feel free to share,
> Mikael
> 2012/7/17 Klaus Schilling <schilling.klaus at web.de>
>> What are the major advantages of using libxml2 xmlreader with ffi over
>> using sxml?
>> Klaus Schilling
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120806/09d8d29f/attachment.htm>

More information about the Gambit-list mailing list