Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Brian-ED/rayed-bqn
Raylib with a bit of bacon spice!
https://github.com/Brian-ED/rayed-bqn
bqn raylib
Last synced: 3 months ago
JSON representation
Raylib with a bit of bacon spice!
- Host: GitHub
- URL: https://github.com/Brian-ED/rayed-bqn
- Owner: Brian-ED
- License: mit
- Created: 2023-03-14T22:12:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-07-17T07:41:58.000Z (4 months ago)
- Last Synced: 2024-07-17T09:46:25.167Z (4 months ago)
- Topics: bqn, raylib
- Language: BQN
- Homepage:
- Size: 6.26 MB
- Stars: 31
- Watchers: 3
- Forks: 5
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-bqn - rayed-bqn
README
# Rayed BQN
Rayed BQN is a library made to write cross-platform applications using the [BQN programming language](https://mlochbaum.github.io/BQN/).
It inter-ops with [Raylib](https://github.com/raysan5/raylib), but changes a lot of the functions to be more in-lined with BQN's syntax.Breaking changes to any feature in raylib.bqn should be expected for now, as this library is very young and experimental.
ffi/raylib.bqn is only for bindings and is autogenerated with the currently installed raylib version so you can rely on these.# Getting started
## Windows
Make sure you've installed [git](https://git-scm.com/download/win) and [CBQN](https://github.com/vylsaz/cbqn-win-docker-build/releases). rayed-bqn works with CBQN version 0.7.0, and hopefully >0.7.0 aswell.Make sure `CBQN` is on PATH, check by typing `bqn` in `Command Prompt` or `Windows PowerShell`, run it, and type `1+1` and get `2`. If `bqn` wasn't found, add the bqn folder from cbqn-win-docker-build to PATH. [Tutorial on how to add folders to path](https://www.computerhope.com/issues/ch000549.htm).
Clone rayed-bqn by typing the following in `Command Prompt` or `Windows PowerShell`.
```SH
git clone https://github.com/Brian-ED/rayed-bqn.git
cd rayed-bqn
git submodule update --init --recursive
cd ..
```Now run the PowerShell script `install-raylib/windows.ps1` and you should be able to run some examples in the `examples` folder.
If you would rather not run the script and setup yourself, download [raylib](https://github.com/raysan5/raylib/releases/) with release `raylib-VERSION_win64_msvc16`, where `VERSION` would be the version number, use whichever is latest since it should be most stable. Place the extracted folder inside the rayed-bqn folder and rename the extracted folder to "raylib". Now you can run some examples in the `examples` folder.
## Linux
Make sure you've installed [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [CBQN](https://github.com/dzaima/CBQN). rayed-bqn works with CBQN version 0.7.0, and hopefully >0.7.0 aswell.Clone rayed-bqn
```SH
git clone https://github.com/Brian-ED/rayed-bqn.git
cd rayed-bqn
git submodule update --init --recursive
cd ..
```Build [raylib](https://github.com/raysan5/raylib/) and install it:
```sh
git clone https://github.com/raysan5/raylib.git
cd raylib/src
make RAYLIB_LIBTYPE=SHARED
sudo make install RAYLIB_LIBTYPE=SHARED
cd ../../
```Now run an example, if it doesn't work please post an issue.
## Mac
Make sure you've installed [CBQN](https://github.com/dzaima/CBQN).First, clone rayed-bqn
```SH
git clone https://github.com/Brian-ED/rayed-bqn.git
cd rayed-bqn
git submodule update --init --recursive
cd ..
```Next, install [raylib](https://github.com/raysan5/raylib/). If you use [Homebrew](https://brew.sh):
```SH
brew install raylib
```If you don't use Homebrew you can get raylib by downloading the MacOS [raylib release](https://github.com/raysan5/raylib/releases/) `raylib-VERSION_macos.tar.gz` (replace `VERSION` with whichever is latest, it should be most stable) and place it inside this project, at the same level as `rayed.bqn` and rename the unarchived `raylib-VERSION_macos.tar.gz` folder to "raylib".
Now you should be able to run some examples in the `examples` folder.
# Installing the raygui addon
Examples using this addon can be found in `examples/14_gui-example`.
Currently you will have to compile raygui yourself, i plan on shipping a pre-built .dll for windows users in the future.Installing for linux is shown below. If you're on windows, replace `.so` with `.dll`. If you're on mac, replace `.so` with `.dylib`.
```bash
git clone https://raw.githubusercontent.com/raysan5/raygui/master/
cd src
gcc -o libraygui.so raygui.c -shared -DRAYGUI_IMPLEMENTATION -lraylib
```
After building, you can define `rayguiHeaderPath` and `rayguiLibPath` in config.bqn to be the path where you cloned raygui at.# Tested raylib versions:
`raylib-4.5.0_win64_mingw-w64` on Windows 10
raylib version 4.5.0 built from source on Pop!_OS.
raylib version 4.5.0 built from source on Ubuntu 22.04.2 LTS.
raylib version 5.0.0 built from source on Ubuntu 22.04.2 LTS.
raylib version 5.0.0 via homebrew on mac# Extra info
rayed-bqn relies on [c-header-to-bqn-ffi](https://github.com/Brian-ED/c-header-to-bqn-ffi) for parsing all `ffi/*.bqn` automatically.## config file
A config file named "config.bqn" will be generated at `./rayed-bqn/config.bqn`. It's a namespace bqn file with exported variables as settings.For example setting the binary, the binary being one of the following: raylib.dll, libraylib.so, etc.
```bqn
raylibLibPath ⇐ "raylib/lib/raylib.dll"
raylibHeaderPath ⇐ "raylib/include/raylib.h"
``````bqn
raylibLibPath ⇐ "raylib/lib/libraylib.so"
raylibHeaderPath ⇐ "raylib/include/raylib.h"
```"/usr/local"The most important file in ./raylib/lib/ is the binary file, which could be located at:
windows: raylib/lib/raylib.dll
linux: /usr/local/lib/libraylib.so"
macOS: /usr/local/lib/libraylib.dylib# Ideologies
Having as little magic as possible, magic meaning magic numbers and global values (available to the user) changing outside user's control.Mutations localized in namespaces like "clock" are fine.
# Contributing
If you have any questions on contributing to this project, feel free to mention me on the bqn forum that's mentioned on the [bqn-wiki](https://mlochbaum.github.io/BQN/index.html#where-can-i-find-bqn-users), my username is Brian E.You can submit however many issues as you'd like, I see them as a TODO list.
You can make pull requests and submit them for merges if you'd like, though be sure to discuss with me for any features you add to make sure you didn't put in wasted effort, though if it's mentioned in a github-issue and isn't taken do make sure you say you're working on it. Also say when you've stopped working on it, and share the roadblocks and progress, so someone can continue where you left off.
# Credits
Lots of thanks to [@dzaima](https://github.com/dzaima) for helping with FFI.
I owe credit to [@nulldatamap](https://gist.github.com/nulldatamap) for showing a lovely [example](https://gist.github.com/nulldatamap/30b10389bf91d6f25bb262da9c9e9709) to get me started with using FFI for BQN, and for making it easy to start with making this library.