emperor-lang / emperor

Compiler for the emperor language

Home Page:https://emperor-lang.github.io/emperor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emperor

A statically typed, automatically-threaded, imperative language with purity and functional constructs.

Description

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.

Usage

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)

Installation & Dependencies

For complete installation from the source, this project requires the following:

  • arggen_haskell argument parser generator from argspec json files
  • ghc Glasgow Haskell Compiler
  • alex Haskell lexer generator
  • happy Haskell parser generator
  • patch the applicator of diff patches.
  • make the GNU tool for generating executables

The following are optional but may be useful development.

  • mangen an argspec to man-page generator
  • haddock 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.

Contributing

If you would like to contribute to the project, please take a look at the short guidelines here.

Code of Conduct

When interacting with this project, please adhere to the code of conduct found here.

License

This project is distributed under the GPL-v3.0 license.

Author

This project is primarily maintained by Edward Jones.

About

Compiler for the emperor language

https://emperor-lang.github.io/emperor

License:GNU General Public License v3.0


Languages

Language:Haskell 93.2%Language:Makefile 6.8%