What have you found for these years?

2009-06-09

re-include module

日前在 ruby-core 上看到相關議題:
[Feature #1586]
Including a module already present in ancestors should not be ignored

裡面有篇文章講到了為什麼 YARV 又用回原本的方式:
A Chat with Matz, Classs Variable reversion, and A Mystery Explained

這應該跟上次我在 rubinius 上提到的有關:
Kernel and IncludedModule

我一直以為是設計問題,原來根本是 yarv 實作限制???
可是... 我不懂為什麼要用詭異的方式做 super 的 lookup?
在 rubinius 這應該是很單純的事,每個 IncludedModule 和
Class 都有各自的 super pointer 可以用。
我想,應該就像文中所提到 smalltalk 那樣吧?

不明白 yarv 內部是怎麼實作,為什麼會做成這樣 @@
也懶得查了...

於是這延伸出另一個問題,像是這種實作限制,算是 spec 嗎?
相容於 official ruby implementation, 重要嗎?連實作限制都要相容?
或許需要一個 --compatible-with-mri/yarv 的 option?
但這樣做起來又更麻煩了...

可是不做相容,對於擴展 user 而言又是極度困難的,
尤其效能又不能跟 yarv 相比較... 這樣永遠只有實驗的價值而已。

兩難三難四難啊

0 retries:

Post a Comment

Note: Only a member of this blog may post a comment.



All texts are licensed under CC Attribution 3.0