Gentoo Archives: gentoo-dev

From: Jeff Rose <rosejn@××××××××.EDU>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] initscripts in python
Date: Wed, 16 Apr 2003 07:25:41
Message-Id: Pine.GSO.4.40.0304160123260.21363-100000@ucsub.colorado.edu
In Reply to: Re: [gentoo-dev] initscripts in python by merv
1 Could you use a hybrid of both bash scripts and python by using the
2 '-c' argument to run single python commands?
3
4 -Jeff
5
6 On Wed, 16 Apr 2003, merv wrote:
7
8 > I for one would enjoy the clean-feel of Python in initscrit composition.
9 > That said, I would miss the very "Unix atmospherics" of awk and sed
10 > and the run-time interactivity of the shell scripting (I mean, it's potential
11 > for shorthand notation).
12 >
13 > It may be a difficult one to call though. I imagine that many would feel
14 > similar sentiments about the scripting advantages of both Python and
15 > shell scripting. Maybe practicality would have the last say, however.
16 > On machines with very limited resources (I have a box running Gentoo
17 > on a Pentium 133Mhz and < 1GB harddrive with 64Mb RAM), Python
18 > would be a death sentence for the box. Shell scripting is the only
19 > option in such environments for job control etc etc.
20 >
21 > Perhaps we might experiment with a build-time option for incorporating
22 > *both* Python and shell scripting tools such as awk and sed in to the
23 > shell (by having the Python *shell extras* turned on/off via a
24 > compilation flag?). In such environments both would be available for
25 > use as a shell scripting resource. Or perhaps again, we might set
26 > about incorporating shell scripting notation in to Python and attempt to
27 > ferment a hybrid for shell scripting purposes, initscrits and the like.
28 >
29 > Interesting idea that has made me think more closely about what a
30 > shell scripting language is and what it is for.
31 >
32 > Will be good to see if this goes anywhere.
33 >
34 > --Merv Hammer
35 >
36 > On 15 Apr 2003 at 21:29, Justin Whitney wrote:
37 >
38 > > Hi,
39 > >
40 > > I don't really like talking about these kinds of vague ideas (like I'm
41 > > doing here), because that doesn't get them written - but this one I want
42 > > feedback on first before I dive in... so...
43 > >
44 > > For a lot of reasons I'd like to implement the initscrits in something
45 > > other than shell script. Something like python, say.
46 > >
47 > > Reasons for doing this would include:
48 > >
49 > > *writing (advanced) shellscripts requires learning awk/sed, and various
50 > > other minor tools (mostly because their features aren't supported by the
51 > > language). Use of a language with these features builtin lowers the
52 > > learning requirement, or at least puts it all under one roof.
53 > > *improved performance and bytecode-compilability
54 > > *Speedups due to fewer exec calls (for awk/sed/etc)
55 > >
56 > > Reasons NOT to do this would include:
57 > >
58 > > *breaking from standard would mean packages with provided initscripts
59 > > would require a rewrite.
60 > > *slight increase in boot requirements (interpreter and libs must exist
61 > > at least minimally on root partition)
62 > > *probably needs a bit more memory
63 > >
64 > > other bits:
65 > >
66 > > *compatibility could obviously be maintained, as existing shell scripts
67 > > could still be run without changes.
68 > >
69 > >
70 > > Note: I am by no means proposing this as a standard feature of gentoo.
71 > >
72 > > That said, since gentoo already uses python for portage, selecting
73 > > python as the language to use makes sense. Aside from the re-writes,
74 > > and some other details, I don't see much disadvantage to the above
75 > > design.
76 > >
77 > > Comments appreciated.
78 > >
79 > > --Justin Whitney
80 > >
81 > >
82 > > --
83 > > gentoo-dev@g.o mailing list
84 > >
85 >
86 >
87 > --
88 > Merv Hammer
89 > mailto: merv@×××××××××××××.cy
90 > ------------------------------------------------------------------------------
91 > -Working with Unix is like wrestling a worthy opponent...
92 > -Working with windows is like attacking a small whining child
93 > who is carrying a .38
94 >
95 > --
96 > gentoo-dev@g.o mailing list
97 >
98
99
100 --
101 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] initscripts in python merv <merv@×××××××××××××.cy>