Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sogaiu/jaylib-netrepl-demo
https://github.com/sogaiu/jaylib-netrepl-demo
demo janet jaylib netrepl
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sogaiu/jaylib-netrepl-demo
- Owner: sogaiu
- Created: 2023-11-16T06:45:28.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-09T05:19:16.000Z (12 months ago)
- Last Synced: 2024-02-09T06:26:16.464Z (12 months ago)
- Topics: demo, janet, jaylib, netrepl
- Language: Janet
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jaylib-netrepl-demo
Demo of using jaylib with netrepl
## Setup
```
git clone https://github.com/sogaiu/jaylib-netrepl-demo
cd jaylib-netrepl-demo
jpm -l deps
```## Test
Start program (this starts the netrepl server too):
```
jpm -l janet main.janet
```A window should show up with a solid background color and an updating
fps value in the top left should appear.In an editor, open `main.janet` and connect to the netrepl server
at `127.0.0.1:9365` [1].Evaluate the `(set bg-color ...)` form within the `(comment ...)` form.
If everything went well, the background color should have changed.
## Using Janet's `:redef` Feature
It's also possible to make use of [Janet's `:redef`
feature](https://github.com/janet-lang/janet/pull/898) by starting the
program like this:```
jpm -l janet -d main.janet
```As before, a window should show up with a solid background color and
an updating fps value in the top left should appear.In an editor, open `main.janet` and connect to the netrepl server
at `127.0.0.1:9365` [1].Evaluate the `(def fps-coor ...)` form within the `(comment ...)`
form.If everything went well, the position of the fps counter should have
changed.## Footnotes
[1] Connecting to the netrepl server is editor-specific. Some options
include:* [a-janet-spork-client](https://github.com/sogaiu/a-janet-spork-client)
* [conjure](https://github.com/Olical/conjure)It's also possible to use
[`spork`](https://github.com/janet-lang/spork)'s `janet-netrepl`'s
client mode (`-c`) to connect to the netrepl server and communicate
that way.