Skip to content

jupyter-xeus/xeus-lua

Repository files navigation

xeus-lua

Build Status Documentation Status Binder Join the Gitter Chat

xeus-lua is a Jupyter kernel for Lua based on the native implementation of the Jupyter protocol xeus.

Installation

xeus-lua has been packaged for the mamba (or conda) package manager. To ensure that the installation works, it is preferable to install xeus-lua in a fresh environment. It is also needed to use a miniforge or miniconda installation because with the full anaconda you may have a conflict with the zeromq library which is already installed in the anaconda distribution.

The safest usage is to create an environment named xeus-lua

mamba create -n xeus-lua
source activate xeus-lua

Installing from conda-forge

Then you can install in this environment xeus-lua and its dependencies

mamba install xeus-lua jupyterlab -c conda-forge

Installing from source

Or you can install it from the sources, you will first need to install dependencies

mamba install cmake xeus xwidgets nlohmann_json cppzmq xtl lua  jupyterlab -c conda-forge

Then you can compile the sources (replace $CONDA_PREFIX with a custom installation prefix if need be)

mkdir build && cd build
cmake .. -D CMAKE_PREFIX_PATH=$CONDA_PREFIX -D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX -D CMAKE_INSTALL_LIBDIR=lib
make && make install

Trying it online

To try out xeus-lua interactively in your web browser, just click on the binder link:

Binder

Usage

Launch the Jupyter notebook with jupyter notebook or Jupyter lab with jupyter lab and launch a new Python notebook by selecting the xlua kernel.

Code execution and variable display:

Basic code execution

Output streams:

Output streams

Input streams:

Input streams

Error handling:

Error handling

Code completion:

Code completion

Display Data:

Code completion

And of course widgets:

Code completion

Binary Buffers for Widgets: Code completion

Documentation

To get started with using xeus-lua, check out the full documentation

http://xeus-lua.readthedocs.io

What are the advantages of using xeus-lua over other lua kernels?

There are several lua kernels available:

  • lupyter A python based implementation of a lua jupyter kernel. The heavy lifiting is done in a C-extension.
  • ILua: A feature rich implementation. Ilua is implemented in python and does the communication with Lua via IPC.
  • IPyLua: IPyLua is a pure Lua implementation.

While these implemetentations are feature rich and work very well, none of the above supports interactive widgets. Since this implementation is based on xeus, we can reuse components from the xeus ecosystem like xwidgets.

Dependencies

xeus-lua depends on

xeus-lua xeus xwidgets xtl cppzmq nlohmann_json lua
master >=2.4.0,<3 >=0.26.1 >=0.7.0,<0.8 ~4.4.1 >=3.6.1,<4.0 >=5.2.0
0.6.2 >=2.4.0,<3 >=0.26.1 >=0.7.0,<0.8 ~4.4.1 >=3.6.1,<4.0 >=5.2.0

Contributing

See CONTRIBUTING.md to know how to contribute and set up a development environment.

License

We use a shared copyright model that enables all contributors to maintain the copyright on their contributions.

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.