www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/08/10/12:15:52

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Mon, 10 Aug 2015 18:15:23 +0200 (CEST)
X-X-Sender: igor2 AT igor2priv
To: "Levente (leventelist AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
X-Debug: to=geda-user AT delorie DOT com from="gedau AT igor2 DOT repo DOT hu"
From: gedau AT igor2 DOT repo DOT hu
Subject: Re: [geda-user] gEDA on FreeBSD
In-Reply-To: <CACwWb3Dbhs_h2qe_VMk5rEtJ1kNLOQAJkjo5PLZk1PiYPJemmA@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1508101758300.6924@igor2priv>
References: <20150809131504 DOT 4d5ad4f8 AT jive DOT levalinux DOT org> <20150810122457 DOT GA19015 AT localhost DOT localdomain> <alpine DOT DEB DOT 2 DOT 00 DOT 1508101450010 DOT 6924 AT igor2priv> <CACwWb3Dbhs_h2qe_VMk5rEtJ1kNLOQAJkjo5PLZk1PiYPJemmA AT mail DOT gmail DOT com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Mon, 10 Aug 2015, Levente (leventelist AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:

>Good old days... :-) single Unix operating system. My dream.
>
>I think we struggle too much with all these Unix variants.
>

There is also another very important aspect. All the code is astonishingly 
simple and small. I've just opened the libc implementation of popen() and 
pclose(). It's a single C file, 55 lines total. It's not a wrapper around 
some internal popen()/pclose(), it really creates the pipe, forks, calls 
execl. It includes two headers (stdlib.h and signal.h, easy to foresee 
what they are going to be used for). The code is to the point, plain and 
simple.

I think it's not only about having one UNIX variant and smaller amount of 
hardware, it's also about making APIs more advanced (complicated) over 
time, implementing workarounds that will require more workarounds in turn, 
etc. Looking at the glibc implementation, it's 381 lines just for popen() 
- if I even found the right file. Yeah, it "has to" deal with 
close-on-exec, pipe() vs. pipe2(), set up some complex IO structs... It's 
hard to follow the code riddled with #ifdefs. It includes 10 headers.

To be fair, not all parts of V7 is like that: the Bourne shell's soruce, 
for example, is pretty ... strange. If I was shown a few dozen lines from 
the middle of any .c, I wouldn't even tell it's written in C.

Regards,

Igor2



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019