TsukiGva2 / pile

Concatenative, stack-based, statically typed and compiled programming language for computers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pile

Concatenative, stack-based, statically typed and compiled programming language for computers.

Python PyPy

NOTE: This language is not designed to be used in production. This project has educational purposes to teach stack-based architectures to students.


Development milestones

  • Make it (at least) a usable language
  • JIT Compiler
  • Implement all major operations
  • Control flow
  • Strings
  • Statically typed (implement a proper type checker)
  • Documentation
  • Make it turing complete

Quick start

WARNING: This is a project in VERY early stages of development. USE THIS LANGUAGE AT YOUR OWN RISK! Keep eyes on the next commits if you want to contribute. DISCLAIMER: On Windows systems, this project is more limited. I recommend using Unix/Linux!

Dependencies

To use this software, you need to install the dependencies by doing:

$ cd path/to/pile
$ python3 -m pip install -r requirements.txt

How to use

This language is not a proper language yet, but you already do some stuff with it:

Execute the code directly by the JIT compiler:

$ # To run main.py this way, do `chmod +x src/main.py`
$ src/main.py examples/hello.pl

Compile to executable and run the program prog.pl (only on Unix/Linux systems):

$ python3 src/main.py examples/hello.pl -c
... clang stuff ...
$ ./examples/hello

Show all tokens of given file:

$ python3 src/main.py examples/hello.pl -t
string `hello world` at file "examples/hello.pl", row 2 col 0
word `dump` at file "examples/hello.pl", row 2 col 14

Get the LLVM representation of prog.pl:

$ python3 src/main.py examples/hello.pl -e

Documentation

You can read the official documentation here


Powered by LLVM Compiler Infrastructure and llvmlite.

By Marcio Dantas

About

Concatenative, stack-based, statically typed and compiled programming language for computers.

License:MIT License


Languages

Language:Python 100.0%