@@ -19,13 +19,13 @@ instructions for your device below:
19
19
- Download the binary:
20
20
21
21
```
22
- curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.1.5 /nuru_linux_amd64_v0.1.5 .tar.gz
22
+ curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.2.0 /nuru_linux_amd64_v0.2.0 .tar.gz
23
23
```
24
24
25
25
- Extract the file to make global available:
26
26
27
27
```
28
- sudo tar -C /usr/local/bin -xzvf nuru_linux_amd64_v0.1.5 .tar.gz
28
+ sudo tar -C /usr/local/bin -xzvf nuru_linux_amd64_v0.2.0 .tar.gz
29
29
```
30
30
31
31
- Confirm installation with:
@@ -40,12 +40,12 @@ nuru -v
40
40
- Download the binary with this command:
41
41
42
42
```
43
- curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.1.5 /nuru_android_arm64_v0.1.5 .tar.gz
43
+ curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.2.0 /nuru_android_arm64_v0.2.0 .tar.gz
44
44
```
45
45
- Extract the file:
46
46
47
47
```
48
- tar -xzvf nuru_android_arm64_v0.1.5 .tar.gz
48
+ tar -xzvf nuru_android_arm64_v0.2.0 .tar.gz
49
49
```
50
50
- Add it to path:
51
51
@@ -65,8 +65,8 @@ nuru -v
65
65
```
66
66
mkdir C:\bin
67
67
```
68
- - Download the Nuru Program [ Here] ( https://github.com/AvicennaJr/Nuru/releases/download/v0.1.5 /nuru_windows_amd64_v0.1.5 .exe )
69
- - Rename the downloaded program from ` nuru_windows_amd64_v0.1.5 .exe ` to ` nuru.exe `
68
+ - Download the Nuru Program [ Here] ( https://github.com/AvicennaJr/Nuru/releases/download/v0.2.0 /nuru_windows_amd64_v0.2.0 .exe )
69
+ - Rename the downloaded program from ` nuru_windows_amd64_v0.2.0 .exe ` to ` nuru.exe `
70
70
- Move the file ` nuru.exe ` to the folder ` C:\bin `
71
71
- Add the bin folder to Path with this command:
72
72
@@ -96,6 +96,9 @@ nuru -v
96
96
97
97
## Syntax
98
98
99
+ ** NOTE**
100
+ > There is a more detailed documentation of the language [ here] ( https://github.com/AvicennaJr/NuruDocs ) .
101
+
99
102
Nuru, although still in its early stage, intends to be a fully functional programming language, and thus it has been baked with many features.
100
103
101
104
### Defining A Variable
@@ -152,9 +155,11 @@ Type | Syntax | Comments
152
155
--------- | ----------------------------------------- | -----------------------
153
156
BOOL | ` kweli sikweli ` | kweli == true, sikweli == false
154
157
INT | ` 1, 100, 342, -4 ` | These are signed 64 bit integers
155
- STRING | ` "" "mambo" "habari yako" ` | They MUST be in DOUBLE QUOTES ` " `
156
- ARRAY | ` [] [1, 2, 3] [1, "moja", kweli] ` | Arrays can hold any types
158
+ FLOAT | ` 2.3, 4.5. 100.8094 ` | Signed 64 bit floats
159
+ STRING | ` "" "mambo" "habari yako" ` | They can be in double ` " ` or single ` ' ` quotes
160
+ ARRAY | ` [] [1, 2, 3] [1, "moja", kweli] ` | Arrays can hold any types
157
161
DICT | ` {} {"a": 3, 1: "moja", kweli: 2} ` | Keys can be int, string or bool. Values can be anything
162
+ NULL | ` tupu ` | These are nil objects
158
163
159
164
### Functions
160
165
@@ -205,7 +210,7 @@ fanya i = 10
205
210
206
211
wakati (i > 0) {
207
212
andika(i)
208
- i = i - 1
213
+ i--
209
214
}
210
215
```
211
216
@@ -270,6 +275,15 @@ mtu = mtu + kazi
270
275
andika(mtu) // output = {"jina": "Avicenna", "kabila": "Mnyakusa", "anapoishi": "Dar Es Salaam", "kazi": "jambazi"}
271
276
```
272
277
278
+ ### For Loops
279
+
280
+ These can iterate over strings, arrays and dictionaries:
281
+ ```
282
+ kwa i ktk "habari" {
283
+ andika(i)
284
+ }
285
+ ```
286
+
273
287
### Getting Input From User
274
288
275
289
In Nuru you can get input from users using the ` jaza() ` keyword as follows:
@@ -297,7 +311,7 @@ Kindly Note that everything should be placed in a single line. Here's an example
297
311
```
298
312
### Running From File
299
313
300
- To run a Nuru script, write the ` nuru ` command followed by the name of the file with a ` .nr ` extension:
314
+ To run a Nuru script, write the ` nuru ` command followed by the name of the file with a ` .nr ` or ` .sw ` extension:
301
315
302
316
```
303
317
nuru myFile.nr
0 commit comments