public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] initscripts in python
@ 2003-04-16  1:29 Justin Whitney
  2003-04-16  4:09 ` Daniel Armyr
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Justin Whitney @ 2003-04-16  1:29 UTC (permalink / raw
  To: gentoo-dev

Hi,

I don't really like talking about these kinds of vague ideas (like I'm
doing here), because that doesn't get them written - but this one I want
feedback on first before I dive in... so...

For a lot of reasons I'd like to implement the initscrits in something
other than shell script.  Something like python, say.

Reasons for doing this would include:

*writing (advanced) shellscripts requires learning awk/sed, and various
other minor tools (mostly because their features aren't supported by the
language).  Use of a language with these features builtin lowers the
learning requirement, or at least puts it all under one roof.
*improved performance and bytecode-compilability
*Speedups due to fewer exec calls (for awk/sed/etc)

Reasons NOT to do this would include:

*breaking from standard would mean packages with provided initscripts
would require a rewrite.
*slight increase in boot requirements (interpreter and libs must exist
at least minimally on root partition)
*probably needs a bit more memory

other bits:

*compatibility could obviously be maintained, as existing shell scripts
could still be run without changes.


Note: I am by no means proposing this as a standard feature of gentoo.

That said, since gentoo already uses python for portage, selecting
python as the language to use makes sense.  Aside from the re-writes,
and some other details, I don't see much disadvantage to the above
design.

Comments appreciated.

--Justin Whitney


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [gentoo-dev] initscripts in python
@ 2003-04-16 11:13 merv
  0 siblings, 0 replies; 22+ messages in thread
From: merv @ 2003-04-16 11:13 UTC (permalink / raw
  To: gentoo-dev

Yep, one of the things that would be hard to do would persuade many 
of either the *need* for this or of its advantage.

To move away from pros and cons for a moment, I see a need and an 
advantage :

[*need* is a word treated as meaning a potential *use for* something, 
for now, a bit elastic perhaps]:

1) [need or use:] by incorporating Python functionality (or other 
programming lang) into a more extensible style shell, sh becomes 
more widely accessibly to a number of community member who have 
minimal->no sh scripting ability, but who are familiar with programming 
of one flavour or another. I would have to agree, and say that my first 
impulse is to just encourage them to learn to *bash* or whatever, but 
everyone has their reasons.  If a user was able to incorporate the 
functionality (but not the whole language) of a lang with which they 
were familiar (or their favourite lang) at build time, shell scripting would 
become a common language for even more people of the Gentoo 
family.

2)[advantage or effect:] to undertake such a re-write of the way that the 
shell is built would, conceivably, result in a change in the way that the 
community thinks of the shell.  Perhaps shell extensibility (for which I 
mean a kind of individual user-level customisation during build) would 
result in the shell itself being perceived as a kind of IDE or runtime 
environment, as well as a way to get around and make things happen.  
This kind of *shell development* might act as a corollary to kernel 
development. If kernel development is seen as cultivating and 
extending the functionality and capability of the kernel, then perhaps 
shell development could be seen as refining and extending the 
adaptability and usability of the shell at the level of the individual user, 
providing greater choice and customisability.  Would this not be a 
natural implementation of the kind of hyper-tweak choice-driven 
philosophy of Gentoo?

and of course, any extensibility options to be built in at build-time could 
of course be ommitted (packaged as *default off*), only turned *on* by 
those who deliberately wanted to make use of it.

It has always felt to me that the power of sh scripting was its flexibility. 
To extend the functionality of the sh-scripting env in this way would 
consolidate, in my view, the usefulness of sh-scripting by enhancing it, 
or at least extending it for those who wanted to make use of it.


>SH-scripting is in itself already very powerfull. It's not because lots of
>initscripts are bad written (because of historic reasons) that it is to 
>blame
>on sh. You can create functions with sh. You can do so many 
>powerfull things
>with it (no, object oriented programming it cannot, but that's not 
>powerfull
>either :)
>
>http://www.tldp.org/LDP/abs/html/complexfunct.html
>		
>Not that I dislike Python, au contraire, I like the immens easiness for
>parsing XML with it, controlling databases with the DB-API... but 
>initscripts
>don't require this possibility.
>
>	Sven Vermeulen
--
	Fighting for peace is like fucking for virginity.
-
Merv Hammer
mailto: merv@spidernet.com.cy

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2003-04-17 23:21 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-16  1:29 [gentoo-dev] initscripts in python Justin Whitney
2003-04-16  4:09 ` Daniel Armyr
2003-04-16  5:38 ` merv
2003-04-16  7:25   ` Jeff Rose
2003-04-16  8:49     ` merv
2003-04-16  8:19   ` Paul de Vrieze
2003-04-16  8:52     ` Sven Vermeulen
2003-04-16 20:54       ` Justin Whitney
2003-04-17 20:05         ` merv
2003-04-17  5:49     ` Joseph Carter
2003-04-17  6:27       ` George Shapovalov
2003-04-17 18:25         ` merv
2003-04-17  7:42       ` Paul de Vrieze
2003-04-16 22:44   ` Abhishek Amit
2003-04-17  6:45     ` Sven Vermeulen
2003-04-17 20:56       ` merv
2003-04-17 22:26         ` Caleb Shay
2003-04-17 23:32           ` merv
2003-04-17 18:18     ` merv
2003-04-16 21:08 ` Brad Laue
2003-04-17  6:47   ` Sven Vermeulen
  -- strict thread matches above, loose matches on Subject: below --
2003-04-16 11:13 merv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox