Hello and welcome! This tutorial guides you through the basics of adding a new language to Riju, or modifying an existing language. The other documentation in this repo has reference material that may be helpful for advanced use cases, but this page should get you started.
If you run into any trouble following the guide, please do not hesitate to open an issue!
Fork this repository to your account on GitHub, and clone it locally:
$ git clone https://github.com/yourname/riju.git
$ cd riju
Install Docker. Then you can build and start the admin shell:
$ make image shell I=admin
All future operations can be done inside the admin shell, where Riju's dependencies are already installed.
Start a tmux session:
$ make tmux
If you don't know how to use tmux, see a cheatsheet. The useful keybindings are:
control-b c
: open new tabcontrol-b p/n
: previous/next tabcontrol-b "
: split tab into top and bottom panescontrol-b %
: split tab into left and right panescontrol-b <arrows>
: move between panescontrol-b control-b <something>
: if you have two tmuxes nested, usecontrol-b
twice to do a command on the inner one instead of the outer one
Make sure you're using the same version of Ubuntu as the mainline Riju:
$ make sync-ubuntu
Use dep
, the Riju build tool, to compile the Docker image that the
Riju server will run inside:
$ dep image:runtime
Start Riju in development mode:
$ make shell I=runtime E=1 CMD="make dev"
You should now be able to navigate to http://localhost:6119 and see that Riju is running, although it does not have any languages installed.
We are now ready to start creating your new language.
Create a file langs/mylanguage.yaml
with the following contents
(replacing mylanguage
and My Language
with appropriate values,
like objectivecpp
and Objective-C++
):
id: "mylanguage"
name: "My Language"
main: "TODO"
template: |
# Fill this in later
run: |
echo "Hello, world!"
Open a new tmux pane in the admin shell (control-b c
) and build the
Docker image for your language:
$ dep image:lang-mylanguage
Once that completes, you should see your language at
http://localhost:6119. Furthermore, you can run make sandbox L=mylanguage
to test your language at the command line (e.g. type
run
to print Hello, world!
). Each time you modify the language
configuration, run dep image:lang-mylanguage
to update the language.
Follow these steps to get from "Hello, world" to running your actual language: