Skip to content

Quick start: Janet (netrepl)

Oliver Caldwell edited this page Feb 25, 2021 · 4 revisions

Janet is a functional and imperative programming language. It runs on Windows, Linux, macOS, BSDs, and should run on other systems with some porting. The entire language (core library, interpreter, compiler, assembler, PEG) is less than 1MB. You can also add Janet scripting to an application by embedding a single C file and two headers.

Conjure supports Janet evaluations over a spork/netrepl connection. Starting a server is quick and easy, Conjure will automatically hook into the default host and port provided by the netrepl server.

Prerequisites

  1. Install the latest Neovim.

  2. Ensure your Neovim supports the janet filetype. You may need to find a plugin for this!

  3. Install the Conjure plugin.

  4. Install Janet (usually through your distribution’s package manager or brew).

  5. Install the spork module (jpm install spork)

Start the netrepl server

Assuming you’ve already installed the spork module we can execute this one liner to start it on the default port of 9365.

janet -e "(import spork/netrepl) (netrepl/server)"

Open and edit!

You should now be able to open any .janet file and evaluate as you would normally.

If you’re unsure how to evaluate things with Conjure, please refer to :help conjure, :help conjure-client-janet-netrepl and :ConjureSchool (an interactive tutorial).