caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ANN: Sexplib - library for S-expression conversions
@ 2005-11-07 23:09 Markus Mottl
  2005-11-08 15:46 ` [Caml-list] " Florian Hars
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Markus Mottl @ 2005-11-07 23:09 UTC (permalink / raw)
  To: ocaml; +Cc: yaron jane

Hi,

we'd like to announce the availability of "Sexplib", which is a
library for handling S-expressions.  It features a syntax extension
for OCaml using the Camlp4-preprocessor, which generates efficient
code derived from type definitions to convert OCaml-values to
S-expressions and vice versa.  Errors during conversions are reported
fairly exactly and readably.

This syntax extension supports all extensional type constructions
(tuples/products, sum types, record types, variant types) together
with polymorphism.  Other datatypes (objects; abstract ones) require
user-defined converters, which can be added very easily.

The parsing and pretty-printing functions for S-expressions together
with the automatically generated converters make this library very
useful for a variety of purposes, e.g. for representing datastructures
in human-readable form, for debugging, etc.  We are using it for
handling fairly large and complex software configurations, and have
found this representation and functionality extremely helpful in
practice.

The Sexplib-library itself was initially derived from Martin Sandin's
Tywith-library, and is available free of charge under the
LGPL-license.  You can download it from the following site:

  http://www.janestcapital.com/ocaml

We, the Quant-group at Jane St. Capital, are in the process of setting
up this site to publish free software developed at our company.  We
hope you will find a lot more useful libraries there in the near
future.

Best regards,
Markus Mottl for the Quant Group at Jane St. Capital

--
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-07 23:09 ANN: Sexplib - library for S-expression conversions Markus Mottl
@ 2005-11-08 15:46 ` Florian Hars
  2005-11-08 18:29   ` Markus Mottl
  2005-11-08 16:04 ` N. Owen Gunden
  2005-11-09  2:09 ` N. Owen Gunden
  2 siblings, 1 reply; 8+ messages in thread
From: Florian Hars @ 2005-11-08 15:46 UTC (permalink / raw)
  To: Markus Mottl; +Cc: ocaml, yaron jane

Markus Mottl wrote:
> is available free of charge under the LGPL-license.

Just to make sure this isn't an accidental oversight: you know that the LGPL is 
almost always the wrong license for ocaml code (since it is almost 
indistinguishable from GPL due to the way the ocaml linker works) and made
a conscious decision to use it nonetheless?

Yours, Florian.
-- 
#!/bin/sh -
set - `type -p $0` 'tr [a-m][n-z]RUXJAKBOZ [n-z][a-m]EH$W/@OBM' fu XUBZRA.fvt\
angher echo;while [ "$5" != "" ];do shift;done;$4 "gbhpu $3;znvy sKunef.qr<$3\
&&frq -a -rc "`$4 "$0"|$1`">$3;rpub 'Jr ner Svtangher bs Obet.'"|$1|`$4 $2|$1`


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-07 23:09 ANN: Sexplib - library for S-expression conversions Markus Mottl
  2005-11-08 15:46 ` [Caml-list] " Florian Hars
@ 2005-11-08 16:04 ` N. Owen Gunden
  2005-11-09  2:09 ` N. Owen Gunden
  2 siblings, 0 replies; 8+ messages in thread
From: N. Owen Gunden @ 2005-11-08 16:04 UTC (permalink / raw)
  To: caml-list, ocaml

On Mon, Nov 07, 2005 at 06:09:34PM -0500, Markus Mottl wrote:
> we'd like to announce the availability of "Sexplib" [...]

And here are some simple usage examples:

----------------
# open Sexplib;;

# type t = { foo : int; bar : string; } with sexp;;
type t = { foo : int; bar : string; }
val sexp_of_t : t -> Sexplib.Sexp.t = <fun>
val t_of_sexp : Sexplib.Sexp.t -> t = <fun>

# let v = { foo = 3; bar = "baz"; };;
val v : t = {foo = 3; bar = "baz"}

