From owner-freebsd-arch@FreeBSD.ORG Wed Jul 30 23:51:49 2014 Return-Path: Delivered-To: freebsd-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 4A4B0D1E; Wed, 30 Jul 2014 23:51:49 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0145.outbound.protection.outlook.com [207.46.163.145]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E04F026CF; Wed, 30 Jul 2014 23:51:48 +0000 (UTC) Received: from BY2PR05CA054.namprd05.prod.outlook.com (10.141.250.44) by DM2PR05MB733.namprd05.prod.outlook.com (10.141.178.18) with Microsoft SMTP Server (TLS) id 15.0.995.14; Wed, 30 Jul 2014 23:51:46 +0000 Received: from BY2FFO11FD003.protection.gbl (2a01:111:f400:7c0c::190) by BY2PR05CA054.outlook.office365.com (2a01:111:e400:2c5f::44) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Wed, 30 Jul 2014 23:51:46 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BY2FFO11FD003.mail.protection.outlook.com (10.1.14.125) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Wed, 30 Jul 2014 23:51:46 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 30 Jul 2014 16:51:24 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.21.16.28]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s6UNpNn82364; Wed, 30 Jul 2014 16:51:24 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id AC944580A2; Wed, 30 Jul 2014 16:51:23 -0700 (PDT) To: Alfred Perlstein , Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML In-Reply-To: <20140730194522.B58FE580A2@chaos.jnpr.net> References: <20140725044921.9F0D3580A2@chaos.jnpr.net> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> <20140729230345.31E9B580A2@chaos.jnpr.net> <53D85495.4050408@mu.org> <20140730053446.DCE8D580A2@chaos.jnpr.net> <53D944F5.7000207@freebsd.org> <20140730194522.B58FE580A2@chaos.jnpr.net> Comments: In-reply-to: "Simon J. Gerraty" message dated "Wed, 30 Jul 2014 12:45:22 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Wed, 30 Jul 2014 16:51:23 -0700 Message-ID: <20140730235123.AC944580A2@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(51704005)(87286001)(87936001)(88136002)(15975445006)(47776003)(89996001)(81156004)(106466001)(31966008)(19580395003)(76482001)(83322001)(46102001)(92726001)(84676001)(20776003)(6806004)(44976005)(74662001)(74502001)(86362001)(92566001)(85306003)(95666004)(70486001)(93886003)(105596002)(97736001)(104166001)(102836001)(93546004)(107046002)(80022001)(77156001)(69596002)(76176999)(21056001)(50226001)(4396001)(77982001)(101356003)(102176002)(57986006)(99396002)(90896003)(33656002)(85852003)(83072002)(48376002)(81342001)(50986999)(50466002)(64706001)(81542001)(68736004)(79102001)(62966002)(76506005)(93916002)(42262001); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR05MB733; H:P-EMF02-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 0288CD37D9 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=sjg@juniper.net; X-OriginatorOrg: juniper.net Cc: phil@juniper.net 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 23:51:49 -0000 On Wed, 30 Jul 2014 12:45:22 -0700, "Simon J. Gerraty" writes: >>The code can be seen here: >> https://socsvn.freebsd.org/socsvn/soc2014/zkorchev/ >> >>Since Juniper has many years of experience AND the GSOC project has >>many, many utils converted I'm suggesting that Juniper engage in the >>review process and help us get the best of both worlds in. > >That would of course depend on whether we like what has been done ;-) >The library and API are more important than how many apps have been >converted. Ok I took a look... There's no nice way to say it I'm afraid; This looks like the same sort of approach that Juniper used a over a decade ago for the BSD apps to get XML out, and which we felt was just too ugly to upstream, I don't see how we could support this. Unfortunately it took me a couple of years to get a few hours of Phil's time, to come up with a neat API to avoid that #ifdef and if/else mess. On the plus side that means it covers a lot more than just XML. We now have an API and library that can avoid the need to double the cost of adding new output to apps, ie you only write to libxo's api and it does plain TXT for you if needed. Our only concern was how best to address the wide-char issue John-Mark Gurney strongly favours just doing UTF-8, I and I believe Marcel and Phil would tend to agree (since AFAICT it has little overhead for ASCII) Based on this thread, it would seem there is still demand for this functionality so I think we should proceed with putting libxo into our internal tree and generate some diffs for folk to review... Thanks --sjg