Browse Source

Move introduction to separate document

Alois Mahdal 6 years ago
parent
commit
6f559cc706
2 changed files with 109 additions and 110 deletions
  1. 1
    110
      README.md
  2. 108
    0
      notes/intro.md

+ 1
- 110
README.md View File

@@ -28,118 +28,9 @@ Project Status and Versioning
28 28
     work on it.
29 29
 
30 30
 
31
-Introduction
31
+Installation
32 32
 ------------
33 33
 
34
-Most shell languages don't have libraries.
35
-
36
-You might think: "Are you kidding me?  Libraries are for real serious
37
-programmers, and real serious programmers don't real-serious-program
38
-in shell!  So how is that a problem lol."
39
-
40
-I mostly agree.  Shell languages, by definition are command languages,
41
-basically meant to allow you kick around files, create directories and
42
-most importantly, launch *other* real serious programs.
43
-
44
-What shell languages can also be used for is gluing together some of
45
-these real serious programs so that you don't have to type everything
46
-over and over.  These glue scripts are normally nothing serious, just
47
-copy this there and launch that with that piped in.  Done.
48
-
49
-*Granted,* in some cases, you simply don't stop there.  Sometimes you
50
-create one script here, one script there, one over there.  When you
51
-maintain a system, sometimes you do write scripties here and there.
52
-That's OK, all of them are just few lines; trivial things with obvious
53
-purpose, right?
54
-
55
-But sometimes, you don't work alone.  Sometimes there's bunch of other
56
-folks and you want to work together so that when you take vacation and
57
-something breaks, your colleagues can use your scripts instead of
58
-needing to do everything manually or call you.
59
-
60
-So even if it's not real serious web application or real serious kernel,
61
-*some* level of re-usability pays off.
62
-
63
-
64
-### OK so what ###
65
-
66
-It's not that it's not possible to build a library from a bunch of scripts
67
-and import all with the magical dot command, but let's be honest: you end
68
-up either with swarm of modules of varying style, maturity and quality
69
-*and* overlapping scopes, or one humongous beast-of-a-module with pack
70
-of mysterious functions and variables that everyone is scared to touch.
71
-
72
-Unless you take it seriously and start thinking *way* ahead from the
73
-start.
74
-
75
-Which is exactly what I did.
76
-
77
-Finding myself in swarm of varying scripties, constantly trying to keep
78
-them at least a bit tidy, I decided to stop and do it another way:  Just
79
-try and see how much of the magic, the modularity, maintainability and
80
-discoverability that's so common in other platforms could be taken into
81
-the dark, blunt world of shell languages.
82
-
83
-Result of these efforts is called Shellfu.
84
-
85
-
86
-### So what does it do? ###
87
-
88
-Shellfu, as a project consists of three parts:
89
-
90
- *  `shellfu()`, the shell function that lets you import a module from
91
-    known location just by name, therefore decoupling the *deployment*
92
-    from *the dependency*.
93
-
94
- *  Shellfu core library, providing few modules readily usable for
95
-    some of the most common tasks (printing messages for user, loading
96
-    basic INI files...).
97
-
98
-    Note that this "library" is currently extremely tiny with about
99
-    4-6 modules.  It's currently (July 2016) not clear what modules
100
-    should be added or removed and what should be the size, although
101
-    there are no plans to add a lot.  Most of advantage of shellfu
102
-    is to be gained from writing *domain-specific* modules.
103
-
104
- *  Shellfu Style Guide, setting common standard for shell modules,
105
-    allowing you to collaborate on the code in an efficient manner
106
-    (in-line documentation, peer review, code readability...).
107
-
108
- *  As a bonus, *shellfu-doc*, building upon the Shellfu Style Guide,
109
-    allows your user to discover and read documentation of installed
110
-    modules (akin to *perldoc* or *pydoc*).
111
-
112
-
113
-### Schizophrenia kicks in ###
114
-
115
-> *So are we talking POSIX shell, Bash or Zsh or what?*
116
-
117
-The basic principle is, albeit untested, meant to be extensible to most
118
-common *bourne-like* shell languages.  In more specific sense, this
119
-means two things:
120
-
121
- *  *shellfu.sh*, the core part of the code should be compatible with
122
-    *dash*, the Debian Almquist Shell,
123
-
124
- *  although I don't expect various-language modules to co-exist,
125
-    *shellfu.sh* aims to be able to filter modules based on interpreter
126
-    (more on that later).
127
-
128
- *  and some modules of the core library will try to be POSIX/dash
129
-    compatible, which will make them loadable from all.
130
-
131
-Note that I'm kind of using terms "POSIX" and "dash" interchangeably.
132
-What I really mean is that since POSIX is rather vague in many places,
133
-and there are kajilions of POSIX shells, it's impractical to aim for
134
-*real* POSIX compatibility.  Therefore, the "POSIX-oriented" code will
135
-be tested under *dash*, plus set of most common interpreters: `bash`,
136
-(add here).
137
-
138
-I reckon that's about as POSIXey as one can get without going mad.
139
-
140
-
141
-Bring it on!
142
-------------
143 34
 
