From owner-freebsd-arch@FreeBSD.ORG Tue Jul 29 06:29:01 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B41FBAB7 for ; Tue, 29 Jul 2014 06:29:01 +0000 (UTC) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::22f]) (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 706382B6D for ; Tue, 29 Jul 2014 06:29:01 +0000 (UTC) Received: by mail-qg0-f47.google.com with SMTP id i50so9869015qgf.34 for ; Mon, 28 Jul 2014 23:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jPt1BXAiPKBo+P11kB/mU52bN/mBHbQ6KS59H9VtmBo=; b=UiZ6BnGHuh/U3Fr/ed1TJKcX5FPzs0w3GfDLDtC/d77PbShecqB4i4WpQZOghv7XCM bcTrpmqL9ibg4f8D20wDIv1LScP6jAhP1LD3mx9woanYdpz756n2Ul/tNlUdH8uYt+J9 rrRr31l+O4kX+3cOSp8Y1g48+umz/RDrOOt7D0lsuSbnu8rI/XnZQXOTATWrQT15VFBB oX2oU56qN6dsD+FlSBI7If7BGJFUVucHcYieAwB4OxbJ598Ajmb/LjSmQ+uxk9khMjNv v7WZfTgJENVh4SVtzSneVqN3GCCVSVjM6/oDpT9eeVR9Af7GK3kwjZA6gssfNTKoyUzV DzFw== MIME-Version: 1.0 X-Received: by 10.140.38.169 with SMTP id t38mr67876533qgt.3.1406615340686; Mon, 28 Jul 2014 23:29:00 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 28 Jul 2014 23:29:00 -0700 (PDT) In-Reply-To: References: <20140725044921.9F0D3580A2@chaos.jnpr.net> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> Date: Mon, 28 Jul 2014 23:29:00 -0700 X-Google-Sender-Auth: keeH2KDUG3BGmxUbZ_CDh0c53WA Message-ID: Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML From: Adrian Chadd To: Jos Backus Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-arch@freebsd.org" , Jordan Hubbard 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: Tue, 29 Jul 2014 06:29:01 -0000 On 28 July 2014 23:03, Jos Backus wrote: > > On Jul 28, 2014 10:57 PM, "Adrian Chadd" wrote: >> >> Holy ... ! >> >> What really matter is whether the library API that you're going to >> shoehorn into plenty of utilities is expressive enough to express a >> whole bunch of different output types. >> >> So it doesn't matter if you want JSON, or YAML, or XML, or the native >> tool output. The trick is whether the library API is good enough. >> >> So if you want to win people over, just make sure it gets adopted >> throughout other tools. :) > > Wouldn't the API be a way to build up an in-memory combination of lists and > maps in most cases, which then gets serialized out at emission time? Kind of > like calling object.to_yaml, where object is a Hash, but in C? > Not everything can be buffered like that over time. Time series data may have stuff buffered up during an output / sample period (eg the one a second output from vmstat 1) -a