about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* metatables seem to be a separate namespace from globalsKartik K. Agaram2021-11-051-3/+3
|
* snapshotKartik K. Agaram2021-11-051-2/+61
| | | | | | | | | Not quite working. curses.stdscr() is returning userdata, not a window. This is true even of the raw array example from the book. So we need to learn something new here. How does lcurses's Pinitscr return a special window object? From what I can tell it's just putting the results of lc_newwin() on the stack. Which is the same as my curses_newwin() here.
* stdscr bindingKartik K. Agaram2021-11-051-0/+12
| | | | | print(curses.stdscr()) print(curses:stdscr())
* starting on curses libraryKartik K. Agaram2021-11-055-3/+46
| | | | | | | | | | | | | | | First piece of working new vocabulary: print(curses:cols()) Just pulling in code from lcurses for the most part. But I'm trying to understand its internals as I gradually add them in, after my more blunt first approach of packaging up lcurses/ext failed. Overall plan for Teliva's API: - start out with a 'curses' library that does what people who are used to ncurses/lcurses expect. - over time create a more opinionated library called 'screen' or 'window' or something.
* https://www.lua.org/pil/28.3.htmlKartik K. Agaram2021-11-051-2/+13
| | | | | | | | a = array.new(1000) for i=1,1000 do a:set(i, 1/i) end print(a:get(10)) -- 0.1
* https://www.lua.org/pil/28.2.htmlKartik K. Agaram2021-11-051-7/+16
|
* confirmed that this is the sameKartik K. Agaram2021-11-051-2/+2
| | | | And it seems simpler to me.
* going through chapter 28 of https://www.lua.org/pilKartik K. Agaram2021-11-052-3/+86
| | | | | | | | | User-defined C data. I think I have some understanding of the Lua stack now. It's a different kind of verbose, error-prone syntax than Mu that requires me to play computer in my head. But I don't fully grok metatables yet. At least not well enough to grok everything that's going on in lcurses/ext.
* I don't yet understand the stackKartik K. Agaram2021-10-242-5/+4
|
* ok, starting to make sense nowKartik K. Agaram2021-10-241-3/+1
| | | | | | | | Putting together two resources: https://lucasklassmann.com/blog/2019-02-02-how-to-embeddeding-lua-in-c/#exposing-a-simple-variable https://www.lua.org/manual/5.3/manual.html, section 2.1, "Values and Types", particularly the description of light user data. And lo, I see lua_pushlightuserdata in lapi.c
* done reading lua_newstateKartik K. Agaram2021-10-241-1/+8
|
* mildly less confusingKartik K. Agaram2021-10-241-1/+1
|
* back to making sense of lua_newstateKartik K. Agaram2021-10-241-1/+1
|
* get rid of userstate hooksKartik K. Agaram2021-10-245-21/+0
|
* get rid of fromstate/tostateKartik K. Agaram2021-10-242-9/+4
|
* get rid of state_sizeKartik K. Agaram2021-10-242-6/+5
|
* get rid of LUAI_EXTRASPACEKartik K. Agaram2021-10-243-12/+17
| | | | | Lua's power may come from extensibility, but the indirections are currently in the way
* trying to make sense of how bindings are createdKartik K. Agaram2021-10-243-4/+2
| | | | | | lua_State contains these StkId fields (stack, stack_last, base, top) that expand to a pointer of a struct containing a Lua value and an int. Unclear how it's used, or how you build a stack out of it.
* a simple test "app": towers of hanoiKartik K. Agaram2021-10-231-0/+78
| | | | | Currently it works with stock Lua and lcurses. Our job now is to build in the bindings to make it work here.
* print's newline now returns to column 0Kartik K. Agaram2021-10-221-10/+7
| | | | | | | | | | At this point I'm done making this repo ncurses-ready. Remaining files that allude to stdin/stdout/stderr: lauxlib.c - unclear how these primitives should work; may kill them ldblib.c - unclear what debug experience should be liolib.c - might kill or simulate these luac.c - let the compiler continue to be a terminal program
* drop lua_stdin_is_ttyKartik K. Agaram2021-10-221-17/+0
| | | | luaconf.h now no longer refers to stdin/stdout/stderr.
* drop support for '-' filenameKartik K. Agaram2021-10-221-10/+3
| | | | lua.c now no longer refers to stdin/stdout/stderr.
* ncurses I/O in lua.cKartik K. Agaram2021-10-221-10/+15
| | | | | | | | | | | | Currently working: > print(1) 1 > print(2) 2 Print's newline doesn't return to column 0 yet. Ctrl-d no longer works. Ctrl-c exits cleanly.
* kill lua_readline abstractionKartik K. Agaram2021-10-222-6/+3
|
* purge notion of commandline historyKartik K. Agaram2021-10-222-4/+0
|
* delete readline supportKartik K. Agaram2021-10-222-22/+4
| | | | We're going to be using full-on ncurses.
* clean up a few warnings with gcc 9.3.0Kartik K. Agaram2021-10-223-3/+3
|
* new fork of Lua 5.1Kartik K. Agaram2021-10-22102-0/+28521
https://www.lua.org
m <vc@akkartik.com> 2018-06-24 09:16:17 -0700 committer Kartik Agaram <vc@akkartik.com> 2018-06-24 09:18:20 -0700 4266 - space for alloc-id in heap allocations' href='/akkartik/mu/commit/087file.cc?h=hlt&id=23d3a02226973f80188e84fa5dcedb14413c5b7f'>23d3a022 ^
dff1abb2 ^







734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

10bbca64 ^
2b250717 ^
ff16e04f ^





10bbca64 ^



dff1abb2 ^


734eef7c ^
dff1abb2 ^





10bbca64 ^
dff1abb2 ^

10bbca64 ^
dff1abb2 ^






10bbca64 ^




dff1abb2 ^
fda86efe ^
dff1abb2 ^



10bbca64 ^
dff1abb2 ^

f4eee01a ^
f2043a73 ^
dff1abb2 ^

734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

a621ef95 ^

dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^

dff1abb2 ^


734eef7c ^
dff1abb2 ^






















734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^


2b250717 ^
ff16e04f ^

dff1abb2 ^


734eef7c ^
dff1abb2 ^




a7c3f156 ^

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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225