Pseudoclasses via ruby-fiddle?
還沒有人認領這個 Issue。
評估
研究方向
先檢視 lib/libui/ffi.rb 中參照的 libui FFI bindings 和 ruby-libui 範例,接著檢查 Fiddle 目前如何公開 native calls 和 failures。定義具體的 pseudoclass 與除錯支援範圍,包括使用者如何識別出錯的呼叫或與 GC 相關的 crash;完成條件是有一份已達成共識的設計,或一份可實作、可測試的提案。
由索引模型根據 Issue 內容生成。
描述
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.)
- 主要語言
- Ruby
- 星號
- 195
- 分支
- 53
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ruby/fiddle 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 52/100
-
難度 3/5 1-2 天 新手友好度 68/100
-
難度 5/5 一週以上 新手友好度 30/100
-
難度 2/5 1-3 小時 新手友好度 45/100
-
難度 2/5 1-3 小時 新手友好度 52/100
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 82/100
zerocracy/judges-action#2743 ·
維護者通常 8 天內回覆
-
content good first issue
難度 2/5 1-3 小時 新手友好度 66/100
rubyevents/rubyevents#2182 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
TarteelAI/quranic-universal-library#821 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
Homebrew/homebrew-cask#293134 ·
維護者通常 1 天內回覆