Commit Graph

778 Commits

Author SHA1 Message Date
Kartik K. Agaram b5aca9a571 toot-toot: stop clobbering existing files
I've been reluctant to do this until now because it makes it more
difficult to grant an app the ideal permissions. Here's what I use:

  return string.find(filename, 'toot') == 1

But I'm also trying to keep people from looking to the app to figure out
what permissions to give it :/
2022-03-31 08:51:05 -07:00
Kartik K. Agaram 3618487289 toot-toot: disable ctrl-k
Rather than invest LoC in asking for confirmation or an undo feature,
just have people restart to clear the page.

I fucking suck for how many ways I can come up with to lose data in a
text editor. It really should have been fucking obvious that clearing
the page so easily was a footgun just waiting to happen.
2022-03-30 21:36:34 -07:00
Kartik K. Agaram b56590ddc9 some more reorg of the standard library
Now life.tlv and gemini.tlv are also minimizing how much of the standard
library they pull in, just to be easy to read.
2022-03-27 11:42:19 -07:00
Kartik K. Agaram 14446eefc4 helper: count permutations 2022-03-27 11:24:56 -07:00
Kartik K. Agaram dd7da2c62a helper: count 2022-03-27 10:53:41 -07:00
Kartik K. Agaram 455870d114 reorg 2022-03-20 18:00:42 -07:00
Kartik K. Agaram 9ec94aa982 disallow all relative paths (./ or ../)
Teliva's model doesn't include any way to change directory. We just have
relative paths and absolute paths. Relative paths should not be able to
reach into parent directories.

The current test is a bit hacky; it also disallows directories ending in
a period. Hopefully not an issue.
2022-03-20 17:58:14 -07:00
Kartik K. Agaram c7d3037e9d graphviz: show topology in multiple lines 2022-03-19 21:13:55 -07:00
Kartik K. Agaram fddbe08fc8 graphviz: for basic stats, show all nodes ordered
The ordering is topological; nodes come before their dependencies.

