From owner-freebsd-arch@FreeBSD.ORG Wed Jul 30 18:49:00 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89400D62 for ; Wed, 30 Jul 2014 18:49:00 +0000 (UTC) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56CC2261D for ; Wed, 30 Jul 2014 18:49:00 +0000 (UTC) Received: by mail-pa0-f41.google.com with SMTP id rd3so2044407pab.0 for ; Wed, 30 Jul 2014 11:48:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=T9whZRmsPpmIbV/HNP4btf9NoiQAVWP6aKlCTVrGtvc=; b=KNfJznBpICXWo4ki8UEOCd8ZHp2ns90xUTMPUlOblOxYG30i+xwZUgjYFuUzcDACVg BWXyrbtcF3bMQ9FexVy/H9y5ycP3HdhqSBybdkILPOB7bRkscHE0k8V1mddLQ8klf8D7 dtLKMJhVk0jvppqH4kBr2pY03HsJxZNZCQ79/nkyURLBPThBzYC7bjGGMNRT8FMkPbKB u2m2bImaVZ25UJPej0XXeSBDfMFzVdBWEhdPCM0zFMglj0cee5lLrQVGdavQTjZSn0KX BV3cY8pF84agBS0cKdhADlCZiSIbbvyYioizrxhtoXE4qeiJDxNu/4+2zDycmnKh5cnJ dWkw== X-Gm-Message-State: ALoCoQmnG6mGgv4QMjjVU4NNPefMxU3mFos/oR1R0c5H2rd3RN31uef+K6CkwZN6J0L/MWkMEXLY MIME-Version: 1.0 X-Received: by 10.68.113.133 with SMTP id iy5mr6922696pbb.135.1406746139556; Wed, 30 Jul 2014 11:48:59 -0700 (PDT) Received: by 10.70.101.41 with HTTP; Wed, 30 Jul 2014 11:48:59 -0700 (PDT) Received: by 10.70.101.41 with HTTP; Wed, 30 Jul 2014 11:48:59 -0700 (PDT) In-Reply-To: <20140730170355.GM37672@ivaldir.etoilebsd.net> References: <20140729232338.40AA6580A2@chaos.jnpr.net> <20140730034641.46ABE580A2@chaos.jnpr.net> <20140730071500.GF37672@ivaldir.etoilebsd.net> <20140730170355.GM37672@ivaldir.etoilebsd.net> Date: Wed, 30 Jul 2014 11:48:59 -0700 Message-ID: Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML From: Jos Backus To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: arch@freebsd.org, Adrian Chadd , Jordan Hubbard , "Simon J. Gerraty" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 18:49:00 -0000 On Jul 30, 2014 10:04 AM, "Baptiste Daroussin" wrote: > > On Wed, Jul 30, 2014 at 09:18:40AM -0700, Jos Backus wrote: > > On Jul 30, 2014 12:15 AM, "Baptiste Daroussin" wrote: > > > > > > On Tue, Jul 29, 2014 at 09:44:17PM -0700, Jos Backus wrote: > > > > On Jul 29, 2014 8:46 PM, "Simon J. Gerraty" wrote: > > > > > > > > > > > > > > > On Tue, 29 Jul 2014 16:30:53 -0700, Jos Backus writes: > > > > > >> You certainly cannot wait for all of it to arrive before you start > > > > > >> rendering. > > > > > > > > > > > >Understood. This is why a serialization output format that supports > > > > > >streaming data is useful. > > > > > > > > > > Indeed; XML works fine for that. > > > > > > > > Not to beat a dead horse, but so does YAML, and it's more > > lightweight/less > > > > verbose so I personally find it more elegant. But sure, XML would work > > as > > > > well. > > > > > > > YAML is not more lightweight at all, it is really heavy to parse compared > > to > > > XML or JSON. > > > > By lightweight I meant syntax verbosity, not computational load (although > > it seems easy to emit). It's a more flexible format, and that comes with a > > certain price. The question is whether that flexibility is needed or > > useful. If JSON can't be used because of its limitations, I would > > personally prefer the less verbose YAML over XML. > > > About json what limitation are you talking about? Several limitations have been mentioned: no support for comments, binary data, streaming. YAML is a superset of JSON so there are things one can do with YAML that one cannot do (easily) with JSON. The question is whether those things matter enough. > In yaml you have 2 syntax, on which is inconsistent but user friendly and the > other which as ugly as XML imho > > this_is_string: treu > this__bool: true > so_if_i_want_a_string_true_i_need_quote: "true" > > If I want to be consistent I need to use the canonical form of yaml: > > --- > !!map { > ? !!str "so_if_i_want_a_string_true_i_need_quote" > : !!str "true", > ? !!str "this__bool" > : !!bool "true", > ? !!str "this_is_string" > : !!str "treu", > } > > and now this is very very ugly :( Cute, but rare. How often can one not use the easy format, and how often does one want the string" true" rather than the Boolean value? > Plus yaml is context dependant and space dependant resulting in people getting lost about: > "Why this yaml is not valid": > > hu: ha > hi: > - test > - test2 > > Or why this one is not valid either? > > hu: ha > hi: test > > > I have been there with pkg(8) after being a huge suppoter of YAML I'm now more moderated :) Sure, one has to apply some care with whitespace. This hasn't prevented Python from becoming popular so it must not be as big a deal, and I know the Ruby community uses YAML effectively quite a bit. > > YAML was not machine friendly at all in the end and very very error prone for humans :( Granted, JSON is a simpler format. Jos P. S. I've said everything I planned to say so I am going to move on from this bikeshed now. > > regards, > Bapt