[dmd-beta] D 2.062 beta

Nick Sabalausky bus_dmdbeta at semitwist.com
Thu Feb 14 19:21:18 PST 2013


On Fri, 15 Feb 2013 02:47:48 +0100
Leandro Lucarella <luca at llucax.com.ar> wrote:

> Nick Sabalausky, el 14 de February a las 16:39 me escribiste:
> > On Thu, 14 Feb 2013 20:39:33 +0100
> > Jacob Carlborg <doob at me.com> wrote:
> > 
> > > 
> > > On 13 feb 2013, at 21:53, Nick Sabalausky
> > > <bus_dmdbeta at semitwist.com> wrote:
> > > 
> > > > IMO, SDL (Simple Declarative Language, not Simple DirectMedia
> > > > Layer) beats the heck out of even YAML:
> > > > http://sdl.ikayzo.org/display/SDL/Home
> > > > 
> > > > It's just trivially simple and obvious with no syntactic noise.
> > > > I had been a proponent of YAML, but my interest in it died
> > > > completely after discovering SDL. YAML has less syntactic noise
> > > > than JSON, but it's kinda complicated. I had started writing a
> > > > D version of SDL last year but then got distracted. Definitely
> > > > want to get back to it though.
> > > 
> > > 
> > > After a quick glance at that page it looks more complicated than
> > > JSON. I would consider YAML less complicated than JSON.
> > > 
> > 
> > It's actually very simple. Everything is a tag, which is basically
> > of the form:
> > 
> > [namespace:]name [values] [attributes of the form name=value] [{
> >     children
> > }]
> > 
> > A basic ini-style list of names/values is just:
> > 
> > first "Joe"
> > last "Smith"
> > age 17
> > addr "123 Road St."
> 
> Why wouldn't you keep using the ini format then?
> 

The point of the discussion was the idea of using an existing format
that's more powerful than ini instead of just taking on extra features
to our ini-system:

"I also suspect we are reinventing JSON files badly with dmd.conf.
Maybe dmd.conf should be redone as a json file." - Walter

Unlike JSON (which Walter mentioned), SDL doesn't add needless syntactic
noise. And compared to YAML (which someone else mentioned), SDL has a
simpler, easier to understand and non-indent-based syntax. But like
JSON and YAML, SDL is much more powerful than INI. Some examples from
the SDL site:

# List
numbers 12 53 2 635

# Map
pets chihuahua="small" dalmation="hyper" mastiff="big"

# Tree
plants {
    trees {
        deciduous {
            elm
            oak
        }
    }
}

# Tree w/ various attributes and datatypes
folder "myFiles" color="yellow" protection=on {
    folder "my images" {
        file "myHouse.jpg" color=true date=2005/11/05
        file "myCar.jpg" color=false date=2002/01/05
    }
    folder "my documents" {
        document "resume.pdf"
    }
}

So as long as we were discussing JSON/YAML, I thought I'd point out SDL.


More information about the dmd-beta mailing list