From owner-freebsd-arch@FreeBSD.ORG Tue Jul 29 06:31:54 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 66685B73 for ; Tue, 29 Jul 2014 06:31:54 +0000 (UTC) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (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 360D52C85 for ; Tue, 29 Jul 2014 06:31:52 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id fp1so11169921pdb.33 for ; Mon, 28 Jul 2014 23:31:52 -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=AwPBV1foKskzzau4Cat5mN5L1CoD2TxwL9x2Dgo6YCw=; b=mDaQ0eLRz6HLsU0ANVCUdfTGQ+htsrvByJpNPxzga13WqHvI/zd9MEd5zkoW7sqYnP v0XInbqfRYRCzW3MVjo4buALm083rkdGcopLEi7Vh/YU6KPf0RYRKIElua8qokgEF7gA 9Ux30uTpmKcZ23bZfyQyIsjuzflRUFZ+QjTcccRXvX0//rGF19CinDNEXFmHCq+DWHkn n4juX+7DXIES/a4jf82YLB6P6dmpLbe1NePrGf+gViRCnMX6dmG8vlofIiZtpQIBHn+1 q8MJbgCqyEJxJ4j3XUC0QTkBDig3AcgsZAfv5o1T4iPRHFAEXK7n+keOgWIaJilEBn2N dIiw== X-Gm-Message-State: ALoCoQleCCeiLJAf3yilDCYuAp4SbdtZjPEGFPScfZFUe+WQVNcKfe1kPBc5MU3UJYy8m5y3W08I MIME-Version: 1.0 X-Received: by 10.68.186.97 with SMTP id fj1mr42897819pbc.37.1406615511738; Mon, 28 Jul 2014 23:31:51 -0700 (PDT) Received: by 10.70.101.41 with HTTP; Mon, 28 Jul 2014 23:31:51 -0700 (PDT) Received: by 10.70.101.41 with HTTP; Mon, 28 Jul 2014 23:31:51 -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:31:51 -0700 Message-ID: Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML From: Jos Backus To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: 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:31:54 -0000 On Jul 28, 2014 11:29 PM, "Adrian Chadd" wrote: > > 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) YAML has support for document streams, which might come in handy here :) Jos > > > -a