Awesome
Rayed BQN
Rayed BQN is a library made to write cross-platform applications using the BQN programming language. It inter-ops with Raylib, but changes a lot of the functions to be more in-lined with BQN's syntax.
Breaking changes to any feature in rayed.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
Rayed-bqn works on Windows, Linux and MacOS. Make sure you've installed git and CBQN on Windows, Linux or MacOS. Rayed-bqn works with CBQN version 0.7.0, and hopefully >0.7.0 as well.
Make sure bqn is on PATH. To check, run bqn
in the terminal, in the case of windows it's Command Prompt
or Windows PowerShell
application. Then type 1+1
in the terminal 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.
First step in installing is cloning rayed-bqn and installing raylib by typing the following in the terminal, in the case of windows it's the Command Prompt
or Windows PowerShell
.
git clone https://github.com/Brian-ED/rayed-bqn.git
cd rayed-bqn
git submodule update --init --recursive
bqn install-raylib.bqn
cd ..
Explanation
Running bqn install-raylib.bqn
downloads raylib with release 5.0. In the case of windows, this is raylib-5.0_win64_msvc16
. It then takes the shared-binary from raylib/lib/
folder, take it out and place it inside rayed-bqn.
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
.
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 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.
raylibLibPath ⇐ "raylib/lib/raylib.dll"
raylibHeaderPath ⇐ "raylib/include/raylib.h"
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, 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 for helping with FFI.
I owe credit to @nulldatamap for showing a lovely example to get me started with using FFI for BQN, and for making it easy to start with making this library.