Commit Graph

120 Commits

Author SHA1 Message Date
Kartik K. Agaram 02cdf25c1d abortive experiment: keep definitions independent
Functions can refer to each other, but global variable initializers
shouldn't.

But this doesn't work. That comment keeps growing to capture more corner
cases.

Step back. What am I trying to achieve?

I'm not trying to create a better abstraction for programming with. I'm
trying to use an existing abstraction (LÖVE) without needing additional
tools.

I'm not supporting end-user programming, only end-programmer
programming. What happens in a regular LÖVE program if you use a global
before it's defined? You get an error, and you're on the hook to fix it.
But it's obvious what's going on because a file has an obvious sequence
of definitions. But what if you have multiple files? It's easy to lose
track of order and we mostly don't care.

The important property existing dev environments care about: merely
editing a definition doesn't _change_ the order of top-level
definitions. Let's just provide this guarantee.

We'll no longer load definitions in order of their version. Just load
definitions in the order they were created. Editing a definition doesn't
change this order. Deleting and recreating a definition puts it at the
end.
2023-04-15 17:24:11 -07:00
Kartik K. Agaram 6274322412 reorg 2023-04-15 10:14:42 -07:00
Kartik K. Agaram b6cb27ddf2 clarify a comment 2023-04-15 10:12:32 -07:00
Kartik K. Agaram 285fae235b Merge luaML.love 2023-04-09 22:38:00 -07:00
Kartik K. Agaram 275b707546 rename 2023-04-09 22:31:12 -07:00
Kartik K. Agaram c1b86211cb prevent overriding foundational definitions 2023-04-09 22:29:44 -07:00
Kartik K. Agaram e4d76f687e Merge luaML.love 2023-04-09 10:43:57 -07:00
Kartik K. Agaram 572d7fcb94 audit all calls to live.eval
Ignoring errors should be extremely rare and well-considered.
2023-04-09 10:40:11 -07:00
Kartik K. Agaram 8096955025 abstraction: roll forward/back 2023-04-09 10:24:23 -07:00
Kartik K. Agaram fd8248f803 Merge luaML.love 2023-04-08 22:05:34 -07:00
Kartik K. Agaram f387c40d95 restart on a remote command from the driver
This should be useful for ensuring that apps work the same after
restart.
2023-04-07 18:18:43 -07:00
Kartik K. Agaram 9d1ed1e1f3 Merge luaML.love 2023-02-04 21:21:56 -08:00
Kartik K. Agaram 951cbe6d0b I'm blind 2023-02-04 21:19:05 -08:00
Kartik K. Agaram 16bae0f3aa merge: include a default_map for driver.love 2023-01-25 18:24:37 -08:00
Kartik K. Agaram e96fa2cce7 support including a default_map
The first time you connect to an app with driver.love, it'll request and
obtain any available default_map to show you. That should make for a
better initial experience. Past that point you're free to move
definitions around, and the default map will stop getting in your way.
2023-01-25 18:09:47 -08:00
Kartik K. Agaram 40a63c2d39 Merge luaML.love 2023-01-23 20:32:29 -08:00
Kartik K. Agaram 7168ed5372 consistently save/restore state when running tests
It's not obvious, but this is a refactoring. There should be no behavior
changes.
2023-01-23 20:29:59 -08:00
Kartik K. Agaram 20a586dc1f undo font changes when running tests
This seems to be making test runs less flaky in downstream forks.
2023-01-23 20:17:09 -08:00
Kartik K. Agaram 2f1ec093ba rename 2023-01-23 20:12:23 -08:00
Kartik K. Agaram a029addfc6 Merge luaML.love 2023-01-23 09:18:45 -08:00
Kartik K. Agaram 26652810f9 send Test_failures _before_ restoring globals
A bugfix, but slightly mind-bending.
2023-01-23 09:16:31 -08:00
Kartik K. Agaram e1d0d2e5de Merge luaML.love 2023-01-23 00:09:40 -08:00
Kartik K. Agaram 00ec1dd39e restore globals after running tests
Is it possible this will work?

