mostly off-topic, OGDL, a data specification language

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

mostly off-topic, OGDL, a data specification language

Bennett Todd
I only mention this here because OGDL seems to address very prettily
one of the smaller, simpler problems that Lua handles, one that was
fairly central in Lua's birth (as I understand it), specifying
structured data. <URL:http://ogdl.org/>

OGDL isn't a programming language, like Lua. Instead, it's just a
data specification language. It uses indentation to specify a tree
structure. [Actually, there are provisions for handling generalized
directed graphs, but they can be viewed as an add-on].

I've been using Lua as the spec file language for a software
packaging tool I'm developing. I just stumbled across OGDL and it
lured me away. Here are my bash spec files,
in Lua:

    pkg = "bash-2.05b";
    url = [[
        http://mirrors.kernel.org/gnu/bash/bash-2.05b.tar.gz
        http://downloads.linuxfromscratch.org/bash-2.05b-2.patch
    ]];
    build = [[
        tar xzf bash-2.05b.tar.gz
        cd bash-2.05b
        ./configure --enable-static-link --with-curses \
            --prefix=/ --mandir=/usr/share/man --infodir=/usr/share/info
        make
        make prefix=$BPM_ROOT mandir=$BPM_ROOT/usr/share/man \
            infodir=$BPM_ROOT/usr/share/info install
        ln -s bash $BPM_ROOT/bin/sh
        rm -f $BPM_ROOT/usr/share/info/dir
        find $BPM_ROOT -type f|xargs file|grep 'ELF.*executable'|sed 's/:.*$//'|xargs strip
    ]];

and OGDL:

    pkg bash-2.05b

    url http://mirrors.kernel.org/gnu/bash/bash-2.05b.tar.gz
        http://downloads.linuxfromscratch.org/bash-2.05b-2.patch

    build \
        tar xzf bash-2.05b.tar.gz
        cd bash-2.05b
        ./configure --enable-static-link --with-curses \
            --prefix=/ --mandir=/usr/share/man --infodir=/usr/share/info
        make
        make prefix=$BPM_ROOT mandir=$BPM_ROOT/usr/share/man \
            infodir=$BPM_ROOT/usr/share/info install
        ln -s bash $BPM_ROOT/bin/sh
        rm -f $BPM_ROOT/usr/share/info/dir
        find $BPM_ROOT -type f|xargs file|grep 'ELF.*executable'|sed 's/:.*$//'|xargs strip

Like I said, this is mostly off-topic for this list; please direct
followups to me unless they are talking about Lua.

-Bennett

Attachment: pgpyaILmzcm1Z.pgp
Description: PGP signature

Reply | Threaded
Open this post in threaded view
|

Re: mostly off-topic, OGDL, a data specification language

John Belmonte
Bennett Todd wrote:
I've been using Lua as the spec file language for a software
packaging tool I'm developing. I just stumbled across OGDL and it
lured me away.

Isn't it trivial (a few lines of Lua code) to convert from the OGDL syntax to Lua, at least in the case of your example?

-John


--
http:// if  ile.org/

Reply | Threaded
Open this post in threaded view
|

Re: mostly off-topic, OGDL, a data specification language

Bennett Todd
2004-02-03T10:12:48 John Belmonte:
> Isn't it trivial (a few lines of Lua code) to convert from the OGDL 
> syntax to Lua, at least in the case of your example?

In the case of my example, definitely.

In the more general case, a formally correct OGDL parser written in
Lua shouldn't be too hard to do, it's not a baroque or complex
format.

Furthermore, using lua(1) as a command-line tool to extract bits of
Lua files, and using ODGL's gpath(1) in the same way, translators in
either direction are trivial in shell or like languages.

Lua is vastly more expressive as a data language, and is obviously
also a powerful and fast programming language.

I mentioned OGDL here because one teeny, minute job that a subset of
Lua does quite well seems to be handled a little bit more cleanly
(to my tastes!) by OGDL.

-Bennett

Attachment: pgpfOTwjqwfWG.pgp
Description: PGP signature

Reply | Threaded
Open this post in threaded view
|

Re: mostly off-topic, OGDL, a data specification language

Jamie Webb-3
On Tuesday 03 February 2004 15:22, Bennett Todd wrote:
> I mentioned OGDL here because one teeny, minute job that a subset of
> Lua does quite well seems to be handled a little bit more cleanly
> (to my tastes!) by OGDL.

By the look of things, Lua can often give more natural formats, where you 
don't have to explicitly map keys to values, e.g. I have (as executable input 
to a Lua program for generating complex C++ headers):

template ("typename T") "RecList" ("Serialisable")
{
   attrib "T*" "h";
   attrib "RecList<T>*" "t";
   constructor ("T", "RecList<T>");
   constructor ();
   method "T" "head" ();
   method "RecList<T>" "tail" ();
   method "bool" "empty" ();
   method "bool" "not_empty" ();
   method "int" "length" ();
   conversion "bool" "not_empty";
   method "void" "serialise" ("Marshaller");
}

 -- Jamie Webb