updated readme
This commit is contained in:
@@ -23,13 +23,18 @@ Clyx aims for maximum portability and can be implemented in any modern runtime e
|
||||
|
||||
Depending on the implementation, there are several installation ways.
|
||||
|
||||
### Reference Python implementation installation
|
||||
### Reference Python (CPython) implementation installation
|
||||
|
||||
```sh
|
||||
pip install "git+https://codeberg.org/luxferre/clyx.git#subdirectory=clyx-python"
|
||||
```
|
||||
|
||||
This will install the REPL as `clyx` into your current environment.
|
||||
|
||||
### Reference implementation for MicroPython
|
||||
|
||||
Clone this repo, then run `sh dist-python.sh`. A `dist/clyx_py/clyx` directory will appear, which will contain all the files necessary to run `micropython clyx.py [prog.clx]` on the desktop or copy them to the target device.
|
||||
|
||||
### Reference implementation for CircuitPython + [T-DeckARD](https://codeberg.org/luxferre/t-deckard) runtime
|
||||
|
||||
Clone this repo, then mount your T-Deck's CircuitPython volume, and then run:
|
||||
@@ -44,18 +49,30 @@ Note: this section describes how to run the interpreter itself. For the language
|
||||
|
||||
All core implementations must accept a `.clx` file to run (either via command line or via library call parameter). The REPL is implemented in Clyx itself and resides in the [clyx_repl.clx](clyx_repl.clx) file.
|
||||
|
||||
To run the REPL with the reference Python implementation, run `[micro]python clyx.py clyx_repl.clx` command.
|
||||
### Running the reference Python implementation
|
||||
|
||||
If Clyx is installed as a PyPi package, just use `clyx [prog.clx]` to run the REPL or a program.
|
||||
|
||||
Otherwise, to run the REPL, run `[micro]python clyx.py` command from the directory created by `./dist-python.sh`. Pass a `.clx` file additionally to run a Clyx program directly.
|
||||
|
||||
### Running as a T-DeckARD applet
|
||||
|
||||
To run the REPL inside T-DeckARD:
|
||||
```
|
||||
from app.clyx import clyx
|
||||
clyx.repl()
|
||||
```
|
||||
Don't forget to mount an SD card or run `unlock_rootfs()` if you want to use file writing capabilities inside T-DeckARD environment.
|
||||
To run a Clyx source file directly, issue `clyx.clyx('path/to/file.clx')` instead.
|
||||
|
||||
Caveats:
|
||||
|
||||
1. The entire operation is rather slow (which is expected for an interpreted runtime on top of CircuitPython on this class of machines) and may sometimes overflow the allocated (native) Python stack. As such, it's not recommended to `src` files from the REPL if you can run them directly instead.
|
||||
2. Don't forget to mount an SD card or run `unlock_rootfs()` if you want to use file writing capabilities inside T-DeckARD environment.
|
||||
|
||||
## Implementations
|
||||
|
||||
- [Reference implementation in Python](clyx-python/clyx/clyx.py) (compatible with MicroPython and CircuitPython)
|
||||
- [Reference implementation in Python](clyx-python/clyx/clyx.py) (compatible with MicroPython and T-DeckARD on CircuitPython)
|
||||
|
||||
## FAQ
|
||||
|
||||
### Where does the name Clyx originate from?
|
||||
|
||||
Reference in New Issue
Block a user