https://github.com/stewartpark/palang
A toy compiled language
https://github.com/stewartpark/palang
Last synced: 2 months ago
JSON representation
A toy compiled language
- Host: GitHub
- URL: https://github.com/stewartpark/palang
- Owner: stewartpark
- Created: 2015-09-20T16:26:18.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T12:04:49.000Z (over 9 years ago)
- Last Synced: 2025-03-24T22:30:33.058Z (3 months ago)
- Language: Python
- Size: 1.8 MB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pa Language
===========
Pa Language is a toy compiled language written in Python, C++11.
Currently, the only working implentation of Pa is Pypac, which is in the current git repository. The official Pa compiler will be reimplemented in Pa once the specification of the language is finished and polished up.

### Work done so far
- Initial implementation that is written in Python to bootstrap the language.
- A few intrinsic funtions(print, input, len, range)
- Binary level interface to import/export
- Several libraries to make the language a bit more useful at this stage
- tcp: TCP socket library
- file: File I/O
- import/export statements
- Basic control flow statements: if, for, while, return(=)
- Basic variable/function definition
- Inline function definition(lambda)
- Inline variable definition(lambda that gets executed right away)
- Class/Instance (constructor, destructor, methods, properties, operator overloading)
- -> operators(list -> func)
- Garbage collector (Boehm GC)
- Exception handling### Future work
- Unimplemented operators (to different types)
- Network/file I/O library that is based on libuv
- the &, !, ? operators### Installation
Just type the below:
```
$ git clone https://github.com/stewartpark/palang
$ cd palang
$ pip install -r requirements.txt
$ sudo apt-get install build-essential g++-4.9 libgc-dev
$ ./build_libs.sh
```### Examples
- PAW (example web framework)
- [app.pa](https://github.com/stewartpark/palang/blob/master/examples/paw/app.pa)
- [paw.pa](https://github.com/stewartpark/palang/blob/master/examples/paw/libs/paw.pa)
- libsample (example library)
- [libsample.pa](https://github.com/stewartpark/palang/blob/master/examples/libsample.pa)
- [import_test.pa](https://github.com/stewartpark/palang/blob/master/examples/import_test.pa)
- [tcp_http_test.pa](https://github.com/stewartpark/palang/blob/master/examples/tcp_http_test.pa)
- [read_file.pa](https://github.com/stewartpark/palang/blob/master/examples/read_file.pa)
- [string_test.pa](https://github.com/stewartpark/palang/blob/master/examples/string_test.pa)
- [class_test.pa](https://github.com/stewartpark/palang/blob/master/examples/class_test.pa)
- [map_test.pa](https://github.com/stewartpark/palang/blob/master/examples/map_test.pa)
- [test.pa](https://github.com/stewartpark/palang/blob/master/examples/test.pa)