A statically typed, automatically-threaded, imperative language with purity and functional constructs.
This is the compiler for the emperor
language which is designed to be run from the command-line.
The CLI of this project is specified in emperor.json
which conforms to argspec
.
The language itself is intended to have similarities to functional languages, including an expressive type-system. However, it is intended to allow the user to explicitly manipulate state with a notion of both pure and impure functions. It is possible to use local state within functions however global state and other side-effects may only be used from impure functions.
Dynamic scope is used for variables but static scoping is used for functions.
The emperor compiler may be called as follows.
emperor -i ./program.e -o ./program
Single programs may be translated in to C and compiled separately along with other C files as follows.
emperor -c -O3 -i ./program.e -o ./program.e.c
gcc $(emperor-setup --cflags) ... ./program.e.c ... $(emperor-setup --libs)
For complete installation from the source, this project requires the following:
arggen_haskell
argument parser generator fromargspec
json filesghc
Glasgow Haskell Compileralex
Haskell lexer generatorhappy
Haskell parser generatorpatch
the applicator ofdiff
patches.make
the GNU tool for generating executables
The following are optional but may be useful development.
mangen
anargspec
to man-page generatorhaddock
the haskell documentation generator- Haskell platform documentation
Once all of these have been installed, the emperor compiler may be installed from the source. This can be done as follows.
git clone https://github.com/emperor-lang/emperor.git
cd ./emperor/
make install
This will install emperor
at /usr/bin/emperor
, along its man
page.
For testing purposes, running just make
will produce a single binary.
If you would like to contribute to the project, please take a look at the short guidelines here.
When interacting with this project, please adhere to the code of conduct found here.
This project is distributed under the GPL-v3.0 license.
This project is primarily maintained by Edward Jones.