Forum: Ruby-core [ruby-trunk - Feature #7704][Open] Add a list of enabled (experimental) language features.

Posted by Michal Papis (mpapis)
on 2013-01-16 02:59
(Received via mailing list)
Issue #7704 has been reported by mpapis (Michal Papis).

----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Posted by naruse (Yui NARUSE) (Guest)
on 2013-01-16 04:51
(Received via mailing list)
Issue #7704 has been updated by naruse (Yui NARUSE).


mpapis (Michal Papis) wrote:
> With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list of enabled 
language features so developers could check it instead of auto-discovering code 
with some hacks.

Such feature list system is used on many languages/platforms like W3C 
DOM.
As far as my understand such experiment are failed because such feature 
list is too rough to use.
Features are not all or nothing in real world, and they often have bugs.
So auto discovery won't work.

> Additionally a new keyword like `require_features :refinements, ...` could be 
introduced to allow easy validation via either exception or return status.

Use defined?(define_method) or defined?(using).
----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704#change-35442

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Posted by Matthew Kerwin (mattyk)
on 2013-01-16 05:25
(Received via mailing list)
Issue #7704 has been updated by phluid61 (Matthew Kerwin).


naruse (Yui NARUSE) wrote:
> mpapis (Michal Papis) wrote:
> > With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list of enabled 
language features so developers could check it instead of auto-discovering code 
with some hacks.
>
> Such feature list system is used on many languages/platforms like W3C DOM.
> As far as my understand such experiment are failed because such feature list is 
too rough to use.
> Features are not all or nothing in real world, and they often have bugs.
> So auto discovery won't work.

Not offering an opinion as such, just adding to the discussion.

I have in mind a related system: the OpenGL Extension Library.  The 
registry of official language extensions is managed by an Architecture 
Review Board, and any OpenGL program can query the framework to detect 
the presence of an extension.

If Ruby were to support a similar system someone would be responsible 
for maintaining a registry of language features, including an explicit 
spec describing each feature (to which an implementation must fully 
adhere if it says it supports it).  For example, the current 
"refinements" feature could be bundled under the name :REFINEMENTS_2_0 
and match the current spec exactly; where a future version (e.g. 
:REFINEMENTS_2_1) would have a different spec.

That way a particular implementation may choose to implement some 2.0 
features (e.g. kwargs) without others (e.g. refinements).

However, I imagine this would quickly become an unwieldy list, as per 
the OpenGL Extensions.
----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704#change-35443

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Posted by drbrain (Eric Hodel) (Guest)
on 2013-01-25 22:34
(Received via mailing list)
Issue #7704 has been updated by drbrain (Eric Hodel).

Target version set to next minor


----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704#change-35640

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee:
Category:
Target version: next minor


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Posted by ko1 (Koichi Sasada) (Guest)
on 2013-02-22 01:21
(Received via mailing list)
Issue #7704 has been updated by ko1 (Koichi Sasada).

Category set to core
Assignee set to matz (Yukihiro Matsumoto)


----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704#change-36746

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Posted by "duerst (Martin Dürst)" <duerst@it.aoyama.ac.jp> (Guest)
on 2013-02-22 03:00
(Received via mailing list)
Issue #7704 has been updated by duerst (Martin Dürst).


I can only second Yui and Matthew. Directly checking is possible because 
Ruby is a dynamic language, it avoids management overhead, and tests on 
the actual feature, not some intention that may be out of sync with 
actual facts. There are many organizations that have tried to do this, 
and most if not all have failed; I don't see any reason why we can't 
learn from them and use our time for more productive work on other 
stuff.
----------------------------------------
Feature #7704: Add a list of enabled (experimental) language features.
https://bugs.ruby-lang.org/issues/7704#change-36757

Author: mpapis (Michal Papis)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor


With multiple Ruby implementations and "experimental" features like 
"refinements" it would be nice to have an array or hash including list 
of enabled language features so developers could check it instead of 
auto-discovering code with some hacks.

Additionally a new keyword like `require_features :refinements, ...` 
could be introduced to allow easy validation via either exception or 
return status.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.