Level is a novel compiled programming language being developed by Michał Stanisław Wójcik. The ambition is to create fast (compiled to machine code) language convenient for scientific programming. Note that Level is under very dynamic development and is not ready for use yet. This is an early access repository and you are strongly disencouraged to begin any serious project in Level yet.
- compiles to ELF64 executable under Linux based OS on x86-64 architecture
- supports simple machine code optimisation
- statically typed
- basic types: int, byte, bool, i64, i32, u64, u32, float
- user defined types as combination of ref (pointer/reference type), rec (struct type) and array (array type)
- templates for subroutines and types with second order type variables
- functions and operators overloading
- support for object-oriented programming:
- dot notation
- special method definition syntax
- multiple inheritance
- reference count garbage collection for manged objects (must derive from object)
- standard library supports:
- basic data structures: stack, vector, ascii and utf-8 strings
- basic files operations (e.g. open, close, write, read)
- arbitrary-precision integer arithmetic (FEATURE IN PROGRESS)
- Level compiler source code is written in Python 3 using purposely ONLY Python's standard library. Compiler doesn't use any external libraries like binutils or glibc. All assembly is coded purely in Python's standard library.
- Python 3.6.0 or higher with installed pip is the only requirement to install and run Level compiler on Linux OS with x86-64 architecture.
- There are no other 3rd party dependencies needed for Level compiler.
- At the current phase of development, Level supports only x86-64 architecture with Linux based OS.
- There is no Level documentation yet, so the best reference so far is the source code, especially files with Level code in examples (for expected results study level/install/test.py) .
- Level compiler source code in this early access phase is published under very restrictive Level Licence, which allows only non-commercial use of Level for private persons. At this phase the project also does not seek community contributions, hence very restrictive contributions section D of the Level Licence. Please read very carefully section D of the Level Licence before you attempt to contribute to the project. After the project will become more mature a proper licence will be worked out.
- x86-64 architecture with Linux based OS
- installed Python 3.6.0 or higher with pip
You may obtain Level compiler source code from the official repository using git:
git clone git@github.com:warpdynamicsltd/level.git
To install Level compiler, go to the root directory of this project.
Assuming you are still where you ran git clone you can go there by
cd level
and run the following command in your terminal:
./install.sh
If you want any change in the Level compiler source code (e.g. after next git clone) to be immediately available
and/or want to have level\test_include imported
(some files in level\examples will not compile without it),
you should choose ./dev_install.sh
instead.
Test if your installation is successful by executing the following command:
level test
If installation is successful, you should be able to see something similar to the text below in your terminal.
Level Compiler v0.3.2a
Copyright (c) 2022 Michal Stanislaw Wojcik. All rights reserved.
..........................................................................................................................
Done in 5.13 s
All tests OK
To compile a text file hello.lvl with Level code, run the following command
in your terminal:
level c hello.lvl
The above should create an ELF64 executable hello which
can be executed e.g.
by typing ./hello in your terminal and pressing enter.
A short manual for level command line tool is available after running:
level --help
Also each subcommand of level can be explained by:
level <subcommand> --help