# sexp_of_t v;;
- : Sexplib.Sexp.t = ((foo 3) (bar baz))

# t_of_sexp (Sexp.of_string "((foo 31337) (bar \"quux\"))");;
- : t = {foo = 31337; bar = "quux"}
----------------

You can also just get a converter for a specific direction, not both:

----------------
# type foo = A | B with sexp_of;;
type foo = A | B
val sexp_of_foo : foo -> Sexplib.Sexp.t = <fun>

# type foo = A | B with of_sexp;;
type foo = A | B
val foo_of_sexp : Sexplib.Sexp.t -> foo = <fun>
----------------

A more complicated example, building a bigger type out of the same t we
used above:

----------------
# type t' = t * [`foo|`bar] with sexp_of;;
type t' = t * [ `bar | `foo ]
val sexp_of_t' : t * [< `bar | `foo ] -> Sexplib.Sexp.t = <fun>

# sexp_of_t' (v, `foo);;
- : Sexplib.Sexp.t = (((foo 3) (bar baz)) foo)
----------------

I can also manually define the converter for a type that's contained
within, and the converter for the larger type will use mine:

----------------
# let sexp_of_t t = Sexp.Atom (Printf.sprintf "<t with foo=%d and bar=%S>" t.foo t.bar);;
val sexp_of_t : t -> Sexplib.Sexp.t = <fun>

# type t' = t * [`foo|`bar] with sexp_of;;
type t' = t * [ `bar | `foo ]

val sexp_of_t' : t * [< `bar | `foo ] -> Sexplib.Sexp.t = <fun>
# sexp_of_t' (v, `foo);;
- : Sexplib.Sexp.t = ("<t with foo=3 and bar=\"baz\">" foo)
----------------

 - O


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-08 15:46 ` [Caml-list] " Florian Hars
@ 2005-11-08 18:29   ` Markus Mottl
  2005-11-09  8:42     ` skaller
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Mottl @ 2005-11-08 18:29 UTC (permalink / raw)
  To: Florian Hars; +Cc: ocaml, yaron jane

On 11/8/05, Florian Hars <florian@hars.de> wrote:
> Markus Mottl wrote:
> > is available free of charge under the LGPL-license.
>
> Just to make sure this isn't an accidental oversight: you know that the LGPL is
> almost always the wrong license for ocaml code (since it is almost
> indistinguishable from GPL due to the way the ocaml linker works) and made
> a conscious decision to use it nonetheless?

Sorry for the confusion, but I should have mentioned in my
announcement that it is available under the LGPL including the special
exception also employed by INRIA to work around the linking
restrictions.  In case you have downloaded the library, you may have
seen that it was already distributed that way.  Thus you don't have
any excuse now for not using the library ;-)

Regards,
Markus

--
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-07 23:09 ANN: Sexplib - library for S-expression conversions Markus Mottl
  2005-11-08 15:46 ` [Caml-list] " Florian Hars
  2005-11-08 16:04 ` N. Owen Gunden
@ 2005-11-09  2:09 ` N. Owen Gunden
  2 siblings, 0 replies; 8+ messages in thread
From: N. Owen Gunden @ 2005-11-09  2:09 UTC (permalink / raw)
  To: caml-list

On Mon, Nov 07, 2005 at 06:09:34PM -0500, Markus Mottl wrote:
> we'd like to announce the availability of "Sexplib"

