unboxedtype / light

5 stars 2 forks source link

Disclaimer: The provided software is a developing prototype in its early days, not a released product. It is provided only to be evaluated together with Venom Hackathon submission. Lots of details described in this README are planned features, not yet implemented

Light Programming Language

   __    _       __    __
   / /   (_)___ _/ /_  / /_
  / /   / / __ `/ __ \/ __/
 / /___/ / /_/ / / / / /_
/_____/_/\__, /_/ /_/\__/
        /____/

Light is a next-generation programming language targeting TON-inspired blockchains, and specifically EverScale and Venom. Light is a statically-typed functional reactive actor-based programming language with lots of features coming for the first time ever in a modern blockchain programming landscape.

Light is a part of the bigger Lighthouse programming system aiming to significantly boost developers productivity and program safety, reducing time-to-market and lowering project delivery risks. For details, have a look at our Lighthouse Whitepaper.

Language Features

We highlight the following features of the Light language:

  let print_string s =
     print s

  (* this is also correct *)
  let print_string (s:string) =
     print s

Prototype restrictions

The vision stated in the Overview section implemented only partially at the moment. Currently, we implemented:

Manual

Here we provide step-by-step guide how to make the compiler prototype work for you.

Light compiler rely on STCONT/LDCONT instructions. Both instructions present in Venom/EverScale VM, however, its availability for smart-contracts is regulated by the network capability CapStContNewFormat.

Currently, Venom Dev-net has this cap turned off, so there are two options left:

  1. Run actors locally using tvm_linker test (not that fun, but still a viable option)
  2. Run actors in FLD network: the FLD network administrator kindly enabled this capability specifically for Light programmers.

Installation

1. Build and install the following:

2. Install Microsoft .NET framework.

See here for instruction on how to do that for your Linux distro.

Ensure that dotnet fsi command is working.

3. Build the Light compiler.

   $ git clone https://github.com/unboxedtype/light
   $ cd light
   $ make build

4. Put the directory <light>/scripts/ into the PATH

   $ export PATH=$PATH:$(pwd)/scripts/

Check that the command genActorMessage.fsx and serializeExpression.fsx are visible.

5. Make the LHCompiler binary visible. For that, do one of the following:

6. Go to <light>/samples/Sample<N> directory. There you will find test.sh script. Run it and do what it asks for. Inside the scripts, you can find all the necessary commands to deploy and interact with Light actors!

Community

Contact @unboxedType on Telegram for questions and suggestions.