Tour: Introduction

This tour introduces you to Nyarna's language features. On your right you'll find the example code for each step. You can edit and interpret the code in your browser. This page shows the example code from the main page.

The interpreter uses Nyarna's reference implementation, compiled to WASM. While it can process all shown examples properly, edits may cause it to crash due to its alpha-state. You can open your browser's JavaScript console to see error logs for such cases.

The discussion of some features will require multiple inputs. These will then be shown as tabs. The leftmost tab is the main input on which Nyarna is called.

Nyarna inputs may define parameters whose arguments are to be supplied by the caller. You will find input fields for such arguments if applicable, like who for the current example. While the Nyarna input can freely define its parameters, the interface used for the tour will give you a hardcoded list of parameters matching those defined in the given code. Editing the input to have different parameters will thus not work properly.

If you want to try out Nyarna's command line interface, you can put the input shown here into files in some directory. The files are to carry the name shown here with the .ny suffix. Assuming you installed Nyarna on your system, you can then interpret the input via

nyarna <main-input>.ny [--<param-name> <arg>]...

Since there currently is no proper language specification, the tour will contain Details sections with more extensive information on the currently discussed features. You may skip these if you just want to have a quick impression on the language.