144 35
 ### Installation ###
145 36
 

+ 108
- 0
notes/intro.md View File

@@ -0,0 +1,108 @@
1
+The Why of Shellfu
2
+------------------
3
+
4
+Most shell languages don't have libraries.
5
+
6
+You might think: "Are you kidding me?  Libraries are for real serious
7
+programmers, and real serious programmers don't real-serious-program
8
+in shell!  So how is that a problem lol."
9
+
10
+I mostly agree.  Shell languages, by definition are command languages,
11
+basically meant to allow you kick around files, create directories and
12
+most importantly, launch *other* real serious programs.
13
+
14
+What shell languages can also be used for is gluing together some of
15
+these real serious programs so that you don't have to type everything
16
+over and over.  These glue scripts are normally nothing serious, just
17
+copy this there and launch that with that piped in.  Done.
18
+
19
+*Granted,* in some cases, you simply don't stop there.  Sometimes you
20
+create one script here, one script there, one over there.  When you
21
+maintain a system, sometimes you do write scripties here and there.
22
+That's OK, all of them are just few lines; trivial things with obvious
23
+purpose, right?
24
+
25
+But sometimes, you don't work alone.  Sometimes there's bunch of other
26
+folks and you want to work together so that when you take vacation and
27
+something breaks, your colleagues can use your scripts instead of
28
+needing to do everything manually or call you.
29
+
30
+So even if it's not real serious web application or real serious kernel,
31
+*some* level of re-usability pays off.
32
+
33
+
34
+### OK so what ###
35
+
36
+It's not that it's not possible to build a library from a bunch of scripts
37
+and import all with the magical dot command, but let's be honest: you end
38
+up either with swarm of modules of varying style, maturity and quality
39
+*and* overlapping scopes, or one humongous beast-of-a-module with pack
40
+of mysterious functions and variables that everyone is scared to touch.
41
+
42
+Unless you take it seriously and start thinking *way* ahead from the
43
+start.
44
+
45
+Which is exactly what I did.
46
+
47
+Finding myself in swarm of varying scripties, constantly trying to keep
48
+them at least a bit tidy, I decided to stop and do it another way:  Just
49
+try and see how much of the magic, the modularity, maintainability and
50
+discoverability that's so common in other platforms could be taken into
51
+the dark, blunt world of shell languages.
52
+
53
+Result of these efforts is called Shellfu.
54
+
55
+
56
+### So what does it do? ###
57
+
58
+Shellfu, as a project consists of three parts:
59
+
60
+ *  `shellfu()`, the shell function that lets you import a module from
61
+    known location just by name, therefore decoupling the *deployment*
62
+    from *the dependency*.
63
+
64
+ *  Shellfu core library, providing few modules readily usable for
65
+    some of the most common tasks (printing messages for user, loading
66
+    basic INI files...).
67
+
68
+    Note that this "library" is currently extremely tiny with about
69
+    4-6 modules.  It's currently (July 2016) not clear what modules
70
+    should be added or removed and what should be the size, although
71
+    there are no plans to add a lot.  Most of advantage of shellfu
72
+    is to be gained from writing *domain-specific* modules.
73
+
74
+ *  Shellfu Style Guide, setting common standard for shell modules,
75
+    allowing you to collaborate on the code in an efficient manner
76
+    (in-line documentation, peer review, code readability...).
77
+
78
+ *  As a bonus, *shellfu-doc*, building upon the Shellfu Style Guide,
79
+    allows your user to discover and read documentation of installed
80
+    modules (akin to *perldoc* or *pydoc*).
81
+
82
+
83
+### Schizophrenia kicks in ###
84
+
85
+> *So are we talking POSIX shell, Bash or Zsh or what?*
86
+
87
+The basic principle is, albeit untested, meant to be extensible to most
88
+common *bourne-like* shell languages.  In more specific sense, this
89
+means two things:
90
+
91
+ *  *shellfu.sh*, the core part of the code should be compatible with
92
+    *dash*, the Debian Almquist Shell,
93
+
94
+ *  although I don't expect various-language modules to co-exist,
95
+    *shellfu.sh* aims to be able to filter modules based on interpreter
96
+    (more on that later).
97
+
98
+ *  and some modules of the core library will try to be POSIX/dash
99
+    compatible, which will make them loadable from all.
100
+
101
+Note that I'm kind of using terms "POSIX" and "dash" interchangeably.
102
+What I really mean is that since POSIX is rather vague in many places,
103
+and there are kajilions of POSIX shells, it's impractical to aim for
104
+*real* POSIX compatibility.  Therefore, the "POSIX-oriented" code will
105
+be tested under *dash*, plus set of most common interpreters: `bash`,
106
+(add here).
107
+
108
+I reckon that's about as POSIXey as one can get without going mad.