Skip to content

Commit 251290d

Browse files
committed
Expanded README.md
1 parent fe44a3c commit 251290d

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
# kLang
2-
A better language than kerboscript for kOS
2+
---
3+
4+
kerboscript was once the only language for kOS. Then, with kRISC came `.ksm`. Now its time to make `.ksm` a compile target with kLang.
5+
6+
This goal of this project is to replace kerboscript with an actual (somewhat) modern programming language, while adhering to a subset of kRISC to be able to make it an actual **REDUCED** Instruct Set Computer.
7+
8+
## Syntax
9+
Here is some mock kLang code:
10+
11+
```kLang
12+
const ZERO: i32 = 0i32;
13+
14+
type MY_STRUCT: struct {
15+
name: str,
16+
index: i32
17+
};
18+
19+
func main: (vessel: Vessel /* Vessel holds vessel data */) -> () {
20+
let mut hi_text: str = "hi world?";
21+
hi_text = "Hello World!";
22+
if ?hi_text { // Not worth printing if its empty
23+
print(hi_text);
24+
}
25+
}
26+
```

0 commit comments

Comments
 (0)