Stenway Developer Network

Getting Started

Installation

Download the LimaScriptSDK.zip (Coming soon) and install it.

Creating Your First Project

Create a file called 'HelloWorld.ls' and save it as a ReliableTXT file with UTF-8 encoding and a BOM.

using Js

namespace HelloWorld
  class App
    static method main(args)
      Window.alert("Hello world")
    end
  end
end

Create a second file called 'HelloWorld.lsproj' and also save it as a ReliableTXT file.

LimaScriptProject
  Type App
  Dependencies
    Dependency Js-1.0.2.0
  End
  Files
    File HelloWorld.ls
  End
End

You should now have the following two files:

HelloWorld.ls
HelloWorld.lsproj

Compiling Your Project

Now compile your project with the LimaScript compiler with the following command:

lsc HelloWorld.lsproj

The compiler builds a LimaScript package file and you should now have three files in your project directory.

HelloWorld.ls
HelloWorld.lsproj
HelloWorld-0.0.0.0.lsp

LimaScript package files always contain the version number in the package name and because we did not specify the version in the project file the compiler assumes a zero version number.

The package file is an SML file, so you can open it and see how the source got compiled. It should look like this:

LimaScriptPackage
  Dependencies
    Dependency Js-1.0.2.0
    Dependency LimaScript-1.0.0.0
  End
  Namespace
    Class
      Name App
      Method
        Name main
        Type Static
        Params
          Param args
        End
        Begin
          Expression CallSM Js\Window alert Args 1 String "Hello world"
        End
      End
    End
  End
End

Transpiling Your Package To JavaScript

To transpile your package to JavaScript use the LimaScript to JavaScript transpiler with the following command:

ls2js HelloWorld-0.0.0.0.lsp

It will create the following HTML and JS files:

HelloWorld-0.0.0.0.html
HelloWorld-0.0.0.0.js

Open the HTML file with your browser. An alert dialog should now open and display the text 'Hello world'.

Case Insensitivity

LimaScript is case insensitive. So rewriting our example completely in upper case, except for the hello world string, produces the same result.

USING JS

NAMESPACE HELLOWORLD
  CLASS APP
    STATIC METHOD MAIN(ARGS)
      WINDOW.ALERT("Hello world")
    END
  END
END

Next Steps

...