日本語

Installation and Hello World

Installation

To use LuneScript, install either the Go version (recommended) or the Lua version of the transcompiler.

Installing the Go Version (Recommended)

A Linux environment with Docker is the easiest way to get started.

$ git clone --depth 1 https://github.com/ifritJP/LuneScript
$ cd LuneScript/src
$ sudo docker build -t linux_lns test/docker/compose/linux/build
$ sudo docker run --rm -v $PWD:/local linux_lns cp /usr/bin/lnsc /local/lnsc

This will generate lnsc in the current directory. Move it to a directory in your PATH.

Hello World

Create hello.lns.

// @lnsFront: ok
print( "Hello world." );

Execution (exe)

$ lnsc hello.lns exe
Hello world.

Transcompilation (save)

$ lnsc hello.lns save

hello.lua will be generated.

Main Options for the lnsc Command

Next, let's try building a practical application.
Proceed to Practical: Creating an Expression Parser ▶