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
exe: Transcompiles and executes immediately.save: Transcompiles and saves the Lua file (.lua).--lang go: Transcompiles to the Go language (used with the save option).--help: Displays help.