Also some more helpful functions in the template for new apps.
2022-03-19 16:59:30 -07:00
Kartik K. Agaram 7859317ece standardize common helpers across all apps
In particular, I merged take_out in anagrams.tlv with all_but in
graphviz.
2022-03-19 00:19:58 -07:00
Kartik K. Agaram ad0ce8b83e graphviz: second sketch to present the Focus
In the process we fix some bugs in how we compare tables and count nodes
in the graph.
2022-03-19 00:03:26 -07:00
Kartik K. Agaram b94f07e0b5 . 2022-03-18 23:48:39 -07:00
Kartik K. Agaram aed89b8d35 graphviz: draft notion of nodes in 'focus'
Now the REPL isn't about deciding what to calculate, but just what nodes
to calculate it for.
2022-03-18 21:22:18 -07:00
Kartik K. Agaram c21cefa888 idiom: table.insert for appending
Stop using arr[#arr+1].
2022-03-18 20:55:07 -07:00
Kartik K. Agaram a05f713dc1 graphviz: tweak data structure slightly
A node's edges contain an associative array of target nodes rather than
a linear array.

This way we automatically dedup edges when we load multiple graphs.
2022-03-18 18:02:07 -07:00
Kartik K. Agaram 03a3883555 graphviz: read multiple .dot files
It's useful to be able to import dependencies for multiple packages at
once, so that we can see common dependencies.
2022-03-18 17:58:25 -07:00
Kartik K. Agaram 824705f770 fix a warning 2022-03-18 17:49:26 -07:00
Kartik K. Agaram 7586b773d9 graphviz: sketch of the dashboard 2022-03-18 17:40:18 -07:00
Kartik K. Agaram 06615231ae graphviz: done parsing directed graphs
This is mostly what I want since I'm interested in parsing the output of
debtree.
2022-03-18 17:09:47 -07:00
Kartik K. Agaram 7dc0928f52 graphviz: show error when lacking permissions 2022-03-18 10:43:48 -07:00
Kartik K. Agaram 29d53c21ac graphviz: don't interpret substrings as regexes 2022-03-18 10:43:48 -07:00
Kartik K. Agaram 0374e82aa5 show current definition being edited
This serves two purposes:
- Things get confusing if function being defined doesn't match the
  definition name. Displaying the current definition helps diagnose this
  situation.
- We're already able to see callers at a glance even if the cursor is
  below the fold. The name of the current definition is arguably more
  important in that situation.
2022-03-18 10:39:56 -07:00
Kartik K. Agaram af8d3addd2 stale references to caller 2022-03-18 10:39:56 -07:00
Kartik K. Agaram 6c85513499 beginnings of a parser for .dot files
I'm following https://graphviz.org/doc/info/lang.html. Just tokenization
so far.
2022-03-18 10:39:56 -07:00
Kartik K. Agaram 4a90a28a15 fake to stand in for start_reading in tests 2022-03-18 09:24:53 -07:00
Kartik K. Agaram 5c42b1de32 break.tlv: nascent live-updating stack language
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
2022-03-17 23:36:15 -07:00
Kartik K. Agaram 56f1b97b9c sandbox os.remove 2022-03-17 15:38:50 -07:00
Kartik K. Agaram 1d3101507e fix some warnings 2022-03-17 00:15:16 -07:00
Kartik K. Agaram f9fc4a3d58 file handles vs file objects, ugh 2022-03-17 00:01:36 -07:00
Kartik K. Agaram 5380817ce6 function names from globals rather than debug info
This reclaims all the slowdown in sieve.tlv, and it also is now smart
enough to detect calls to global bindings that pass through variables.

On the flip side, we lose names for non-globals. But that's not very
useful anyway in Teliva's context.

This is still not enough to detect callers through coroutines
(intervening anonymous functions), though.
2022-03-16 23:53:08 -07:00
Kartik K. Agaram 76d1dda240 bring back hack when caller is main
Partially undoes commit f2d29c22f8.
2022-03-16 23:45:42 -07:00
Kartik K. Agaram 785dfaa1ec cache function names
This brings down the slowdown in sieve.tlv from 50% to 25% (15s).
2022-03-16 23:45:38 -07:00
Kartik K. Agaram 155f6a8027 standardize some names 2022-03-16 21:48:41 -07:00
Kartik K. Agaram fffcc8b9ab stop running task.scheduler by default
sieve.tlv is 50% slower (18s vs 12s) with the new function call
instrumentation.
2022-03-16 21:38:34 -07:00
Kartik K. Agaram d6554919b1 delete dead code 2022-03-16 21:28:58 -07:00
Kartik K. Agaram ef5195dee9 simplify function call instrumentation
src/ldo.c now has a minimal diff with Lua 5.1.

It might be a bit slower than it was before, but not noticeably so..

This approach doesn't support indirect calls.
2022-03-16 21:19:19 -07:00
Kartik K. Agaram 182408ec54 drop a header 2022-03-16 20:33:28 -07:00
Kartik K. Agaram ed5efcd8a0 drop a forward decl 2022-03-16 20:31:43 -07:00
Kartik K. Agaram 709cc25130 start cleaning up function call instrumentation
It's a mess. I calculate call-graph depth one way and calculate caller
names another way. At least one of the ways fails to work with indirect
calls. Hopefully the other way works?
2022-03-16 20:29:50 -07:00
Kartik K. Agaram b9c187d259 stop using tasks in start_reading/start_writing
We just need queues/streams for file I/O. No need to complect
concurrency concerns with them.
2022-03-16 17:03:38 -07:00
Kartik K. Agaram ab89be1ed3 Teliva's been broken 2 days while I mess with docs 2022-03-15 16:00:08 -07:00
Kartik K. Agaram 2662b1afed . 2022-03-14 18:37:56 -07:00
Kartik K. Agaram 5e976554dd drop the lfs library
I can't feel confident about its sandboxing story yet. And if we can't
build a file navigator, what are we even doing with it.
2022-03-14 17:26:13 -07:00
Kartik K. Agaram 6f5f6849dd . 2022-03-14 17:23:38 -07:00
Kartik K. Agaram babaa235b1 update link to manual 2022-03-14 16:46:05 -07:00
Kartik K. Agaram 2b81ded335 typo 2022-03-14 16:35:24 -07:00
Kartik K. Agaram 06a5e841d1 doc: curses 2022-03-14 11:47:15 -07:00
Kartik K. Agaram a8df25c497 doc: flesh out tasks and channels 2022-03-14 09:56:41 -07:00
Kartik K. Agaram b571a342d7 doc: correct and flesh out json 2022-03-14 09:32:38 -07:00
Kartik K. Agaram 1eb37f220d typo 2022-03-14 07:59:41 -07:00