From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 9 19:05:50 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 871731065670 for ; Fri, 9 Apr 2010 19:05:49 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta15.emeryville.ca.mail.comcast.net (qmta15.emeryville.ca.mail.comcast.net [76.96.27.228]) by mx1.freebsd.org (Postfix) with ESMTP id 6F1E88FC1C for ; Fri, 9 Apr 2010 19:05:49 +0000 (UTC) Received: from omta22.emeryville.ca.mail.comcast.net ([76.96.30.89]) by qmta15.emeryville.ca.mail.comcast.net with comcast id 3WNv1e0041vN32cAFWsfeD; Fri, 09 Apr 2010 18:52:39 +0000 Received: from comcast.net ([98.203.142.76]) by omta22.emeryville.ca.mail.comcast.net with comcast id 3Wwh1e0011f6R9u8iWwmnE; Fri, 09 Apr 2010 18:56:53 +0000 Received: by comcast.net (sSMTP sendmail emulation); Fri, 09 Apr 2010 11:51:50 -0700 Date: Fri, 9 Apr 2010 11:51:50 -0700 From: Charlie Kester To: freebsd-hackers@freebsd.org Message-ID: <20100409185150.GC61756@comcast.net> Mail-Followup-To: freebsd-hackers@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Mailer: Mutt 1.5.20 X-Composer: VIM 7.2 User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: make pkg_install suite reusable, please X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2010 19:05:50 -0000 On Fri 09 Apr 2010 at 07:36:17 PDT Alexander Churanov wrote: >2010/4/9 Leinier Cruz Salfran > >> i want to ask you one thing: can you make the 'pkg_install' suite >> reusable .. means install 'libinstall.a' as a shared object in order >> to make it reusable by others devs >> > >Hi Leinier, > >I'd like to add my 50 cents. From my point of view, the true UNIX way is >re-using whole programs. This provides unbelievable isolation and >correctness. If you don't want to fork myriads of processes each second, >then, it's, probably, better to ask for pipe mode of pkg_* tools. For >example, aspell works that way. You start a process, write commands and >queries and read results. +1 It was a watershed moment in my programming career when I realized that the bubbles on those DFD charts we used to use for structured design could be whole processes and not just functions in a single, monolithic program. Suddenly everything the structured design folks were saying about re-use, encapsulation, loose coupling, module cohesion, etc. made a lot more sense when viewed from the perspective of simple Unix utilities communicating with plain text via pipes. We should encourage that approach as a default, and only put things into binary libraries when forced to by performance considerations.