[Idea / But mostly a discussion] AI fiddle? #174
rubyFeedback
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello fiddle-devs for ruby,
There are quite many ruby-bindings available for popular libraries. For instance, kojix2
maintains the fiddle-wrapper over libui-ng (mostly) here:
https://github.com/kojix2/LibUI/blob/main/lib/libui/ffi.rb
Most of the wrapper code calls:
which in turn calls extern() here:
https://github.com/kojix2/LibUI/blob/main/lib/libui/fiddle_patch.rb#L38
However had, would this not in principle be a task for an "AI fiddle"? Perhaps not necessarily
a true AI, but just something like rubocop.
I don't know how complex this can be, but I am also not sure why kojix2 or anyone else
necessarily needs to write the wrapper code over C functions manually.
So while my idea/suggestion is not meant to be followed with any implementation, there
is actually a legit underlying issue. People sometimes retire, or become less active, and
then new folks may have to maintain (and understand) code. If it is ruby code then I think
it is not too hard to figure out what something does, especially if it is well-written ruby code
that is documented and has examples. For C libraries, though, I often feel as if I am poking
into a black box or black hole, because I don't really understand what I am doing, yet alone
be able to maintain the ruby-wrapper over C, as I know C only a tiny bit - not enough to really
use it efficiently. Any AI fiddle wrapper could also help in regards to new C code we may want
to have wrapper code.
(Note: I am not saying the current fiddle needs to do that; I am here more wondering what a
future fiddle could bring to the table, e. g. wrapped via AI, or simply clever scripts such as
rubocop does via its autocorrect-option.)
Beta Was this translation helpful? Give feedback.
All reactions