/Lpg

a new programming language with safe, static types

Primary LanguageCMIT LicenseMIT

CI

  • TyRoXx (main) Build Status Build status
  • mamazu (fork) Build Status

Usage

For a general introduction, have a look at the file documentation/Language.md

Just write a .lpg file and run it. If you want to have syntax highlighting, there is a Visual Studio Code Plugin and a Notepad++ syntax file in this repository.

Compilation

In order to compile and run an .lpg file you need to build the whole project and run the following command in the terminal:

  • On Windows:

{build-directory}/cli/lpg.exe and give it the .lpg file as argument.

  • On Linux

{build-directory}/cli/lpg and give it the .lpg file as argument.

Development

Currently supported operating systems are:

  • Windows
  • Linux

Build and run on Ubuntu

Install at least the following tools:

sudo apt-get install git cmake gcc valgrind ninja-build nodejs

How to build and run the tests:

git clone https://github.com/TyRoXx/Lpg.git
mkdir build
cd build
cmake ../Lpg -G "CodeBlocks - Unix Makefiles"
cmake --build .
./tests/tests

You can also open the project using an IDE. QtCreator is recommended:

sudo apt-get install qtcreator

Test coverage on Ubuntu

How to measure test coverage:

sudo apt-get install lcov firefox
cd build
make testcoverage

It will run the tests, generate an HTML coverage report and open it in Firefox.

Code formatting

Install clang-format like this on Ubuntu:

sudo apt-get install clang-format-3.9

On Windows, you can get clang-format by installing Clang for Windows:

You have to use clang-format 3.9 or otherwise the formatting will be inconsistent.

Re-run cmake in the build directory to make it will look for clang-format:

cmake .

To format, run this in the build directory:

make clang-format

Build and run on Windows

  • Use CMake GUI to generate a solution for your favorite version of Visual Studio.
  • Open the solution in Visual Studio as usual.
  • Run the tests project to check whether your changes work.