auralang 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- auralang-0.1.0/LICENSE +21 -0
- auralang-0.1.0/PKG-INFO +265 -0
- auralang-0.1.0/README.md +216 -0
- auralang-0.1.0/aura.py +3821 -0
- auralang-0.1.0/auralang.egg-info/PKG-INFO +265 -0
- auralang-0.1.0/auralang.egg-info/SOURCES.txt +42 -0
- auralang-0.1.0/auralang.egg-info/dependency_links.txt +1 -0
- auralang-0.1.0/auralang.egg-info/entry_points.txt +2 -0
- auralang-0.1.0/auralang.egg-info/requires.txt +3 -0
- auralang-0.1.0/auralang.egg-info/top_level.txt +1 -0
- auralang-0.1.0/pyproject.toml +48 -0
- auralang-0.1.0/setup.cfg +4 -0
- auralang-0.1.0/tests/test_assignment_and_iteration.py +121 -0
- auralang-0.1.0/tests/test_bags.py +149 -0
- auralang-0.1.0/tests/test_cli.py +53 -0
- auralang-0.1.0/tests/test_control_flow.py +116 -0
- auralang-0.1.0/tests/test_destructuring.py +127 -0
- auralang-0.1.0/tests/test_diagnostics.py +73 -0
- auralang-0.1.0/tests/test_doc_accuracy.py +101 -0
- auralang-0.1.0/tests/test_docs.py +71 -0
- auralang-0.1.0/tests/test_dot_access.py +102 -0
- auralang-0.1.0/tests/test_editor_grammar.py +88 -0
- auralang-0.1.0/tests/test_error_display.py +97 -0
- auralang-0.1.0/tests/test_error_kinds.py +111 -0
- auralang-0.1.0/tests/test_errors.py +67 -0
- auralang-0.1.0/tests/test_examples.py +120 -0
- auralang-0.1.0/tests/test_files_and_process.py +206 -0
- auralang-0.1.0/tests/test_ghosted.py +155 -0
- auralang-0.1.0/tests/test_higher_order.py +175 -0
- auralang-0.1.0/tests/test_interpolation.py +135 -0
- auralang-0.1.0/tests/test_interpreter.py +143 -0
- auralang-0.1.0/tests/test_lexer.py +66 -0
- auralang-0.1.0/tests/test_logic.py +117 -0
- auralang-0.1.0/tests/test_packaging.py +80 -0
- auralang-0.1.0/tests/test_parser.py +43 -0
- auralang-0.1.0/tests/test_python_compat.py +41 -0
- auralang-0.1.0/tests/test_repl.py +134 -0
- auralang-0.1.0/tests/test_robustness.py +81 -0
- auralang-0.1.0/tests/test_scoping.py +84 -0
- auralang-0.1.0/tests/test_stdlib.py +187 -0
- auralang-0.1.0/tests/test_summon_and_cli.py +158 -0
- auralang-0.1.0/tests/test_sus.py +118 -0
- auralang-0.1.0/tests/test_text_tools.py +261 -0
- auralang-0.1.0/tests/test_values.py +222 -0
auralang-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 iam-kira (Vijay Biradar)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
auralang-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: auralang
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A small interpreted language with deliberately terrible keywords
|
|
5
|
+
Author: Vijay Biradar
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 iam-kira (Vijay Biradar)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/iam-kira/what-did-i-do
|
|
29
|
+
Project-URL: Source, https://github.com/iam-kira/what-did-i-do
|
|
30
|
+
Project-URL: Issues, https://github.com/iam-kira/what-did-i-do/issues
|
|
31
|
+
Keywords: language,interpreter,toy-language,repl,parser
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Software Development :: Interpreters
|
|
42
|
+
Classifier: Topic :: Education
|
|
43
|
+
Requires-Python: >=3.9
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Provides-Extra: dev
|
|
47
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# aura
|
|
51
|
+
|
|
52
|
+
[](https://github.com/iam-kira/what-did-i-do/actions/workflows/tests.yml)
|
|
53
|
+
[](https://www.python.org/)
|
|
54
|
+
[](LICENSE)
|
|
55
|
+
[](https://github.com/iam-kira/what-did-i-do/stargazers)
|
|
56
|
+
|
|
57
|
+
**A programming language with a serious name and no seriousness whatsoever.**
|
|
58
|
+
|
|
59
|
+
Written in Python from scratch — lexer, parser, tree-walking interpreter, zero
|
|
60
|
+
dependencies. It has closures, dictionaries, string interpolation, error
|
|
61
|
+
handling and a 42-function standard library.
|
|
62
|
+
|
|
63
|
+
It also does not contain a single normal keyword.
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
chore label(n) ong
|
|
67
|
+
fr n % 15 == 0 ong
|
|
68
|
+
yeet "fizzbuzz"
|
|
69
|
+
orfr n % 3 == 0 ong
|
|
70
|
+
yeet "fizz"
|
|
71
|
+
orfr n % 5 == 0 ong
|
|
72
|
+
yeet "buzz"
|
|
73
|
+
bet
|
|
74
|
+
yeet yapify(n)
|
|
75
|
+
bet
|
|
76
|
+
|
|
77
|
+
grind i = 1 til 16 ong
|
|
78
|
+
cook(label(i))
|
|
79
|
+
bet
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`ong` opens a block and `bet` closes it. `chore` defines a function, `yeet`
|
|
83
|
+
returns, `stash` declares, `cook` prints. That is the entire joke, and it is
|
|
84
|
+
load-bearing.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Try it in thirty seconds
|
|
89
|
+
|
|
90
|
+
Python 3.9 or newer. Nothing else to install.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install auralang
|
|
94
|
+
aura
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Or straight from the source, with nothing installed at all:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git clone https://github.com/iam-kira/what-did-i-do
|
|
101
|
+
cd what-did-i-do
|
|
102
|
+
python aura.py
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
That opens the REPL, and it reads multi-line blocks:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
shell :> stash xs = [1, 2, 3]
|
|
109
|
+
[1, 2, 3]
|
|
110
|
+
|
|
111
|
+
shell :> xs[-1] * 10
|
|
112
|
+
30
|
|
113
|
+
|
|
114
|
+
shell :> chore sq(n) ong
|
|
115
|
+
... > yeet n ^ 2
|
|
116
|
+
... > bet
|
|
117
|
+
<chore sq>
|
|
118
|
+
|
|
119
|
+
shell :> sq(9)
|
|
120
|
+
81
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or run a file:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python aura.py example.aura # a tour of the language
|
|
127
|
+
python aura.py prog.aura a b # a and b arrive in handed()
|
|
128
|
+
python aura.py --ast prog.aura # show the parse tree
|
|
129
|
+
python aura.py --help
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## What it can actually do
|
|
135
|
+
|
|
136
|
+
Not a calculator with silly words. A real small language:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
# closures, and state that outlives the call
|
|
140
|
+
chore counter() ong
|
|
141
|
+
stash n = 0
|
|
142
|
+
chore tick() ong
|
|
143
|
+
n += 1
|
|
144
|
+
yeet n
|
|
145
|
+
bet
|
|
146
|
+
yeet tick
|
|
147
|
+
bet
|
|
148
|
+
|
|
149
|
+
stash next = counter()
|
|
150
|
+
cook("{next()} then {next()}")
|
|
151
|
+
|
|
152
|
+
# bags, dot access, and yap holes
|
|
153
|
+
stash player = {"name": "ana", "score": 0}
|
|
154
|
+
player.score += 10
|
|
155
|
+
cook("{player.name} is on {player.score}")
|
|
156
|
+
|
|
157
|
+
# errors you can catch and branch on
|
|
158
|
+
sus ong
|
|
159
|
+
stash text = slurp("notes.txt")
|
|
160
|
+
whoops e ong
|
|
161
|
+
fr e.kind == "file" ong
|
|
162
|
+
cook("no notes yet, carrying on")
|
|
163
|
+
bet
|
|
164
|
+
bet
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
| | |
|
|
168
|
+
|---|---|
|
|
169
|
+
| **Types** | numbers (`math`), strings (`yap`), lists (`pile`), dicts (`bag`), first-class functions (`chore`) |
|
|
170
|
+
| **Control flow** | `fr`/`orfr`/`whatever`, `keep`, `grind ... til`, `grind ... among`, `bail`, `skip`, `yeet` |
|
|
171
|
+
| **Scoping** | lexical, with real closures and outer-variable mutation |
|
|
172
|
+
| **Yap holes** | `"hi {name}, {1 + 2} points"` |
|
|
173
|
+
| **Destructuring** | `stash a, b = [1, 2]`, `grind k, v among bag` |
|
|
174
|
+
| **Errors** | `sus` / `whoops` / `oops`, a `kind` on every error, tracebacks, and a caret under the offending code |
|
|
175
|
+
| **Higher-order** | `eachof`, `keepif`, `smoosh`, `sortof` with a key chore |
|
|
176
|
+
| **Scriptable** | `handed()` for arguments, `slurp`/`spill` for files, `rummage` for folders, `bounce(code)` for exit status |
|
|
177
|
+
| **Imports** | `summon("lib.aura")`, with cycle detection |
|
|
178
|
+
|
|
179
|
+
When something breaks, it tells you exactly where:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
Runtime Error: 'nope' is not defined
|
|
183
|
+
File prog.aura, line 3, col 14
|
|
184
|
+
total += nope
|
|
185
|
+
^^^^
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Read it
|
|
191
|
+
|
|
192
|
+
| | |
|
|
193
|
+
|---|---|
|
|
194
|
+
| **[docs/BOOK.md](docs/BOOK.md)** | **The book** — the whole language, then the whole interpreter, in the order you would learn them. Start here. |
|
|
195
|
+
| [docs/LANGUAGE.md](docs/LANGUAGE.md) | Quick reference — vocabulary, operators, builtins, errors |
|
|
196
|
+
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | How the interpreter works, and where to add things |
|
|
197
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Setup, workflow, and what needs doing |
|
|
198
|
+
| [editors/](editors/) | VS Code syntax highlighting for `.aura` files |
|
|
199
|
+
|
|
200
|
+
**Programs written in aura:** [example.aura](example.aura) tours the language,
|
|
201
|
+
[examples/calc.aura](examples/calc.aura) is a calculator with its own tokeniser
|
|
202
|
+
and precedence-climbing parser, [examples/wc.aura](examples/wc.aura) is a word
|
|
203
|
+
counter that walks folders, and [examples/json.aura](examples/json.aura) is a
|
|
204
|
+
JSON parser — closures hold the read position, `sus` handles bad input, and
|
|
205
|
+
JSON `null` arrives as `ghosted`.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Why "aura"
|
|
210
|
+
|
|
211
|
+
Every keyword in the language is a joke. The name is the straight man — it
|
|
212
|
+
lets the contents be the punchline, and it will still read fine when the slang
|
|
213
|
+
has moved on.
|
|
214
|
+
|
|
215
|
+
The repo is called `what-did-i-do` for the same reason.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Under the hood
|
|
220
|
+
|
|
221
|
+
One file, 3,600 lines, no dependencies. `Lexer` → `Parser` → `Interpreter`,
|
|
222
|
+
readable top to bottom.
|
|
223
|
+
|
|
224
|
+
Errors are values, never exceptions: every stage returns a `(result, error)`
|
|
225
|
+
pair carrying a source position, which is why a runtime failure can print the
|
|
226
|
+
line it happened on.
|
|
227
|
+
|
|
228
|
+
**500 tests**, including a fuzz sweep asserting no input ever escapes as a
|
|
229
|
+
Python traceback, a checker that executes every code snippet in these docs, and
|
|
230
|
+
a test that diffs the syntax highlighting against the real keyword list.
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
python -m venv .venv
|
|
234
|
+
.venv/Scripts/activate # Windows; use source .venv/bin/activate elsewhere
|
|
235
|
+
pip install pytest
|
|
236
|
+
python -m pytest -q
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Running aura needs nothing installed. The venv is only for `pytest`.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Status
|
|
244
|
+
|
|
245
|
+
Works. Not finished — no type system, and no concern for speed. Rough edges are
|
|
246
|
+
listed at the end of [docs/LANGUAGE.md](docs/LANGUAGE.md) and in
|
|
247
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Credit and licence
|
|
252
|
+
|
|
253
|
+
aura was created by **Vijay Biradar** ([iam-kira](https://github.com/iam-kira)).
|
|
254
|
+
|
|
255
|
+
Released under the [MIT Licence](LICENSE), which lets anyone use, modify and
|
|
256
|
+
sell it — including inside closed-source products — on one condition:
|
|
257
|
+
|
|
258
|
+
> The above copyright notice and this permission notice shall be included in
|
|
259
|
+
> all copies or substantial portions of the Software.
|
|
260
|
+
|
|
261
|
+
So if you ship aura, or anything substantially built from it, the copyright
|
|
262
|
+
notice comes with it. That is not optional, and it applies to commercial use
|
|
263
|
+
too.
|
|
264
|
+
|
|
265
|
+
Contributions are accepted under the same licence.
|
auralang-0.1.0/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# aura
|
|
2
|
+
|
|
3
|
+
[](https://github.com/iam-kira/what-did-i-do/actions/workflows/tests.yml)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://github.com/iam-kira/what-did-i-do/stargazers)
|
|
7
|
+
|
|
8
|
+
**A programming language with a serious name and no seriousness whatsoever.**
|
|
9
|
+
|
|
10
|
+
Written in Python from scratch — lexer, parser, tree-walking interpreter, zero
|
|
11
|
+
dependencies. It has closures, dictionaries, string interpolation, error
|
|
12
|
+
handling and a 42-function standard library.
|
|
13
|
+
|
|
14
|
+
It also does not contain a single normal keyword.
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
chore label(n) ong
|
|
18
|
+
fr n % 15 == 0 ong
|
|
19
|
+
yeet "fizzbuzz"
|
|
20
|
+
orfr n % 3 == 0 ong
|
|
21
|
+
yeet "fizz"
|
|
22
|
+
orfr n % 5 == 0 ong
|
|
23
|
+
yeet "buzz"
|
|
24
|
+
bet
|
|
25
|
+
yeet yapify(n)
|
|
26
|
+
bet
|
|
27
|
+
|
|
28
|
+
grind i = 1 til 16 ong
|
|
29
|
+
cook(label(i))
|
|
30
|
+
bet
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ong` opens a block and `bet` closes it. `chore` defines a function, `yeet`
|
|
34
|
+
returns, `stash` declares, `cook` prints. That is the entire joke, and it is
|
|
35
|
+
load-bearing.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Try it in thirty seconds
|
|
40
|
+
|
|
41
|
+
Python 3.9 or newer. Nothing else to install.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install auralang
|
|
45
|
+
aura
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or straight from the source, with nothing installed at all:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/iam-kira/what-did-i-do
|
|
52
|
+
cd what-did-i-do
|
|
53
|
+
python aura.py
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
That opens the REPL, and it reads multi-line blocks:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
shell :> stash xs = [1, 2, 3]
|
|
60
|
+
[1, 2, 3]
|
|
61
|
+
|
|
62
|
+
shell :> xs[-1] * 10
|
|
63
|
+
30
|
|
64
|
+
|
|
65
|
+
shell :> chore sq(n) ong
|
|
66
|
+
... > yeet n ^ 2
|
|
67
|
+
... > bet
|
|
68
|
+
<chore sq>
|
|
69
|
+
|
|
70
|
+
shell :> sq(9)
|
|
71
|
+
81
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or run a file:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
python aura.py example.aura # a tour of the language
|
|
78
|
+
python aura.py prog.aura a b # a and b arrive in handed()
|
|
79
|
+
python aura.py --ast prog.aura # show the parse tree
|
|
80
|
+
python aura.py --help
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## What it can actually do
|
|
86
|
+
|
|
87
|
+
Not a calculator with silly words. A real small language:
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
# closures, and state that outlives the call
|
|
91
|
+
chore counter() ong
|
|
92
|
+
stash n = 0
|
|
93
|
+
chore tick() ong
|
|
94
|
+
n += 1
|
|
95
|
+
yeet n
|
|
96
|
+
bet
|
|
97
|
+
yeet tick
|
|
98
|
+
bet
|
|
99
|
+
|
|
100
|
+
stash next = counter()
|
|
101
|
+
cook("{next()} then {next()}")
|
|
102
|
+
|
|
103
|
+
# bags, dot access, and yap holes
|
|
104
|
+
stash player = {"name": "ana", "score": 0}
|
|
105
|
+
player.score += 10
|
|
106
|
+
cook("{player.name} is on {player.score}")
|
|
107
|
+
|
|
108
|
+
# errors you can catch and branch on
|
|
109
|
+
sus ong
|
|
110
|
+
stash text = slurp("notes.txt")
|
|
111
|
+
whoops e ong
|
|
112
|
+
fr e.kind == "file" ong
|
|
113
|
+
cook("no notes yet, carrying on")
|
|
114
|
+
bet
|
|
115
|
+
bet
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| | |
|
|
119
|
+
|---|---|
|
|
120
|
+
| **Types** | numbers (`math`), strings (`yap`), lists (`pile`), dicts (`bag`), first-class functions (`chore`) |
|
|
121
|
+
| **Control flow** | `fr`/`orfr`/`whatever`, `keep`, `grind ... til`, `grind ... among`, `bail`, `skip`, `yeet` |
|
|
122
|
+
| **Scoping** | lexical, with real closures and outer-variable mutation |
|
|
123
|
+
| **Yap holes** | `"hi {name}, {1 + 2} points"` |
|
|
124
|
+
| **Destructuring** | `stash a, b = [1, 2]`, `grind k, v among bag` |
|
|
125
|
+
| **Errors** | `sus` / `whoops` / `oops`, a `kind` on every error, tracebacks, and a caret under the offending code |
|
|
126
|
+
| **Higher-order** | `eachof`, `keepif`, `smoosh`, `sortof` with a key chore |
|
|
127
|
+
| **Scriptable** | `handed()` for arguments, `slurp`/`spill` for files, `rummage` for folders, `bounce(code)` for exit status |
|
|
128
|
+
| **Imports** | `summon("lib.aura")`, with cycle detection |
|
|
129
|
+
|
|
130
|
+
When something breaks, it tells you exactly where:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Runtime Error: 'nope' is not defined
|
|
134
|
+
File prog.aura, line 3, col 14
|
|
135
|
+
total += nope
|
|
136
|
+
^^^^
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Read it
|
|
142
|
+
|
|
143
|
+
| | |
|
|
144
|
+
|---|---|
|
|
145
|
+
| **[docs/BOOK.md](docs/BOOK.md)** | **The book** — the whole language, then the whole interpreter, in the order you would learn them. Start here. |
|
|
146
|
+
| [docs/LANGUAGE.md](docs/LANGUAGE.md) | Quick reference — vocabulary, operators, builtins, errors |
|
|
147
|
+
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | How the interpreter works, and where to add things |
|
|
148
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Setup, workflow, and what needs doing |
|
|
149
|
+
| [editors/](editors/) | VS Code syntax highlighting for `.aura` files |
|
|
150
|
+
|
|
151
|
+
**Programs written in aura:** [example.aura](example.aura) tours the language,
|
|
152
|
+
[examples/calc.aura](examples/calc.aura) is a calculator with its own tokeniser
|
|
153
|
+
and precedence-climbing parser, [examples/wc.aura](examples/wc.aura) is a word
|
|
154
|
+
counter that walks folders, and [examples/json.aura](examples/json.aura) is a
|
|
155
|
+
JSON parser — closures hold the read position, `sus` handles bad input, and
|
|
156
|
+
JSON `null` arrives as `ghosted`.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Why "aura"
|
|
161
|
+
|
|
162
|
+
Every keyword in the language is a joke. The name is the straight man — it
|
|
163
|
+
lets the contents be the punchline, and it will still read fine when the slang
|
|
164
|
+
has moved on.
|
|
165
|
+
|
|
166
|
+
The repo is called `what-did-i-do` for the same reason.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Under the hood
|
|
171
|
+
|
|
172
|
+
One file, 3,600 lines, no dependencies. `Lexer` → `Parser` → `Interpreter`,
|
|
173
|
+
readable top to bottom.
|
|
174
|
+
|
|
175
|
+
Errors are values, never exceptions: every stage returns a `(result, error)`
|
|
176
|
+
pair carrying a source position, which is why a runtime failure can print the
|
|
177
|
+
line it happened on.
|
|
178
|
+
|
|
179
|
+
**500 tests**, including a fuzz sweep asserting no input ever escapes as a
|
|
180
|
+
Python traceback, a checker that executes every code snippet in these docs, and
|
|
181
|
+
a test that diffs the syntax highlighting against the real keyword list.
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
python -m venv .venv
|
|
185
|
+
.venv/Scripts/activate # Windows; use source .venv/bin/activate elsewhere
|
|
186
|
+
pip install pytest
|
|
187
|
+
python -m pytest -q
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Running aura needs nothing installed. The venv is only for `pytest`.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Status
|
|
195
|
+
|
|
196
|
+
Works. Not finished — no type system, and no concern for speed. Rough edges are
|
|
197
|
+
listed at the end of [docs/LANGUAGE.md](docs/LANGUAGE.md) and in
|
|
198
|
+
[CONTRIBUTING.md](CONTRIBUTING.md).
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Credit and licence
|
|
203
|
+
|
|
204
|
+
aura was created by **Vijay Biradar** ([iam-kira](https://github.com/iam-kira)).
|
|
205
|
+
|
|
206
|
+
Released under the [MIT Licence](LICENSE), which lets anyone use, modify and
|
|
207
|
+
sell it — including inside closed-source products — on one condition:
|
|
208
|
+
|
|
209
|
+
> The above copyright notice and this permission notice shall be included in
|
|
210
|
+
> all copies or substantial portions of the Software.
|
|
211
|
+
|
|
212
|
+
So if you ship aura, or anything substantially built from it, the copyright
|
|
213
|
+
notice comes with it. That is not optional, and it applies to commercial use
|
|
214
|
+
too.
|
|
215
|
+
|
|
216
|
+
Contributions are accepted under the same licence.
|