Skip to content

Lua scripting / other configuration solution #16

Description

@wurli

It would be nice to add configuration/scripting to Jet via Lua.

Why Lua instead of a 'static' config format like toml, yaml, json, etc?

  • Being able to receive/send jupyter messages via Lua would make it possible to extend the Jet CLI to support kernel-specific features (i.e. comms), or to just execute code in response to other stuff, e.g. the terminal width changing
  • Would be fairly straightforward to allow users to implement custom commands, e.g. :restart, %install ..., etc
  • More things I haven't thought of yet

Implementation

The fact that we already expose a Lua library complicates things, since mlua doesn't let you expose a library and vender a Lua runtime. So we'd basically need to build in 2 modes:

  • If we're building the Lua library, we'd need to piggyback off the host Lua session and reuse that Lua runtime to support Jet's scripting

  • If we're building the CLI we'd bundle our own Lua runtime, i.e. Luajit.

Stuff which should be configurable

  • Completions window appearance
  • Keybindings (e.g. for completions)
  • Styling of output from external clients

Stuff which should be scriptable

  • Intercept CLI (repl) input/output text. Would have to think about how to handle escapes, though
  • Callbacks for jupyter messages (both sent and received)
  • Session name. Makes more sense to have this as scriptable than configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions