[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101180] Re: Spectre Mitigations
— Chris Seaton <chris@...>
2020/12/01
I wouldn’t recommend using Ruby to run in-process untrusted code in the first place. Are people doing that?
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 3.0.0. From 2015 we
4 messages
2020/12/25
[ruby-core:101231] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
From:
Austin Ziegler <halostatue@...>
Date:
2020-12-03 22:44:38 UTC
List:
ruby-core #101231
What does this mean?
> Considering that you can alias a method to itself to avoid the warning,
and therefore do not need to remove the method first (which would cause a
race condition), I am dropping my request to add
`expected_redefined_method?(method_name)`.
I have code that I’ve written to get around some rdoc silliness that does:
# rdoc documentation for foo.
attr_writer :foo
undef :foo=
def foo=(x) #:nodoc:
# specialized foo assignment code
end
If I didn’t do this, RDoc documents both the attribute and the `foo=`
method (or it did the last time I checked) even though all I want
documented is the attribute for readability. How would I make it so that I
don’t need to do `undef :foo=` here, as that has been one thing that has
failed this code (_hard_) with both type analyzers for Ruby.
-a
On Wed, Dec 2, 2020 at 4:26 PM <merch-redmine@jeremyevans.net> wrote:
> Issue #17055 has been updated by jeremyevans0 (Jeremy Evans).
>
>
> During the November developer meeting, @matz seems in favor of completely
> removing the undefined instance variable warning. I am strongly in favor
> of removing the undefined instance variable warning completely, and much
> prefer doing that instead of adding
> `expected_uninitialized_instance_variable?`. If the undefined instance
> variable warnings are removed, there is no reason to have
> `expected_uninitialized_instance_variable?`.
>
> After discussions with @mame, the method redefinition warning is often
> helpful when writing test code using test/unit or minitest/test.
> Considering that you can alias a method to itself to avoid the warning, and
> therefore do not need to remove the method first (which would cause a race
> condition), I am dropping my request to add
> `expected_redefined_method?(method_name)`.
>
> ----------------------------------------
> Feature #17055: Allow suppressing uninitialized instance variable and
> method redefined verbose mode warnings
> https://bugs.ruby-lang.org/issues/17055#change-88891
>
> * Author: jeremyevans0 (Jeremy Evans)
> * Status: Open
> * Priority: Normal
> ----------------------------------------
> These two verbose mode warnings are both fairly common and have good
> reasons why you would not want to warn about them in specific cases. Not
> initializing instance variables to nil can be much better for performance,
> and redefining methods without removing the method first is the only safe
> approach in multi-threaded code.
>
> There are reasons that you may want to issue verbose warnings by default
> in these cases. For uninitialized instance variables, it helps catch
> typos. For method redefinition, it could alert you that a method already
> exists when you didn't expect it to, such as when a file is loaded multiple
> times when it should only be loaded once.
>
> I propose we keep the default behavior the same, but offer the ability to
> opt-out of these warnings by defining methods. For uninitialized instance
> variables in verbose mode, I propose we call
> `expected_uninitialized_instance_variable?(iv)` on the object. If this
> method doesn't exist or returns false/nil, we issue the warning. If the
> method exists and returns true, we suppress the warning. Similarly, for
> redefined methods, we call `expected_redefined_method?(method_name)` on the
> class or module. If the method doesn't exist or returns false/nil, we
> issue the warning. If the method exists and returns true, we suppress the
> warning.
>
> This approach allows high performance code (uninitialized instance
> variables) and safe code (redefining methods without removing) to work
> without verbose mode warnings.
>
> I have implemented this support in a pull request:
> https://github.com/ruby/ruby/pull/3371
>
> ---Files--------------------------------
> t.rb (5.59 KB)
>
>
> --
> https://bugs.ruby-lang.org/
>
> Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
>
--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>