1LGWAM(1) User Commands LGWAM(1)
2
3
4
6 lgwam - Logiweb Abstract Machine
7
9 lgwam command [file arg1 ... argn]
10
12 In normal use, the lgwam command is installed in /usr/bin/lgwam and is
13 used as the first line of Logiweb scripts. The first line of such
14 scripts typically read
15
16 #!/usr/bin/lgwam script
17
18 The Logiweb compiler lgc(1) generates such scripts. The format of
19 scripts is described in SCRIPT FORMAT below.
20
22 The lgwam command may take the following forms:
23
24 lgwam script FILE ARG1 ... ARGn
25 Execute the given file as a Logiweb program. Pass the command
26 line arguments to the program with FILE as ARG0. For the format
27 of FILE see SCRIPT FORMAT below.
28
29 lgwam execute FCT ARG1 ... ARGn
30 Same as above, but execute the given function. The function must
31 be defined on a page which has been compiled into lgwam. As an
32 example, if the lgc compiler has been compiled in, then 'lgwam
33 execute lgc ARG1 ... ARGn' executes the lgc compiler but needs
34 no script file.
35
36 lgwam test
37 Execute basic built in testsuite.
38
39 lgwam testrun FILE
40 Load the Logiweb page referenced in FILE and all pages refer‐
41 enced transitively from that page. Then execute an extended
42 testsuite. The extended testsuite first executes the basic test‐
43 suite. Then the extended testsuite looks for pages named 'base',
44 'check', 'Peano', and 'test'. If one or more of these are found,
45 the extended testsuite executes a number of associated tests.
46 The FILE must be a Logiweb script, c.f. SCRIPT FORMAT below.
47
48 lgwam dry
49 Do dry run: initialize memory and exit.
50
51 lgwam deff SOURCE OUT1 ... OUTn
52 Execute the deff-lisp program defined in SOURCE and write the
53 output to the given output files. This option works even when no
54 pages have been compiled into lgwam. It is used for bootstrap‐
55 ping the system in that it allows to compile an lgc compiler
56 expressed in deff-lisp. That lgc compiler can then be used to
57 compile an lgc compiler expressed in the compilers own language.
58
59 lgwam { -h | help | --help }
60 Print help message
61
62 lgwam { -v | version | --version }
63 Print version and license information.
64
65 lgwam { pages | --pages }
66 List built in pages.
67
69 A Logiweb script file consists of lines of text. Blank lines and lines
70 starting with a hash mark (#) are ignored. Lines can be ended by arbi‐
71 trary sequences of CR and LF characters.
72
73 A script may look thus:
74
75 #!/usr/bin/lgwam script
76 string
77 015F43BE4A17DAD915936B7A773154A80946AEC82EFBEECDA4A7D7B80806
78 hello
79 execute
80 foo=bar
81 magicword=xyzzy
82
83 The first line starts with a hash mark so it is ignored.
84
85 The first proper line (the second line) indicates the format of the
86 rest of the script. The 'string' format is the only format which is not
87 deprecated, so the first proper line always says 'string'.
88
89 The second proper line contains the reference of a Logiweb page
90 expressed in mixed endian hexadecimal, c.f. REFERENCES below.
91
92 The third proper line indicates the name of the program ('hello' in
93 this case).
94
95 The fourth proper line indicates the aspect defining the program. The
96 lgc compiler always sets the aspect to 'execute'.
97
98 All remaining lines define script options which are passed to the pro‐
99 gram.
100
101 When lgwam executes a Logiweb script, it first loads the referenced
102 page and all its transitively referenced pages. It does so using the
103 LGW_PATH environment variable described under ENVIRONMENT below.
104
105 Then lgwam looks up the given aspect of the given name on the refer‐
106 enced page where both aspect and name are treated as strings. The base
107 page which comes with the distribution defines the 'execute' aspect of
108 'hello' such that the resulting program prints 'Hello World'.
109
110 Then lgwam invokes the given aspect of the given name in the way
111 described on the base page. See the base page for further information.
112
114 Whenever lgwam needs to load a page, it locates the page using the
115 LGW_PATH environment variable. If that variable is not set, it defaults
116 to
117
118 $HOME/.logiweb/logiweb/:/rack.lgr
119
120 The value of LGW_PATH must be a list of locations separated by semi‐
121 colons. The default path above contains only one location and, thus, no
122 semicolons.
123
124 To load a referenced page, lgwam tries each location in turn. For each
125 location, lgwam replaces the rightmost colon character by the reference
126 of the page expressed in mixed endian hexadecimal, c.f. REFERENCES
127 below. Then lgwam reads the file at the resulting path, if any. The
128 file must be a rack file, c.f. logiweb(5).
129
131 The Logiweb reference of a Logiweb page is a sequence of around 30
132 bytes which identifies the page uniquely. References are often
133 expressed in mixed endian hexadecimal.
134
135 In mixed endian hexadecimal, each byte is represented by two hexadeci‐
136 mal digits with the most significant digit first. Bytes are given in
137 network order. Capital letters are used for the hex digits A to F.
138
140 Klaus Grue, http://logiweb.eu/
141
143 lgc(1), lgc(5), lgc.conf(5), logiweb(5)
144
145
146
147Logiweb JULY 2009 LGWAM(1)