The code for the `CommandTransferValue` was deeply entrenched in the
whole Lua execution code, which is obviously not ideal. In trying to
alleviate that, I decided to generalize the API in a way, that makes
adding new languages a lot easier.
Multiple things are still missing:
- [ ] Table type support
- [ ] Error messages and Status messages in ci input field (not in the status panel)
- [ ] Better ux in the ci input field (scrollback more than one line, syntax highlighting, &c)
- For further checkboxes take a look at the `FIXME`s and `TODO`s in the code.
The base ci although is already usable and in some way useful
The default print function prints to stdout, which obviously
doesn't work with a tui application. This wrapper however is a
rather poor workaround, as it only works with strings (lua `print`
calls `tostring` to turn non string values in something printable).
This **should** have everything the other implementation had, but the
api is implemented in a way, which is more in line with the expectation
raised at the lua functions (being that they are only wrappers over the
command api, and nothing more).
Aside of that, this version is actually documented!
The event handling is deeply ingrained in the ui code, the commands are
focused around the ui code, in short splitting of the event handling and
command system from the ui is intentionally hard and in my opinion not
really worth it right now.
Compiling the whole tui stack, just to debug the lua command line seems
counterproductive to me. This allows to just compile the needed parts
for a basic lua repl.
As of yet the repl is just a mock-up, as the event handling can, as of
right now, not easily be separated from the tui.
To activate specific features add specify the on the cargo command line
like this:
```
cargo run --features "cli tui"
```
or add them to the `default` feature set in the `Cargo.toml`.
I measured the linking times by running `cargo rustc --bin trinitrix --
-Z time-passes`, which resulted in following data:
`ld`:
37.794s to link
`mold`:
21.389s to link
The downside for now is, that this requires to have mold installed to
build trinitrix (The nix flake based direnv already has it) and that
mold only works on linux.