ruby / ruby/fiddle

Pseudoclasses via ruby-fiddle?

オープン
#103 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Ruby
スター
195
フォーク
53
平均マージ
23時間 57分
マージ済み PR(30日)
1

説明

Hello fiddle-folks,

fiddle is quite epic. kojix2 wrote the bindings (if you can call them) for libui - see here for
most of the try_extern calls:

https://github.com/kojix2/LibUI/blob/main/lib/libui/ffi.rb

As a "downstream" user, though, fiddle is not easy to use. Often I just get segfaults and
then I end up not understanding why. I can figure out indirectly to some extent and with
helpful comments (e. g. GC kicking in), but by and large I'd love if ruby-fiddle would have
more debug-friendly support - similar to did-you-mean gem or the recent debug-related
changes by mame in MRI ruby.

Having worked with ruby-gtk a lot I am kind of used to modify core widgets such as
Gtk::Windows or Gtk::Box (horizontal and vertical). I like simple APIs such as .add()
or << just to add widgets together, a bit like LEGO building blocks.

With fiddle, though, this is a bit complicated. So the core question for this issue is
whether fiddle could allow for "designated" pseudoclasses? I'd love to build up
classes that can simulate the Gtk widgets to some extent (at the least what libui
allows for; see also libui-ng that has been recently started).

Something where I can build "pseudoclasses" and then at the least the error
messages can be more helpful. Rather than a segfault as such, something
that allows us to investigate which line is faulty or why it crashed (e. g. GC
kicking in). kojix2 showed various work arounds (see the examples he provides
for ruby-libui) but this requires some more expert knowledge than many ruby
developers have. For instance I do not really know C. And while I should really
have learned C properly, ruby is simply more fun to work with! :D

I do not know how easy it would be to have something like pseudoclasses
work, and better error/debug support for fiddle. It's ok if the downstream
dev has to write more code to enable this - I am not really suggesting an
"autofixer" that solves all problems as-is. But something with better debug-support
and to use fiddle in a more ruby-way, including a traditional OOP-like hierarchy.
Getting random SEGFAULTS and not really knowing why can be frustrating.

Other than that fiddle is pretty cool. (ruby-gtk via gobject-introspection also
has this problem partially by the way - the error messages I get are often
not super-useful.)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、lib/libui/ffi.rb で参照されている libui の FFI バインディングと ruby-libui の例を確認し、次に Fiddle が現在ネイティブ呼び出しと失敗をどのように公開しているかを調査します。具体的な疑似クラスとデバッグ支援の範囲を定義し、ユーザーが問題のある呼び出しや GC に関連するクラッシュをどのように特定するかも含めます。合意された設計、または実装可能でテスト可能な提案ができれば完了とします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
ruby
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。