-
Notifications
You must be signed in to change notification settings - Fork 8
/
notes.txt
184 lines (130 loc) · 3.79 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
TODO
while (function)
- How can we identify function reference rather than execution?
- (function) without arguments
- when function is modest, greedy, or array
- or even unary
-> store function address on stdout
(function) -> store function address instead of compiling call to function
other loop atomics?
forever { }
break -> jump out of loop
while (function)
loop state is function reference
instead of named variables
how about named pipes?
iterations
index start -> 1
index delta -> 1
inside each loop
push index to stdin
echo atomic
modest stdin -> stdout
index atomic is essentially a hard-coded variable
zs_vm_set_index (self, value)
zs_vm_set (self, "index", value)
-> scoped, or perhaps not
MENU:
function [ phrase | phrase | phrase ]
outputs whole number
0 or less -> skip all
1, 2, 3... -> matching phrase
Problem: how to compile & run a paper script
Problem: define test case for each atomic, in ZS
Problem: ZS strings must be UTF-8 safe (length delimited)
extension classes
strings
maths
stats
message/?
cluster
subproblems
- how to assume class names to avoid over-typing?
- what does perfect messaging look like?
-> like input pipes
- pass complex objects on message
-> zsock_send style of a set of things in one frame
how to edit larger files...
save compiled VM state automatically
restore session automatically
output function definitions to disk
shell environment persistent and rich
TAB should show most used commands first
archive unused commands after X time
:-)
atomic contracts:
hint
status (draft, stable, legacy)
testcase (text)
selftests run through all atomic tests
then for functions:
hint (<something>)
selftest (<something>)
status (stable|draft|legacy)
- rewrite shell as repl primitive
- read line of input, put onto pipe
- execute input, display results if any
- core of zs.c
- then shell is
until (break) { repl }
- repl primitive takes list of lines, executes
- rewrite scaling primitives in ZS?
<
k: (<Multiply by 1000> 1000 *)
M: (<Multiply by 1M> 1000000 *)
> repl
- default for * is "multiple by 1"?
- how to add hint for function....
k: <Multiply by 1000> (1000 *)
- pipes can probably be built as single tree structure?
- make zs_repl into an actor
- accept input on pipe
- return output to pipe (end of sentence)
- profile every function, simple counter, 'n top' atomic sorts & prints top n
- expressive constants: 1/2 1:2 2^16-1 1024*1024
contain + - /: *x ^
simple stack-based evaluator in zs_lex
help on function
how to put function reference onto pipe
(function)
now (function) now -
now (function (args)) now -
help (xyz)
get hint on xyz if it's an atomic
else show code for xyz if it's a function
-> how do we know to pass a function rather than execute it?
1. @ before function name
2. atomic can force this
Multiline strings
<
some value
>
<
some value
>
Multi-line indented strings
<
some value
and another value
and then more
>
string atomics
1, many
upper
lower
camel
title
slug
size
many
paste
sort
first
last
2
find (find string in another)
split (split string into tokens)
count (count string in another)
repeat (repeat string N times)
match (string vs. pattern or pattern vs. string)
replace (string mashing,...)