GithubHelp home page GithubHelp logo

rayed-bqn's Introduction

  • 👋 Hi, I’m @Brian-ED
  • 👀 I’m interested in Array Programming
  • 🌱 I’m currently learning C & Singeli & Zig & BQN
  • 💞️ I’m looking to collaborate on rayed-bqn, my favorite project in my favorite language!
  • 📫 How to reach me on discord in old format and new: "Brian E#0926" "brian-e"

rayed-bqn's People

Contributors

brian-ed avatar codereport avatar mlochbaum avatar oliverm avatar paulapatience avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rayed-bqn's Issues

Most examples broke in recent update

Redid a few drawing functions, a lot simpler now because i removed some functionality. I found that extending them wasn't worthit and just made code look worse.

This did break most drawing examples.

Current image representation uses more space than neccesary

The current image representation doesn't account for the fact that CBQN doesn't store arrays as unsigned int, it stores them as signed, so the current representations use 2x more space than anticipated.
but also, it isn't perfect anyways since if you have a format that conserves 1 bit for alpha and 8 for red then the alpha will still use 8 bits.

A simple solution that i will implement is to just always use binary arrays and have a converter to floats and back for when you want to operate on the image representations...

I don't like how this overcomplicates it though, i wish there was a way to store RGBA seperated neatly

install directory for homebrew may be incorrect

The readme says /opt/homebrew/lib/libraylib.dylib is the path for libraylib when using homebrew, but according to https://osxdaily.com/2018/07/05/where-homebrew-packages-installed-location-mac/ the default location seems to be /usr/local/opt/raylib/lib/libraylib.dylib which i have confirmed on my own mac i had lying around.

@OliverM can you confirm since you're probably a mac user?

Btw, I'm currently making the default path for the config on macOS so there is less chance for complications while installing rayed-bqn.

Improve _with

_with is implemented in a lot of places, like texture._with. It loads a texture for a function 𝕗 to use and then unloads.
The benifits are less mistakes since you now can't forget to unload. The negatives are that it gets ugly when nesting a lot to load multiple textures.
A few solutions exist, like making _with map over 𝕩 to load multiple textures, but how do you load a texture to be used for the next few frames and then unload then? what about if you don't know when you'll need to unload? I was thinking you could use recursion to solve this, but i'm unsure of a good solution.

Add option to not automatically regenerate FFI files.

In config.bqn, it'd be nice if you could specify weather to regenerate FFI files automatically. This would be for testing and if you want to modify the ffi files yourself without fear of regenerations, even if editing isn't recommended (they will be out-of-date pretty quickly).

Rayffi parser aliases don't work

i modified the c parser in the first version of the parser. I have fixed this issue already so now it works on the original version aswell.
that brings me to second point, now i can use the original raylib parser directly so no need to store the c parser code in the parsing directory.
The function mapArgTypes has a lot of manually added values and keywords that are specially treated. I want to limit how many special treatment cases there are since if i keep it at the current state, new types added to raylib could break the parser.
I also need to make aliaces work properly, quaternions aren't even defined.

Resize by 0 returns weird error

The error returned by window.SetSize 0‿0 is

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  252
  Current serial number in output stream:  253

aweful error, will update with a fix

add option in config for bqn-libs

This is to avoid duplicate files of bqn-libs everywhere. Also makes a person able to make a few changes if needed, like lets say •ParseFloat doesn't work because it's an old bqn version, then you can use ToNums instead, and just point to that bqn-libs.
very neat i think.

readme.md should have instructions for more platforms

Raylib currently supports rasberry pi, open bsd, macOS, android, wasm, windows and linux.
If BQN supports these platforms aswell then rayed-bqn should work too. Instructions for setup would be nice to include in readme.md

Plain data instead of Pointers

C pointers shouldn't exist for a user using raylib.bqn, so I've set out to make a long lasting issue where i try modifying all loading functions to just give the bare data, hopefully in a useful format.

long texts like error messages should be moved out of code

Long texts like errors should probably be moved outside of wherever the code is because it could encourage new contributors to fix up the errors if they're uninformative. It's also to make code more maintainable. long texts tend to increase development time because of scrolling and useless extra reading.

rayffi.bqn being an inconsistent version

There is an issue where if you run the latest version of rayed bqn with latest raylib release it won't work since I've pre-parsed rayffi.bqn with a dev build of raylib.