There is now a godi package: godi-sexplib


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-08 18:29   ` Markus Mottl
@ 2005-11-09  8:42     ` skaller
  2005-11-09  8:57       ` Sven Luther
  0 siblings, 1 reply; 8+ messages in thread
From: skaller @ 2005-11-09  8:42 UTC (permalink / raw)
  To: Markus Mottl; +Cc: Florian Hars, yaron jane, ocaml

On Tue, 2005-11-08 at 13:29 -0500, Markus Mottl wrote:

> Sorry for the confusion, but I should have mentioned in my
> announcement that it is available under the LGPL including the special
> exception also employed by INRIA to work around the linking
> restrictions.  


I use the acronym

	LGPLX

for that licence.

> In case you have downloaded the library, you may have
> seen that it was already distributed that way.  Thus you don't have
> any excuse now for not using the library ;-)

Unless you're redistributing source code under a less restrictive
licence eg BSD, MIT, etc ;(

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-09  8:42     ` skaller
@ 2005-11-09  8:57       ` Sven Luther
  2005-11-09  9:25         ` skaller
  0 siblings, 1 reply; 8+ messages in thread
From: Sven Luther @ 2005-11-09  8:57 UTC (permalink / raw)
  To: skaller; +Cc: Markus Mottl, yaron jane, Florian Hars, ocaml

On Wed, Nov 09, 2005 at 07:42:19PM +1100, skaller wrote:
> On Tue, 2005-11-08 at 13:29 -0500, Markus Mottl wrote:
> 
> > Sorry for the confusion, but I should have mentioned in my
> > announcement that it is available under the LGPL including the special
> > exception also employed by INRIA to work around the linking
> > restrictions.  
> 
> 
> I use the acronym
> 
> 	LGPLX
> 
> for that licence.

What about LGPL-OCAML ? 

Friendly,

Sven Luther


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] ANN: Sexplib - library for S-expression conversions
  2005-11-09  8:57       ` Sven Luther
@ 2005-11-09  9:25         ` skaller
  0 siblings, 0 replies; 8+ messages in thread
From: skaller @ 2005-11-09  9:25 UTC (permalink / raw)
  To: Sven Luther; +Cc: Markus Mottl, yaron jane, Florian Hars, ocaml

On Wed, 2005-11-09 at 09:57 +0100, Sven Luther wrote:
> On Wed, Nov 09, 2005 at 07:42:19PM +1100, skaller wrote:
> > On Tue, 2005-11-08 at 13:29 -0500, Markus Mottl wrote:
> > 
> > > Sorry for the confusion, but I should have mentioned in my
> > > announcement that it is available under the LGPL including the special
> > > exception also employed by INRIA to work around the linking
> > > restrictions.  
> > 
> > 
> > I use the acronym
> > 
> > 	LGPLX
> > 
> > for that licence.
> 
> What about LGPL-OCAML ? 

Fine by me, though I note that LGPL with linking exemption
need not be restricted to Ocaml: if others adopted this,
for example for C packages, the OCAML would be a misnomer.
OTOH LGPL-OCAML is more suggestive in the case of Ocaml
codes.

BTW: for Debian GPL and LGPL licences do not have to
be provided in full, since they're installed automatically
in /usr/share somewhere. It would be nice if LGPLX/LGPL-OCAML 
was treated the same way.

Although GODI cannot do it yet, eventually it would be nice
to be able to constrain and/or report licences when building
packages -- which requires a licencing system with centralised
licences with recognized keys and behaviour rules.

Maybe INRIA, Gerd and Sven can get together and agree on
an acronym, and also get the licence certified by OSS?

IMHO this licence is a pretty good compromise: it prevents
'closed source' being distributed fully closed, but it doesn't
prevent closed source being used to generate closed binaries,
nor does it prevent closed source being distributed along
with open source (provided that open source remains open).

AFAICS it only 'infects' sources if one derives from
a combination of the open and closed source, then the
closed sources must be opened.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-11-09  9:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-07 23:09 ANN: Sexplib - library for S-expression conversions Markus Mottl
2005-11-08 15:46 ` [Caml-list] " Florian Hars
2005-11-08 18:29   ` Markus Mottl
2005-11-09  8:42     ` skaller
2005-11-09  8:57       ` Sven Luther
2005-11-09  9:25         ` skaller
2005-11-08 16:04 ` N. Owen Gunden
2005-11-09  2:09 ` N. Owen Gunden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).