Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scriptlinestudios/chai
Compiler for the Chai programming language.
https://github.com/scriptlinestudios/chai
compiler programming-language
Last synced: about 1 month ago
JSON representation
Compiler for the Chai programming language.
- Host: GitHub
- URL: https://github.com/scriptlinestudios/chai
- Owner: ScriptLineStudios
- Created: 2022-10-14T13:00:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-29T18:53:09.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T01:57:24.668Z (almost 2 years ago)
- Topics: compiler, programming-language
- Language: C
- Homepage:
- Size: 1.1 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chai
## Currently being rewritten here: https://github.com/ScriptLineStudios/Chai/tree/complete-rewriteCompiler for the Chai programming language.
Chai is a fast, compiled dynamically typed language.# Compilation Targets
## In Development
- Intel x86_64 Linux - Being implemented by ScriptLine
- Intel x86_64 Windows - Being implmented by MousieDev## Planned
- WASM# Getting Started
```
1. git clone https://github.com/ScriptLineStudios/Untitled-Compiler
2. make
3. ./bin/comp.exe examples/strings.uc
```# Language Reference
## Variables
```rust
let int_var = 10;
let string_var = "Hello World";
```## Printing to standard output
```rust
let var = "Hello, World!";
stdout(var);
```## If statements
```rust
let x = 7;
if (x != 8) {
stdout(90);
}
```## While loops
```rust
let foo = 0;
while (foo != 100) {
stdout(foo);
foo = foo + 1;
}
```## Lists
```rust
let lst = [1, 2, 3, 4, 5];
let i = 0;
while (i != 5) {
stdout(lst[i]);
i = i + 1;
}
```## Functions
```rust
func foo(bar) {
if (bar != 200) {
stdout("The value of bar is not 200!");
}
}foo(201);
```