Skip to content

Tooling

n451 edited this page Jul 22, 2024 · 4 revisions

REPL

modal repl is the main experimental playground as of now

Options

modal repl   :? for help
modal> :?
:v  show _VERSION
:t  get type definition for lib func (TODO: for expression)
:q  quit repl
modal> :t fast
Pattern Time -> Pattern a -> Pattern 

Lua Mode (TODO)

  • should do flexible interop with native lua code, and run lua code in the modal repl
  • currently possible through the official lua repl and just run require"modal"(), can not send to server though :(

EDITER

  • [modal.nvim]://github.com/noearc/modal.nvim) in construction
  • neovim supprot will be the most complete, though other editor support would be easy
  • neovim not only because it is my editor of choice, but also because neovim is just a superpowered lua environment, modal essentially can be build as a plugin lol.

LSP

  • this project maintain both the haskell style type definitions that it uses to internally do type conversions, and the [LuaCATs]://github.com/LuaCATS) style definitions that [lua-language-server]://github.com/LuaLS/lua-language-server) uses
  • later there should be a simple program that compiles a chunk of modal code into lua and ask LuaLS questions, which will act as the modal language server to provide completion and diagnostics for modal sessions.
  • it should provide
  • completion (functions, samples)
  • diagnostics (see compile errors like error types before eval)
  • snippets (type fast, then gets factor and pat, with former highlighted and can jump to latter)

Tree-sitter

  • very early alpha ... [tree-sitter-modal]://github.com/noearc/tree-sitter-modal)
  • should be able to highlight both lua code and modal code, latter could just be taken from a small part of haskell grammar.
  • it should provide:
  • highlighting
  • structural editing
  • metadata like strudel
Clone this wiki locally