a temporary fix is to just reparse it with the actual version 5.0.0, which i will probably have to do, but i want a better, permanent solution.

I should add running the autoparser as a step on linux/mac, which fixes the issue, but it needs C.

I should really get the raylib_parser.c reimplemented in BQN, i was working on that but it's slow progress. I'd expect to be done with that in a few weeks probably? It will also fix this issue.

Another thing i could do is having a directory of pre-parsed rayffi.bqns with version numbers, and have config decide which version to choose.

Some symbols not found on MacOS Arm in rayffi.bqn

When compiling examples, the compiler wasn't able to find two symbols:
GenImageGradientLinear;
GenImageGradientSquare.

Throwing:
⟨ "{*:i8,i32,i32,i32,i32}" "GenImageGradientLinear" "i32" "i32" "i32" "{u8,u8,u8,u8}" "{u8,u8,u8,u8}" ⟩ Error: Failed to find symbol: dlsym(0x30851c8f0, GenImageGradientLinear): symbol not found"

This was using raylib 4.5.0 precompiled for macos, running on a M1 Pro chip on macOS Ventura 13.4.1.

After deleting these two lines and the whole program ran successfully!

rayffi.bqn shouldn't use Struct to combine strings prematurely

the current way rayffi is set up with the structs is that the Struct function is applied to a sequence of types and they're joined right away. instead, what should be done is the _R modifier should join the types itself, since this allows more possibilities for checking types of structs outside the ffi file.

Also after this is done, i'll be soon adding automatic null-terminating for strings in structs aswell, like how i've done with the non-struct arguments.

add comment to topOfRayffi.bqn

This comment should indicate that the file inp-out/rayffi.bqn is auto generated by combining the text in file "topOfRayffi.bqn" to the output of parseRaylibJson.bqn.
This comment is so that people aren't confused and try to edit the autogenerated ffi file.
The comment could also explain how to generate the file, but that could be a seperate issue for another time.

Can't run raylib-bqn on macOS

I'm trying to get raylib working on mac but I'm having issues. I've installed raylib via homebrew and the dylib is available at /opt/homebrew/lib/libraylib.dylib. I've updated my config.txt file to point at this location like this:

raylibPath:/opt/homebrew/lib/libraylib.dylib
bqn-libsPath:/Users/olivermooney/projects/rayed-bqn/src/imports/bqn-libs

But when I try to run the DrawEllipse example I get
Error: FFI: Failed to load library: dlopen(/usr/local/lib/libraylib.so, 0x0002): tried: '/usr/local/lib/libraylib.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libraylib.so' (no such file), '/usr/local/lib/libraylib.so' (no such file)

It seems to be ignoring the setting and checking Linux-default locations instead. Am I doing something wrong?

Thanks for the library, I'm really excited to try it!

missing more Image representation

The only supported image representation supported (in a yet to be committed rayed-bqn) is 3d arrays with one dimension being length 4 for the rgba colors. There are multiple formats that can be supported by raylib, and it'd be lovely to support as many as possible.

List:
uncompressed_grayscale
uncompressed_gray_alpha
uncompressed_r5g6b5
uncompressed_r8g8b8
uncompressed_r5g5b5a1
uncompressed_r4g4b4a4
uncompressed_r8g8b8a8
uncompressed_r32
uncompressed_r32g32b32
uncompressed_r32g32b32a32
compressed_dxt1_rgb
compressed_dxt1_rgba
compressed_dxt3_rgba
compressed_dxt5_rgba
compressed_etc1_rgb
compressed_etc2_rgb
compressed_etc2_eac_rgba
compressed_pvrt_rgb
compressed_pvrt_rgba
compressed_astc_4x4_rgba
compressed_astc_8x8_rgba

Resizing window doesn't work on linux-mint cinamon

The fix for this is disabling window decoration, then scaling, then re-enabling window decoration. window decoration being the top bar with close, minimize, etc.

The fix isn't nice though. I want a better fix

ffi parser's structs shouldn't do `ptr⊣`

fields in the structs that the ffi parser produces often has ptr⊣'*'∾str as a field. This is so that if functions output something with the "type" of a struct struct, the field is guaranteed to have pointers instead of erroring when bqn can't destructure them.
So, to fix this issue all that needs to be done is remove the ptr⊣ and handle pointers in the _r function instead. this also allows the structs to hold the pointer information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.