Skip to content

Commit 2e55c0c

Browse files
authored
Merge pull request #90 from NuruProgramming/update-readme
chore: update readme.md
2 parents 0cf4fb7 + 241143a commit 2e55c0c

File tree

1 file changed

+66
-44
lines changed

1 file changed

+66
-44
lines changed

README.md

+66-44
Original file line numberDiff line numberDiff line change
@@ -18,90 +18,94 @@ To get started download the executables from the release page or follow the inst
1818

1919
### Linux
2020

21-
- Download the binary:
21+
- Download the binary:
2222

2323
```
2424
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Linux_amd64.tar.gz
2525
```
2626

27-
- Extract the file to make global available:
27+
- Extract the file to make global available:
2828

2929
```
3030
sudo tar -C /usr/local/bin -xzvf nuru_Linux_amd64.tar.gz
3131
```
3232

33-
- Confirm installation with:
33+
- Confirm installation with:
3434

3535
```
3636
nuru -v
3737
```
3838

39-
4039
### MacOs ( Apple silicon Mac )
4140

42-
- Download the binary:
41+
- Download the binary:
4342

44-
- For apple silicon mac use:
43+
- For apple silicon mac use:
4544

46-
```
47-
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Darwin_arm64.tar.gz
48-
```
45+
```
46+
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Darwin_arm64.tar.gz
47+
```
4948
50-
- For apple intel mac use:
49+
- For apple intel mac use:
5150
52-
```
53-
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Darwin_amd64.tar.gz
54-
```
51+
```
52+
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Darwin_amd64.tar.gz
53+
```
5554
5655
- Extract the file to make global available:
57-
- For apple silicon mac use:
5856
59-
```
60-
sudo tar -C /usr/local/bin -xzvf nuru_Darwin_arm64.tar.gz
61-
```
62-
- For apple intel mac use:
57+
- For apple silicon mac use:
58+
59+
```
60+
sudo tar -C /usr/local/bin -xzvf nuru_Darwin_arm64.tar.gz
61+
```
62+
63+
- For apple intel mac use:
6364
64-
```
65-
sudo tar -C /usr/local/bin -xzvf nuru_Darwin_amd64.tar.gz
66-
```
65+
```
66+
sudo tar -C /usr/local/bin -xzvf nuru_Darwin_amd64.tar.gz
67+
```
6768
6869
- Confirm installation with:
6970
7071
```
7172
nuru -v
7273
```
7374
74-
75-
76-
7775
### Android (Termux)
7876
7977
To install Nuru on your Android device using Termux, follow these steps:
8078
8179
1. **Ensure Termux is installed**:
80+
8281
- You can download and install [Termux](https://f-droid.org/en/packages/com.termux/).
8382
8483
2. **Create the target directory**:
84+
8585
```bash
8686
mkdir -p /data/data/com.termux/files/usr/share/nuru
8787
```
8888

8989
3. **Download the Nuru package**:
90+
9091
```bash
9192
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Android_arm64.tar.gz
9293
```
9394

9495
4. **Extract the files to the target directory**:
96+
9597
```bash
9698
tar -xzvf nuru_Android_arm64.tar.gz -C /data/data/com.termux/files/usr/share/nuru
9799
```
98100

99101
5. **Set up an alias for easy access**:
102+
100103
```bash
101104
echo "alias nuru='/data/data/com.termux/files/usr/share/nuru/nuru'" >> ~/.bashrc
102105
```
103106

104107
6. **Reload the .bashrc file to apply the alias**:
108+
105109
```bash
106110
source ~/.bashrc
107111
```
@@ -117,27 +121,33 @@ For a more streamlined installation, you can use the following one-liner:
117121
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Android_arm64.tar.gz && mkdir -p /data/data/com.termux/files/usr/share/nuru && tar -xzvf nuru_Android_arm64.tar.gz -C /data/data/com.termux/files/usr/share/nuru && echo "alias nuru='/data/data/com.termux/files/usr/share/nuru/nuru'" >> ~/.bashrc && source ~/.bashrc && echo "Installation complete.."
118122
```
119123

120-
121124
### Windows
122125

123126
- Executable:
124-
- Download the Nuru zip file [Here](https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Windows_amd64.zip)
125-
- Unzip to get the executable
126-
- Double click the executable
127+
128+
- Download the Nuru zip file [Here](https://github.com/NuruProgramming/Nuru/releases/download/v0.5.17/nuru_Windows_amd64.zip)
129+
- Unzip to get the executable
130+
- Double click the executable
127131

128132
- Nuru Installer
129-
> Coming Soon
133+
> Coming Soon
130134
131135
### Building From Source
132136

133-
- Make sure you have golang installed (atleast 1.19.0 and above)
134-
- Run the following command:
137+
- Make sure you have golang installed (atleast 1.19.0 and above)
138+
- Run the following command:
135139

136140
```
137-
go build -o nuru main.go
141+
go build -o nuru .
138142
```
139-
- You can optionally add the binary to $PATH as shown above
140-
- Confirm installtion with:
143+
144+
- Copy nuru binary to path destination ~/go/bin
145+
146+
```
147+
cp nuru ~/go/bin
148+
```
149+
150+
- Confirm installtion with:
141151

142152
```
143153
nuru -v
@@ -146,6 +156,7 @@ nuru -v
146156
## Syntax At A Glance
147157

148158
**NOTE**
159+
149160
> There is a more detailed documentation of the language [here](https://nuruprogramming.org).
150161
151162
Nuru, although still in its early stage, intends to be a fully functional programming language, and thus it has been baked with many features.
@@ -160,10 +171,13 @@ y = 3;
160171
161172
andika(x*y) // output is 6
162173
```
174+
163175
You can also use the `fanya` keyword to define a variabe:
176+
164177
```
165178
fanya x = 3
166179
```
180+
167181
**Note that `fanya` keyword is OPTIONAL**
168182

169183
### Comments
@@ -194,15 +208,15 @@ For now Nuru supports `+`, `-`, `/`, `*` and `%`. Nuru also provides precedence
194208

195209
Nuru has the following types:
196210

197-
Type | Syntax | Comments
198-
--------- | ----------------------------------------- | -----------------------
199-
BOOL | `kweli sikweli` | kweli == true, sikweli == false
200-
INT | `1, 100, 342, -4` | These are signed 64 bit integers
201-
FLOAT | `2.3, 4.5. 100.8094` | Signed 64 bit floats
202-
STRING | `"" "mambo" "habari yako"` | They can be in double `"` or single `'` quotes
203-
ARRAY | `[] [1, 2, 3] [1, "moja", kweli]` | Arrays can hold any types
204-
DICT | `{} {"a": 3, 1: "moja", kweli: 2}` | Keys can be int, string or bool. Values can be anything
205-
NULL | `tupu` | These are nil objects
211+
| Type | Syntax | Comments |
212+
| ------ | ---------------------------------- | ------------------------------------------------------- |
213+
| BOOL | `kweli sikweli` | kweli == true, sikweli == false |
214+
| INT | `1, 100, 342, -4` | These are signed 64 bit integers |
215+
| FLOAT | `2.3, 4.5. 100.8094` | Signed 64 bit floats |
216+
| STRING | `"" "mambo" "habari yako"` | They can be in double `"` or single `'` quotes |
217+
| ARRAY | `[] [1, 2, 3] [1, "moja", kweli]` | Arrays can hold any types |
218+
| DICT | `{} {"a": 3, 1: "moja", kweli: 2}` | Keys can be int, string or bool. Values can be anything |
219+
| NULL | `tupu` | These are nil objects |
206220

207221
### Functions
208222

@@ -260,6 +274,7 @@ wakati (i > 0) {
260274
### Arrays
261275

262276
This is how you initiliaze and perform other array operations in Nuru:
277+
263278
```
264279
arr = []
265280
@@ -289,6 +304,7 @@ andika(arr[3]) // output = 3
289304
### Dictionaries
290305

291306
Nuru also supports dictionaries and you can do a lot with them as follows:
307+
292308
```
293309
mtu = {"jina": "Mojo", "kabila": "Mnyakusa"}
294310
@@ -321,6 +337,7 @@ andika(mtu) // output = {"jina": "Avicenna", "kabila": "Mnyakusa", "anapoishi":
321337
### For Loops
322338

323339
These can iterate over strings, arrays and dictionaries:
340+
324341
```
325342
kwa i ktk "habari" {
326343
andika(i)
@@ -338,6 +355,7 @@ i
338355
### Getting Input From User
339356

340357
In Nuru you can get input from users using the `jaza()` keyword as follows:
358+
341359
```
342360
jina = jaza("Unaitwa nani? ") // will prompt for input
343361
@@ -349,17 +367,21 @@ andika("Habari yako " + jina)
349367
### Using The Intepreter:
350368

351369
You can enter the intepreter by simply running the `nuru` command:
370+
352371
```
353372
nuru
354373
>>> andika("karibu")
355374
karibu
356375
>>> 2 + 2
357376
4
358377
```
378+
359379
Kindly Note that everything should be placed in a single line. Here's an example:
380+
360381
```
361382
>>> kama (x > y) {andika("X ni kubwa")} sivyo {andika("Y ni kubwa")}
362383
```
384+
363385
### Running From File
364386

365387
To run a Nuru script, write the `nuru` command followed by the name of the file with a `.nr` or `.sw` extension:
@@ -382,7 +404,7 @@ There are documentations for two languages, English and Kiswahili, which are bot
382404

383405
Clone the repo, hack it, make sure all tests are passing then submit a pull request.
384406

385-
> Make sure ALL tests are passing before making a pull request. You can confirm with running `make tests`
407+
> Make sure ALL tests are passing before making a pull request. You can confirm with running `make tests`
386408
387409
## Community
388410

0 commit comments

Comments
 (0)