If so, the programmer's responsibility is to ensure App.initialize_globals()
has no side-effects besides initializing global bindings.
2023-01-23 00:01:15 -08:00
Kartik K. Agaram a73c69fd4e Merge luaML.love 2023-01-22 21:58:54 -08:00
Kartik K. Agaram 461ac9d18b stop cranking CPU on error 2023-01-22 21:53:58 -08:00
Kartik K. Agaram 4bcddc3a83 Merge luaML.love 2023-01-22 16:42:08 -08:00
Kartik K. Agaram e3ced06b82 return failing tests with every code change 2023-01-22 16:39:54 -08:00
Kartik K. Agaram c76cd9c5ff Merge luaML.love 2023-01-22 11:43:29 -08:00
Kartik K. Agaram 6c4cb395b6 generalize the protocol to return errors, etc.
Arguably the 'ERROR' prefix should just go in here..
2023-01-22 11:37:38 -08:00
Kartik K. Agaram 6bd181b169 Merge luaML.love 2023-01-20 23:00:17 -08:00
Kartik K. Agaram 4c7ea0e776 unnecessary coercion 2023-01-20 20:07:34 -08:00
Kartik K. Agaram fb1c0e7ec4 Merge luaML.love 2023-01-09 12:42:59 -08:00
Kartik K. Agaram d135ed9c64 one more fix 2023-01-09 12:41:49 -08:00
Kartik K. Agaram 0a19311889 Merge luaML.love 2023-01-09 12:35:44 -08:00
Kartik K. Agaram 85bdd1b30a alter on-disk representation (manifest files)
I just tried my freewheeling apps on Windows and noticed filenames
conflicting and failing to show up in the working tree on the
case-insensensitive file system.
2023-01-09 12:27:17 -08:00
Kartik K. Agaram c05f3a9596 ah, I was missing this infrastructure 2023-01-07 22:52:45 -08:00
Kartik K. Agaram 797c3c3536 clean up a few debug prints 2023-01-07 21:41:21 -08:00
Kartik K. Agaram 7bda539d8e Merge luaML 2023-01-07 21:24:33 -08:00
Kartik K. Agaram b31f6954d0 small change to simplify the driver's task 2023-01-07 21:23:51 -08:00
Kartik K. Agaram b8497cab03 Merge luaML 2023-01-07 20:49:06 -08:00
Kartik K. Agaram 7955bb2372 now fix copy-paste errors in GET* 2023-01-07 20:48:22 -08:00
Kartik K. Agaram 12df326fe9 Merge luaML 2023-01-07 20:40:43 -08:00
Kartik K. Agaram 7b256de9c9 clear error message on unknown definition 2023-01-07 20:39:52 -08:00
Kartik K. Agaram f54046d8a2 Merge luaML 2023-01-07 20:30:39 -08:00
Kartik K. Agaram b2cbfc0b65 don't also send success on error
That's a recipe for race conditions.
2023-01-07 20:28:37 -08:00
Kartik K. Agaram 9bab2578bb check for syntax errors when loading app 2023-01-07 20:27:38 -08:00
Kartik K. Agaram ada035f0bc bugfix: roll back on load error 2023-01-07 19:12:26 -08:00
Kartik K. Agaram eb0079ef87 typo 2023-01-07 19:11:50 -08:00
Kartik K. Agaram a8860087d3 Merge luaML.love 2023-01-07 14:52:11 -08:00
Kartik K. Agaram 4d81e495f8 new command: batch GET
We need this to speed up the initial load of the driver.
2023-01-07 14:43:38 -08:00
Kartik K. Agaram 2caa2fce93 snapshot: trying to load definitions directly
It took me way too long to realize this can't work. The reason:
definitions can exist in the app's source directory. And there's no way
to deduce that.

I _could_ start passing that to the driver, but it would suck to need to
do so just to speed up the initial load..
2023-01-07 13:18:56 -08:00
Kartik K. Agaram 6f57876824 Merge luaML.love 2023-01-02 18:27:56 -08:00
Kartik K. Agaram b6fc07a36b specify app in manifest
This will help the driver maintain separate settings for each app.
2023-01-02 18:24:24 -08:00
Kartik K. Agaram b4fff66a56 a prefix for metadata in the manifest 2023-01-02 18:21:55 -08:00
Kartik K. Agaram 2f46556115 start bolting on driver code 2022-12-26 00:38:43 -08:00
Kartik K. Agaram 87e7231fa4 backport some doc updates and renames 2022-12-26 00:27:24 -08:00
Kartik K. Agaram 136d207689 update documentation on the freewheeling protocol 2022-12-26 00:13:46 -08:00
Kartik K. Agaram 6ea7f29bb2 rename some methods 2022-12-25 23:37:39 -08:00
Kartik K. Agaram ec7d7a3452 talk to a meta-driver rather than a driver
This is the first step in turning this app into a driver for other apps.
2022-12-25 16:51:11 -08:00
Kartik K. Agaram 8add8ee51d rename globals to have a single uppercase letter 2022-12-25 15:51:39 -08:00
Kartik K. Agaram 34abf6c624 a few more renames 2022-12-23 20:34:20 -08:00
Kartik K. Agaram 276ca2287e update protocol so driver shows syntax errors 2022-12-17 10:49:53 -08:00
Kartik K. Agaram 6a5eca342c a new event: receiving code changes from the driver 2022-12-16 19:35:29 -08:00
Kartik K. Agaram e9a5027d7c bugfix: check for numeric prefix 2022-11-30 19:26:46 -08:00
Kartik K. Agaram 18fa7fcc3d move temporary file out of user directory (if possible)
'(could be the same as getUserDirectory)' -- https://love2d.org/wiki/love.filesystem.getAppdataDirectory
2022-11-30 19:25:34 -08:00
Kartik K. Agaram 6d57eaa77a bugfix
Errors like this in handle_error get very hard to debug.
2022-11-27 18:19:58 -08:00
Kartik K. Agaram 3588b4ddf5 load manifest in correct order 2022-11-27 18:07:10 -08:00
Kartik K. Agaram 8b8e08c4d6 nice way to make on.* handlers more discoverable 2022-11-27 14:56:48 -08:00
Kartik K. Agaram fdf4722d2a app is now live, can communicate with driver
In the process I've also switched to a separate channel for run-time
errors. Now the driver won't struggle to get bindings out of the app
while it's throwing errors.
2022-11-27 14:28:18 -08:00
Kartik K. Agaram ce36bc1f43 app running again 2022-11-27 14:06:15 -08:00