Skip to content
forked from neovim/neovim

Neovim-fork with WASM plugin interface

License

Notifications You must be signed in to change notification settings

bobogei81123/neovim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This fork of Neovim aims to add a WASM plugin interface.

This is not to make Neovim able to be compiled into WASM.

Build

Run make in this top-level directory. The built neovim will be located at build/bin/nvim. Try it with build/bin/nvim -u NONE.

After building the neovim from source, run :wasm <path-to-wasm> to run a WASM binary.

Examples

There are some example WASM binaries located in wasm/example. See the README file for building instructions.

WASM

WebAssembly (WASM) is a portable binary format. It is designed to be executed in a sandboxed virtual machines (hosts) safely. Moreover, nearly all programming language can target WASM, this includes C, C++, Rust, and many more.

WASM Features

This implementation uses the following non-standardized features:

  • Component Model: Without the component model proposal, we will need to document how data are represented and passed across the virtual machine boundary, and either Neovim or the people writing WASM binary will need to implement the "glue code" translating the representations. The proposal is in Phase 1: Feature Proposal so many changes is likely before this feature is standardized.

Features that will be helpful

  • WebAssembly C and C++ API: This will create a common interface for WASM runtimes so it is possible to plug in different runtimes seamlessly.

WASM Runtimes

The current implmementation uses Wasmtime because it seems to be the only one now (2023-06) that supports the component model feature.

Nvim WASM module

The main code for the new WASM module is located at src/nvim/rust. It is written in Rust because only Wasmtime Rust API supports Component model for now (2023-06). The C bindings is located at src/nvim/wasm.

About

Neovim-fork with WASM plugin interface

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 43.9%
  • C 30.9%
  • Lua 23.7%
  • Python 0.5%
  • CMake 0.5%
  • Rust 0.3%
  • Other 0.2%