Before we implement SDL package format for DUB

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 25 15:14:57 PDT 2014


On Monday, 25 August 2014 at 16:40:10 UTC, Jonathan Marler wrote:
> Hello everyone,
>
> I've been working on SDL support for DUB and wanted to get some 
> people's opinions on whether we should really use SDL.  I've 
> posted my thoughts here: 
> http://forum.rejectedsoftware.com/groups/rejectedsoftware.dub/thread/2263/

You said that "The standard way to read a dub package description 
is to use the output of "dub describe", not to parse dub.json 
directly", but what about tools that *write* to dub.json? 
Currently, if an IDE wants to use DUB behind the scenes as it's 
build system it can parse dub.json and modify it as it wishes, 
and that should even work if someone modified dub.json by hand. 
But what if someone modifies dub.json by hand and adds ASON stuff 
to it? I think we need a command like `dub normalize` that'll 
convert the dub.json file into a pure JSON file that has exactly 
the same data, so IDEs could call it before loading dub.json.


About the language - if you are making a new data serialization 
language(NOT markup language. These languages don't actually mark 
anything up) for DUB, could you please make it support heredocs? 
This will allow, in the future, to easily add pre-build and 
post-build scripts directly in the build-file.

Alos - nameless fields scare me. They mean that ASON is not a 
schema-less format - and schema-less-ness is one of the most 
important features of languages like JSON, XML and YAML. I accept 
it if consumers break when suppliers remove fields - but nameless 
fields mean that consumers might break when the supplier added 
fields in the middle or reordered fields. This makes ASON a 
schema-bound format - and developers that choose schema-bound 
formats, usually care about compactness that ASON does not 
supply(since most the syntax is one of schema-less formats, it's 
very verbose compared to schema-bound formats).


At any rate, it would be nice to have the ASON parser as a DUB 
package before making it the official language for DUB 
build-files.


More information about the Digitalmars-d mailing list