Skip to content

Commit e22d979

Browse files
committed
doc(readme): update url of github & online playground; detailed "How to use", indicating multiply backends
1 parent b971429 commit e22d979

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
(Subset of) Python programming language implemented in Nim, from the compiler to the VM.
44

5-
[Online interactive demo by compiling Nim to Javascript](https://liwt31.github.io/NPython-demo/).
5+
[Online interactive demo by compiling Nim to Javascript][play-npython].
6+
7+
[play-npython]: https://play.nimpylib.org/
68

79
### Purpose
8-
Fun and practice. Learn both Python and Nim.
10+
- Fun and practice. Learn both Python and Nim.
11+
- Serve as a altertive small version of CPython
12+
(as of 0.1.1, less than 2MB on release build mode)
913

1014

1115
### Status
@@ -23,13 +27,34 @@ Check out `./tests` to see more examples.
2327

2428

2529
### How to use
30+
31+
#### prepare
32+
33+
```
34+
git clone https://github.com/nimpylib/npython.git
35+
cd npython
36+
```
37+
38+
NPython support C backend and multiply JS backends:
39+
40+
> after build passing `-h` flag to npython and you will
41+
see help message
42+
43+
#### For a binary executable (C backend)
44+
2645
```
27-
git clone https://github.com/liwt31/NPython.git
28-
cd NPython
2946
nimble build
3047
bin/npython
3148
```
3249

50+
#### For JS backend
51+
52+
- NodeJS: `nimble buildJs -d:nodejs`
53+
- Deno: `nimble buildJs -d:deno`
54+
- Browser, prompt&alert-based repl: `nimble buildJs -d:jsAlert`
55+
- single page website: `nimble buildKarax` (requires `nimble install karax`). This is how [online playground][play-npython] runs
56+
57+
3358
### Todo
3459
* more features on user defined class
3560
* builtin compat dict

0 commit comments

Comments
 (0)