about summary refs log tree commit diff stats
path: root/life.tlv
Commit message (Collapse)AuthorAgeFilesLines
* graphviz: don't interpret substrings as regexesKartik K. Agaram2022-03-181-0/+4
|
* break.tlv: nascent live-updating stack languageKartik K. Agaram2022-03-171-4/+18
| | | | | | | | | Joint work with Sumeet Agarwal. In the process we discovered several bugs in our fake window helpers for tests. Thanks Sumeet! Previous prototypes: - https://archive.org/details/akkartik-2min-2020-12-06 - https://merveilles.town/@akkartik/105759816342173743
* stop using tasks in start_reading/start_writingKartik K. Agaram2022-03-161-1/+1
| | | | | We just need queues/streams for file I/O. No need to complect concurrency concerns with them.
* reconcile template in all appsKartik K. Agaram2022-03-101-8/+47
|
* use method syntax where possibleKartik K. Agaram2022-03-061-10/+10
| | | | | | Perhaps this is a bad idea. It feels arbitrary, what methods Lua happens to include in string and table objects without having to go through the respective modules.
* move start_reading/start_writing out of templateKartik K. Agaram2022-03-061-48/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When should code go in the template used by new apps vs the .lua files distributed with Teliva? - from a privilege perspective there's no difference - from a compatibility perspective stuff in .tlv will not get upgraded with Teliva. - for me the maintainer, functions in .lua files are easier to upgrade in a single place. - for the reader of an app, functions in .lua files will not show up to be edited. They can still be overloaded, but the current version isn't as discoverable. Putting something in the app is a slight nudge to readers that they're encouraged to mess with it. - Stuff in .lua files can use local functions and so have more internal complexity. Apps can also hide details within functions, but that'll make them more likely to run into limitations with Teliva's editing environment. I'm not yet sure how to reason about the second point in practice. - Stuff in .tlv files I don't have to worry about compatibility guarantees for. - Stuff in .lua files I _do_ have to worry about compatibility guarantees for. Perhaps this means I'm doing things exactly wrong in this commit? Functions like map/reduce/filter/append seem more timeless, whereas I'm still just feeling my way around with start_reading and start_writing. We'll see. For now I'm ruled by the fourth point. Messing with tasks and the scheduler is much more advanced than anything else in template.tlv; it seems to make sense to add some friction to modifying them. Bottomline: Complex sub-systems go in .lua files. Simple, self-contained definitions go into apps. Both are probably equally burdensome now from a compatibility perspective.
* use the new file API in most placesKartik K. Agaram2022-03-061-4/+6
| | | | | Really everywhere except zet.tlv. toot-toot is intended to emit throwaway files anyway.
* reconcile all apps with template.tlvKartik K. Agaram2022-03-061-0/+364
| | | | | | They may take more or less from it (sieve.tlv in particular takes nothing since call depth doesn't help at all there), but what they take is in the right order so that you can compare across apps.
* starting to convert all file reads to the new APIKartik K. Agaram2022-03-061-1/+1
| | | | | For starters, this detail was puzzling when I returned to the Game of Life app.
* distinguish between window global and argKartik K. Agaram2022-03-021-8/+8
|
* starting to make Teliva apps more testableKartik K. Agaram2022-02-271-4/+4
| | | | | | | | | | Tasteful apps should only perform side-effects through 'window' arguments rather than the 'curses' module directly. It's ok however to read constants like curses.A_NORMAL or curses.stdscr(). There are some limitations, unfortunately. Ncurses wasn't designed with testability in mind. For example, there's no way to curs_set or assume_default_colors without the 'curses' module. Oh well.
* 'doc:blurb': a place to briefly describe an appKartik K. Agaram2022-02-171-0/+13
| | | | | | This is for what the app does, as opposed to 'doc:main', which is also intended to include commentary about the internal organization of the app.
* drop io.lines()Kartik K. Agaram2022-02-021-13/+4
| | | | | | | | | | | | | | | | | I'd already dropped the variant without a filename. But even the variant with a filename is very easy to use in a way that is confusing to use in the presence of sandboxing: * call io.lines() * Sandboxing saves an error, io.lines() returns nil * Caller (usually a loop) raises an error. * We show the error and not the sandboxing failure. * Worse, there's no way to adjust permissions from within Teliva, because we can't ever get to that menu while there's an error. Best solution I can come up with: encourage a separate step for translating filename to file handle. That way it's more obvious that we need to check for errors.
* remove disabled functions from life.tlvKartik K. Agaram2021-12-251-2/+1
|
* more precise control over menu orderKartik K. Agaram2021-12-221-1/+1
| | | | I can't believe I didn't notice this until now.
* nail down trusted Teliva channels a little moreKartik K. Agaram2021-12-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | In each session, Teliva has to bootstrap a trusted channel with the computer owner while running arbitrarily untrusted code. So let's get really, really precise about what the trusted channel consists of: - the bottom-most row of screen containing the menu - the keystrokes the owner types in - ncurses COLOR_PAIR slots 254 (menu) and 255 (error) One reason the menu colors are important: we don't want people to get used to apps that hide the menu colors by setting default foreground/background to invisible and then drawing their own menu one row up. The error COLOR_PAIR I don't see any reason to carve out right now, but it seems like a good idea for Teliva the framework to not get into the habit of apps doing some things for it. I'm not sure how realistic all this is (I feel quite ill-equipped to think about security), but it seems worthwhile to err on the side of paranoia. Teliva will be paranoid so people don't have to be.
* pay more attention to where we display the cursorKartik K. Agaram2021-12-181-0/+1
| | | | | It's still just in app control; I'm resisting the urge to introduce "smarts".
* snapshot: migrate all sample apps to new formatKartik K. Agaram2021-12-111-342/+308
|
* more configurable colorsKartik K. Agaram2021-12-061-3/+3
| | | | | Also start using 256 colors, under the assumption most people will have them.
* start showing call stack on errorsKartik K. Agaram2021-12-041-0/+1
| | | | | | | | It turns out Lua has been providing us this information all along! I'd just not created the space on screen to show it. Make it persist better. Kilo now no longer tracks its own status messages, which is a regression in a rare condition.
* .Kartik K. Agaram2021-11-261-16/+32
|
* save timestamp on change; show in recent changesKartik K. Agaram2021-11-261-0/+15
|
* add support for metadata in Teliva programsKartik K. Agaram2021-11-261-0/+1
| | | | They don't have any semantics yet. We just ignore them for now.
* monotonically accumulate versions of definitionsKartik K. Agaram2021-11-241-5/+37
| | | | | | | | | | | One old drawback now has a new look. Before, we loaded definitions in order, so global definitions had to exist before other global definitions that used them. See window and grid in life.tlv. Now we load definitions in reverse order, so initialization needs to change. Worse, if we update window, we need to edit grid just to fix the order. This implies that we can't yet optimize away bindings where there are no new changes.
* indentKartik K. Agaram2021-11-231-16/+16
|
* demoKartik Agaram2021-11-141-0/+4
| | | | https://archive.org/details/akkartik-2021-11-14
* import life.teliva into image formatKartik K. Agaram2021-11-141-0/+273