[#101174] [Ruby master Bug#17359] Ractor copy mode is not Ractor-safe — marcandre-ruby-core@...

Issue #17359 has been reported by marcandre (Marc-Andre Lafortune).

17 messages 2020/12/01

[#101217] [Ruby master Feature#17363] Timeouts — marcandre-ruby-core@...

Issue #17363 has been reported by marcandre (Marc-Andre Lafortune).

19 messages 2020/12/03

[#101250] [Ruby master Bug#17369] Introduce non-blocking `Process.wait`, `Kernel.system` and related methods. — samuel@...

Issue #17369 has been reported by ioquatix (Samuel Williams).

12 messages 2020/12/05

[#101276] [Ruby master Bug#17373] Ruby 3.0 is slower at Discourse bench than Ruby 2.7 — sam.saffron@...

Issue #17373 has been reported by sam.saffron (Sam Saffron).

11 messages 2020/12/07

[#101278] [Ruby master Bug#17374] Refined methods aren't visible from a refinementRefinements that include/prepend module — marcandre-ruby-core@...

Issue #17374 has been reported by marcandre (Marc-Andre Lafortune).

17 messages 2020/12/07

[#101317] [Ruby master Feature#17378] Ractor#receive with filtering like other actor langauge — ko1@...

Issue #17378 has been reported by ko1 (Koichi Sasada).

9 messages 2020/12/08

[#101343] [Ruby master Bug#17382] Segfault in String#inspect — lionel.perrin@...

Issue #17382 has been reported by lionelperrin (Lionel Perrin).

10 messages 2020/12/09

[#101381] [Ruby master Bug#17385] Test failures on gcc 11 — jaruga@...

Issue #17385 has been reported by jaruga (Jun Aruga).

18 messages 2020/12/10

[#101458] [Ruby master Bug#17394] TCPServer is not thread safe on win32 — aladjev.andrew@...

Issue #17394 has been reported by puchuu (Andrew Aladjev).

9 messages 2020/12/14

[#101472] [Ruby master Feature#17397] shareable_literal_constant should check at runtime, not at parse time — marcandre-ruby-core@...

Issue #17397 has been reported by marcandre (Marc-Andre Lafortune).

10 messages 2020/12/16

[#101475] [Ruby master Bug#17398] SyntaxError in endless method — zverok.offline@...

Issue #17398 has been reported by zverok (Victor Shepelev).

15 messages 2020/12/16

[#101477] [Ruby master Misc#17399] Are endless methods experimental? — zverok.offline@...

Issue #17399 has been reported by zverok (Victor Shepelev).

13 messages 2020/12/16

[#101480] [Ruby master Bug#17400] Incorrect character downcase for Greek Sigma — xfalcox@...

Issue #17400 has been reported by xfalcox (Rafael Silva).

10 messages 2020/12/16

[#101513] [Ruby master Bug#17405] irb ---nomultiline gets exception when output contains some non-ascii characters — rsharman@...

Issue #17405 has been reported by rsharman (Richard Sharman).

8 messages 2020/12/18

[#101534] [Ruby master Bug#17409] Endless range of dates stuck on include? when miss — sergey.gnuskov@...

Issue #17409 has been reported by gsmetal (Sergey G).

9 messages 2020/12/19

[#101546] [Ruby master Bug#17411] Syntax error with . in pattern — zverok.offline@...

Issue #17411 has been reported by zverok (Victor Shepelev).

10 messages 2020/12/19

[#101598] [Ruby master Bug#17420] Unsafe mutation of $" when doing non-RubyGems require in Ractor — eregontp@...

Issue #17420 has been reported by Eregon (Benoit Daloze).

12 messages 2020/12/21

[#101635] [Ruby master Bug#17428] Method#inspect bad output for class methods — marcandre-ruby-core@...

Issue #17428 has been reported by marcandre (Marc-Andre Lafortune).

13 messages 2020/12/23

[#101639] [Ruby master Bug#17429] Prohibit include/prepend in refinement modules — shugo@...

Issue #17429 has been reported by shugo (Shugo Maeda).

32 messages 2020/12/23

[#101707] [Ruby master Feature#17472] HashWithIndifferentAccess like Hash extension — naruse@...

Issue #17472 has been reported by naruse (Yui NARUSE).

31 messages 2020/12/26

[#101710] [Ruby master Feature#17473] Make Pathname to embedded class of Ruby — hsbt@...

Issue #17473 has been reported by hsbt (Hiroshi SHIBATA).

28 messages 2020/12/26

[#101719] [Ruby master Feature#17474] Interpreting constants at compile time — jzakiya@...

Issue #17474 has been reported by jzakiya (Jabari Zakiya).

23 messages 2020/12/26

[#101735] [Ruby master Misc#17480] DevelopersMeeting20210113Japan — mame@...

Issue #17480 has been reported by mame (Yusuke Endoh).

12 messages 2020/12/27

[#101790] [Ruby master Bug#17486] Build fails on darwin due to libtool being removed — dark.panda@...

Issue #17486 has been reported by dark.panda (J Smith).

11 messages 2020/12/28

[#101794] [Ruby master Bug#17488] Regression in Ruby 3: Hash#key? is non-deterministic when argument uses DelegateClass — myron.marston@...

Issue #17488 has been reported by myronmarston (Myron Marston).

11 messages 2020/12/28

[#101809] [Ruby master Feature#17490] Rename RubyVM::MJIT to RubyVM::JIT — takashikkbn@...

Issue #17490 has been reported by k0kubun (Takashi Kokubun).

15 messages 2020/12/30

[#101838] [Ruby master Feature#17496] Add constant Math::TAU — jzakiya@...

Issue #17496 has been reported by jzakiya (Jabari Zakiya).

32 messages 2020/12/31

[#101840] [Ruby master Bug#17497] Ractor performance issue — marcandre-ruby-core@...

Issue #17497 has been reported by marcandre (Marc-Andre Lafortune).

21 messages 2020/12/31

[ruby-core:101313] Ruby 3.0.0 Preview 2 Released

From: "NARUSE, Yui" <naruse@...>
Date: 2020-12-08 10:14:11 UTC
List: ruby-core #101313
We are pleased to announce the release of Ruby 3.0.0-preview2.
It introduces a number of new features and performance improvements.
## Static Analysis
### RBS
RBS is a language to describe the types of Ruby programs.
Type checkers including TypeProf and other tools supporting RBS will
understand Ruby programs much better with RBS definitions.
You can write down the definition of classes and modules: methods
defined in the class, instance variables and their types, and
inheritance/mix-in relations.
The goal of RBS is to support commonly seen patterns in Ruby programs
and it allows writing advanced types including union types, method
overloading, and generics. It also supports duck typing with
_interface types_.
Ruby 3.0 ships with `rbs` gem, which allows parsing and processing
type definitions written in RBS.
The following is a small example of RBS with class, module, and
constant definitions.
```rbs
module ChatApp
  VERSION: String
  class Channel
    attr_reader name: String
    attr_reader messages: Array[Message]
    attr_reader users: Array[User | Bot]              # `|` means
union types, `User` or `Bot`.
    def initialize: (String) -> void
    def post: (String, from: User | Bot) -> Message   # Method
overloading is supported.
            | (File, from: User | Bot) -> Message
  end
end
```
See [README of rbs gem](https://github.com/ruby/rbs) for more detail.
### TypeProf
TypeProf is a type analysis tool bundled in the Ruby package.
Currently, TypeProf serves as a kind of type inference.
It reads plain (non-type-annotated) Ruby code, analyzes what methods
are defined and how they are used, and generates a prototype of type
signature in RBS format.
Here is a simple demo of TypeProf.
An example input:
```ruby
# test.rb
class User
  def initialize(name:, age:)
    @name, @age = name, age
  end
  attr_reader :name, :age
end
User.new(name: "John", age: 20)
```
An example output:
```
$ typeprof test.rb
# Classes
class User
  attr_reader name : String
  attr_reader age : Integer
  def initialize : (name: String, age: Integer) -> [String, Integer]
end
```
You can run TypeProf by saving the input as "test.rb" and invoke a
command called "typeprof test.rb".
You can also [try TypeProf
online](https://mame.github.io/typeprof-playground/#rb=%23+test.rb%0Aclass+User%0A++def+initialize%28name%3A%2C+age%3A%29%0A++++%40name%2C+%40age+%3D+name%2C+age%0A++end%0A++%0A++attr_reader+%3Aname%2C+%3Aage%0Aend%0A%0AUser.new%28name%3A+%22John%22%2C+age%3A+20%29&rbs=).
(It runs TypeProf on the server side, so sorry if it is out!)
See [the documentation](https://github.com/ruby/typeprof/blob/master/doc/doc.md)
and [demos](https://github.com/ruby/typeprof/blob/master/doc/demo.md)
for details.
TypeProf is experimental and not so mature yet; only a subset of the
Ruby language is supported, and the detection of type errors is
limited. But it is still growing rapidly to improve the coverage of
language features, the analysis performance, and usability. Any
feedback is very welcome.
## Ractor (experimental)
Ractor is an Actor-model like concurrent abstraction designed to
provide a parallel execution feature without thread-safety concerns.
You can make multiple ractors and you can run them in parallel. Ractor
enables you to make thread-safe parallel programs because ractors can
not share normal objects. Communication between ractors are supported
by message passing.
To limit sharing of objects, Ractor introduces several restrictions to
the Ruby's syntax (without multiple Ractors, there is no restriction).
The specification and implmentation are not matured and may be changed
in the future, so this feature is marked as experimental and show the
"experimental feature" warning when the first `Ractor.new`.
The following small program calculates `n.prime?` (`n` is relatively a
big integer) in parallel with two ractors. You will confirm that the
program execution is about x2 times faster ompare with the sequential
program on the parallel computer.
```ruby
require 'prime'
# n.prime? with sent integers in r1, r2 run in parallel
r1, r2 = *(1..2).map do
  Ractor.new do
    n = Ractor.recv
    n.prime?
  end
end
# send parameters
r1.send 2**61 - 1
r2.send 2**61 + 15
# wait for the results of expr1, expr2
p r1.take #=> true
p r2.take #=> true
```
See [doc/ractor.md](https://github.com/ruby/ruby/blob/master/doc/ractor.md)
for more details.
## Fiber Scheduler
`Fiber#scheduler` is introduced for intercepting blocking operations.
This allows for light-weight concurrency without changing existing
code. Watch ["Don't Wait For Me, Scalable Concurrency for Ruby
3"](https://www.youtube.com/watch?v=Y29SSOS4UOc) for an overview of
how it works.
Currently supported classes/methods:
- `Mutex#lock`, `Mutex#unlock`, `Mutex#sleep`
- `ConditionVariable#wait`
- `Queue#pop`, `SizedQueue#push`
- `Thread#join`
- `Kernel#sleep`
- `Process.wait`
- `IO#wait`, `IO#read`, `IO#write` and related methods (e.g.
`#wait_readable`, `#gets`, `#puts` and so on).
- `IO#select` is *not supported*.
(Explain Async gem with links). This example program will perform
several HTTP requests concurrently:
(Explain this:)
1. async is outer gem
2. async uses this new feature
``` ruby
require 'async'
require 'net/http'
require 'uri'
Async do
  ["ruby", "python", "c"].each do |topic|
    Async do
      Net::HTTP.get(URI "https://www.google.com/search?q=#{topic}")
    end
  end
end
```
## Other Notable New Features
* One-line pattern matching now uses `=>` instead of `in`.
    ```ruby
    # version 3.0
    {a: 0, b: 1} => {a:}
    p a # => 0
    # version 2.7
    {a: 0, b: 1} in {a:}
    p a # => 0
    ```
* Find pattern is added.
    ```ruby
    case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
    in [*pre, String => x, String => y, *post]
      p pre  #=> ["a", 1]
      p x    #=> "b"
      p y    #=> "c"
      p post #=> [2, "d", "e", "f", 3]
    end
    ```
* Endless method definition is added.
  ```ruby
  def square(x) = x * x
  ```
* Find pattern is added.
  ```ruby
  case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
  in [*pre, String => x, String => y, *post]
    p pre  #=> ["a", 1]
    p x    #=> "b"
    p y    #=> "c"
    p post #=> [2, "d", "e", "f", 3]
  end
  ```
* `Hash#except` is now built-in.
  ```ruby
  h = { a: 1, b: 2, c: 3 }
  p h.except(:a) #=> {:b=>2, :c=>3}
  ```
* Memory view is added as an experimental feature
    * This is a new C-API set to exchange a raw memory area, such as a
numeric array and a bitmap image, between extension libraries.  The
extension libraries can share also the metadata of the memory area
that consists of the shape, the element format, and so on.  Using
these kinds of metadata, the extension libraries can share even a
multidimensional array appropriately.  This feature is designed by
referring to Python's buffer protocol.
## Performance improvements
* Many improvements were implemented in MJIT. See NEWS in detail.
* Pasting long code to IRB is 53 times faster than bundled with Ruby
2.7.0. For example, the time required to paste [this sample
code](https://gist.github.com/aycabta/30ab96334275bced5796f118c9220b0b)
goes from 11.7 seconds to 0.22 seconds.
## Other notable changes since 2.7
* Keyword arguments are separated from other arguments.
  * In principle, code that prints a warning on Ruby 2.7 won't work.
See the [document](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
in detail.
  * By the way, arguments forwarding now supports leading arguments.
    ```ruby
    def method_missing(meth, ...)
      send(:"do_#{ meth }", ...)
    end
    ```
* The `$SAFE` feature was completely removed; now it is a normal
global variable.
* The order of backtrace had been reversed at Ruby 2.5, and is
reverted.  Now it behaves like Ruby 2.4; an error message and the line
number where the exception occurs are printed first, and its callers
are printed later.
* Some standard libraries are updated.
  * RubyGems 3.2.0.rc.1
  * Bundler 2.2.0.rc.1
  * IRB 1.2.6
  * Reline 0.1.5
* The following libraries are no longer bundled gems.
  Install the corresponding gems to use these features.
  * net-telnet
  * xmlrpc
* The following default gems are now bundled gems.
  * rexml
  * rss
* The following stdlib files are now default gems and are published on
rubygems.org.
  * abbrev
  * base64
  * English
  * erb
  * find
  * io-nonblock
  * io-wait
  * net-ftp
  * net-http
  * net-imap
  * net-protocol
  * nkf
  * open-uri
  * optparse
  * resolv
  * resolv-replace
  * rinda
  * securerandom
  * set
  * shellwords
  * tempfile
  * time
  * tmpdir
  * tsort
  * weakref
See [NEWS](https://github.com/ruby/ruby/blob/v3_0_0_preview2/NEWS.md)
or [commit logs](https://github.com/ruby/ruby/compare/v2_7_0...v3_0_0_preview2)
for more details.
With those changes, [3776 files changed, 181573 insertions(+), 145096
deletions(-)](https://github.com/ruby/ruby/compare/v2_7_0...v3_0_0_preview2)
since Ruby 2.7.0!
Please try Ruby 3.0.0-preview2, and give us any feedback!
## Download
* <https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0-preview2.tar.gz>
      SIZE: 19378626
      SHA1: 25363b20225850224e7835e99906c52f2ff57792
      SHA256: 9de8661565c2b1007d91a580e9a7e02d23f1e8fc8df371feb15a2727aa05fd9a
      SHA512: 6fa4191425ae71e41894b60bd9c31d483a562ee8216886360ce18238ab48115b95be0367708612c45f634e7584fba8940a524ba0113ce0f36ce4df78a112d0b7
* <https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0-preview2.tar.xz>
      SIZE: 14244252
      SHA1: 54e4d3892ce480106382bd2d36dd7395e01b0f2a
      SHA256: 03078e82d4fb55c13837c69e56565fc49c451d11b1ca5e1b075d990d0957f181
      SHA512: 8b0e6e3ba7e5f95586b4438d965e7b09187ad599f4ac22dec3db7b176358514fe0c0890dde8912fef1ef92ffcde3f6f1228178eabadcf3a05601e5b6f05881ae
* <https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0-preview2.zip>
      SIZE: 23907144
      SHA1: 064ee265c94b3df87e737622ba84437ea0d6aeaf
      SHA256: 19e295ae50934ddac2b366f0c7c8de9bd710d596b76eba02152f3641e5ce2b23
      SHA512: 598def50ef9e8ae1f44e05ff2c4e35acf252437286f08644ba5e301ebff2db399140bafa72868877100d6ffa736a4474cb7b99ecea8bdf835ed113ab250bb3d9
## What is Ruby
Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993,
and is now developed as Open Source. It runs on multiple platforms
and is used all over the world especially for web development.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next