blob: e4610938477b8fc46fb17d3c929be662722e0b0b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# Installation
As you have read these words, you are to install HALK.
```
$ sudo make install
```
If you wish to remove all HALK-related items from your life, you can try
```
$ sudo make uninstall
```
As of `82e7599`, HALK has been tested on both Linux and MacOS.
# Usage
One must simply
```
$ halk examples/simple.halk
```
. This will print out the token and AST representations of the given text. Running HALK
without an argument allows one to pass in text through stdin. An example session is transcribed
below:
```
$ halk
:int:n=42;
[==] HLKT: test passed: src/main.c/main/20
[==] source gotten
[==] source: :int:n=42;
[==] HLKT: test passed: src/main.c/main/26
[==] preprocessor created
[==] pre-processed source: :int:n=42;
[==] HLKT: test passed: src/main.c/main/36
[==] preprocessor ran
[==] HLKT: test passed: src/main.c/main/41
[==] HLKT: test passed: src/main.c/main/42
[==] lexer created
[==] token/t=9 /v=int
[==] token/t=9 /v=n
[==] token/t=4 /v==
[==] token/t=17 /v=42
[==] token/t=3 /v=;
[==] lexer ran
[block]
val:
[expression]
val:
[def]
tag:
[tag]
val:
int
nxt:
[tag]
val:
n
nxt:
NULL
arg:
NULL
val:
[expression]
val:
[lint]
val:
42
nxt:
NULL
```
# About
HALK is a **dubiously-typed**, **vaguely-functional**, **interpreted** programming language,
with syntax designed to be as **minimal** and **consistent** as possible. Note that all syntax
described is liable to sudden and violent change.
Example programs can be found in the examples directory.
## Progress
- [x] Preprocessor
- [x] Lexer
- [x] Abstract Syntax Tree
- [~] Parser
- [ ] Doer
- [ ] ?? profit ??
|