blazex
所属分类:编译器/解释器
开发工具:Rust
文件大小:84KB
下载次数:0
上传日期:2022-09-09 16:05:19
上 传 者:
sh-1993
说明: AOT编译的面向对象编程语言
(AOT compiled object oriented programming language)
文件列表:
.vscode (0, 2022-09-10)
.vscode\configurationCache.log (146, 2022-09-10)
.vscode\dryrun.log (888, 2022-09-10)
.vscode\launch.json (363, 2022-09-10)
.vscode\targets.log (8888, 2022-09-10)
Cargo.lock (15347, 2022-09-10)
Cargo.toml (435, 2022-09-10)
LICENSE (11357, 2022-09-10)
Makefile (1356, 2022-09-10)
crates (0, 2022-09-10)
crates\blazex (0, 2022-09-10)
crates\blazex\Cargo.toml (583, 2022-09-10)
crates\blazex\build.rs (1087, 2022-09-10)
crates\blazex\src (0, 2022-09-10)
crates\blazex\src\lib.rs (5515, 2022-09-10)
crates\blazex\src\main.rs (3681, 2022-09-10)
crates\blazex\src\test.rs (2603, 2022-09-10)
crates\blazex\stdlib (0, 2022-09-10)
crates\blazex\stdlib\file_system.c (755, 2022-09-10)
crates\blazex\stdlib\io.c (735, 2022-09-10)
crates\blazex\stdlib\os.c (496, 2022-09-10)
crates\blazex\stdlib\string.c (251, 2022-09-10)
crates\blazex\stdlib\test.c (115, 2022-09-10)
crates\bzxc_lexer (0, 2022-09-10)
crates\bzxc_lexer\Cargo.toml (264, 2022-09-10)
crates\bzxc_lexer\src (0, 2022-09-10)
crates\bzxc_lexer\src\lib.rs (9641, 2022-09-10)
crates\bzxc_lexer\src\literals.rs (3046, 2022-09-10)
crates\bzxc_lexer\src\logical.rs (2991, 2022-09-10)
crates\bzxc_llvm (0, 2022-09-10)
crates\bzxc_llvm\Cargo.toml (282, 2022-09-10)
crates\bzxc_llvm\src (0, 2022-09-10)
crates\bzxc_llvm\src\lib.rs (37054, 2022-09-10)
crates\bzxc_llvm\src\oop.rs (3509, 2022-09-10)
... ...
# [BlazeX](https://blazify.tech)
- [Discord](https://discord.gg/9bnpjqY)
- [Gitter](https://gitter.im/BlazifyOrg-blazex/community)
- [Blazify](https://blazify.tech)
An object orineted AOT compiled language which is gradual typed
## Installing
```shell
$ git clone https://github.com/BlazifyOrg/blazex.git
$ cd blazex
$ make
$ cd ..
# Set $HOME/.blazex to PATH
```
Confirm Installation
```shell
$ blazex
```
```
error: The following required arguments were not provided:
USAGE:
blazex [FLAGS] [OPTIONS]
For more information try --help
```
## Example
- Printing the famous "Hello World"
```bzx
extern variadic fun printf(string): int;
printf("Hello World!") @ yep as simple as that
```
- Comments
```bzx
@ single line comment
@@
multi-line comment
@@
```
- Creating and calling functions
```bzx
fun sum(a, b) {
var c = a + b;
return c;
}
println("%i", sum(2, 2));
```
- Working around with objects
```bzx
var obj = {
prop: 5 @ properties should be Identifier or there will be Invalid Syntax Error
}
println("%i", obj.prop); @ accessing object property
obj.prop = 10; @ editing object property value
println("%i", obj.prop) @ 10
```
- Classes
```bzx
class Main {
var a = 10; @ this is a property
@ this is constructor
fun() {
soul.a = 5; @ soul is the current object it's operating on
}
@ this is a method
fun sum_to_a(b) {
soul.a = soul.a + b;
return soul.a;
}
}
var ins = new Main(); @ creating/initializing a class, returns a object with the properties
println("%i", ins.sum_to_a(5));
```
## Dependencies
- llvm_sys (Interacting with LLVM)
- codespan-reporting (Errors)
- mimalloc (Memory allocation)
- structopt (Argument parsing)
- notify (Look for file changes)
## Contributing
- Fork the repository
- Create a branch with the patch/feature you want
- Make Changes to the code
- Commit the code (Use the [Emoji Commit Style](https://github.com/BlazifyOrg/pretty-commits)) and the message should **
NOT** contain the word "release"
- Finally, push the code and make a pull request
## Project Structure
| Crate | Description |
|:---------------------------------------------:|:--------------------------:|
| [blazex](crates/blazex) | The binary |
| [bzxc_lexer](crates/bzxc_lexer) | Lexer for Tokenizing |
| [bzxc_parser](crates/bzxc_parser) | Parser for AST Tree |
| [bzxc_type_system](crates/bzxc_type_system) | Type System |
| [bzxc_llvm](crates/bzxc_llvm) | LLVM IR Code Generation |
| [bzxc_shared](crates/bzxc_shared) | Things Shared among crates |
## TODO
- [x] Type System
- [x] LLVM
- [x] Errors
- [x] Lexer
- [x] Parser
- [ ] Type System
- [ ] LLVM
- [x] Reading from file
- [x] Lexer
- [x] Parser
- [x] AST
## Author
- [Ronit "RoMeAh" Rahaman](https://blazify.tech/team/)
近期下载者:
相关文件:
收藏者: