Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsingh93/lang
An imperative programming language written in Rust
https://github.com/gsingh93/lang
Last synced: 8 days ago
JSON representation
An imperative programming language written in Rust
- Host: GitHub
- URL: https://github.com/gsingh93/lang
- Owner: gsingh93
- Created: 2015-03-31T04:08:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-31T04:03:09.000Z (over 9 years ago)
- Last Synced: 2024-05-02T01:29:32.962Z (7 months ago)
- Language: Rust
- Size: 227 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lang (to be renamed)
`lang` is a C-like programming language designed for the purpose of learning about compiler construction. Examples can be found in the `examples` folder.
## Usage
```
$ cargo run -- -hUsage: target/debug/lang [options]
Options:
-h --help print this help menu
-t --type TYPE output type (llvm (default), asm, or obj)
-o --output FILE output file name
```Note that the compiler doesn't automatically link object files (yet), so after generating an object file with the `-t` flag, you can link by running `gcc` on the object file.
## Features
`lang` supports basic variable assignment, function calls, conditionals, loops, arithmetic, and relational operations. The three main types are `int` (a signed 32-bit integer), `string` (a null terminated string), and `bool`. `lang` also supports calling C functions as long as the necessary types are supported.
### In progress features
- Semantic analysis currently reports errors without reporting the location of the error, this will be fixed
- Add floating point and unsigned integer types of different widths
- Allow function definitions in any order
- Scope (currently everything inside a function is in the same scope)
- Arrays
- For loops (only while loops are supported at the moment)
- Allow parenthesis in expressions### Long term features
- Dynamic memory
- Optional garbage collections
- Algebraic data types and pattern matching