♊️ GemiNews 🗞️ (dev)

Demo 1: Embeddings + Recommendation Demo 2: Bella RAGa Demo 3: NewRetriever Demo 4: Assistant function calling

🗞️Ruby 3.3.0 Released

🗿Semantically Similar Articles (by :title_embedding)

Ruby 3.3.0 Released

2023-12-25 - (from Ruby (EN RSS))

We are pleased to announce the release of Ruby 3.3.0. Ruby 3.3 adds a new parser named Prism, uses Lrama as a parser generator, adds a new pure-Ruby JIT compiler named RJIT, and many performance improvements especially YJIT. Prism Introduced the Prism parser as a default gem Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language Prism is production ready and actively maintained, you can use it in place of Ripper There is extensive documentation on how to use Prism Prism is both a C library that will be used internally by CRuby and a Ruby gem that can be used by any tooling which needs to parse Ruby code Notable methods in the Prism API are: Prism.parse(source) which returns the AST as part of a parse result object Prism.parse_comments(source) which returns the comments Prism.parse_success?(source) which returns true if there are no errors You can make pull requests or issues directly on the Prism repository if you are interested in contributing You can now use ruby --parser=prism or RUBYOPT="--parser=prism" to experiment with the Prism compiler. Please note that this flag is for debugging only. Use Lrama instead of Bison Replace Bison with Lrama LALR parser generator [Feature #19637] If you have interest, please see The future vision of Ruby Parser Lrama internal parser is replaced with LR parser generated by Racc for maintainability Parameterizing Rules (?, *, +) are supported, it will be used in Ruby parse.y YJIT Major performance improvements over Ruby 3.2 Support for splat and rest arguments has been improved. Registers are allocated for stack operations of the virtual machine. More calls with optional arguments are compiled. Exception handlers are also compiled. Unsupported call types and megamorphic call sites no longer exit to the interpreter. Basic methods like Rails #blank? and specialized #present? are inlined. Integer#*, Integer#!=, String#!=, String#getbyte, Kernel#block_given?, Kernel#is_a?, Kernel#instance_of?, and Module#=== are specially optimized. Compilation speed is now slightly faster than Ruby 3.2. Now more than 3x faster than the interpreter on Optcarrot! Significantly improved memory usage over Ruby 3.2 Metadata for compiled code uses a lot less memory. --yjit-call-threshold is automatically raised from 30 to 120 when the application has more than 40,000 ISEQs. --yjit-cold-threshold is added to skip compiling cold ISEQs. More compact code is generated on Arm64. Code GC is now disabled by default --yjit-exec-mem-size is treated as a hard limit where compilation of new code stops. No sudden drops in performance due to code GC. Better copy-on-write behavior on servers reforking with Pitchfork. You can still enable code GC if desired with --yjit-code-gc Add RubyVM::YJIT.enable that can enable YJIT at run-time You can start YJIT without modifying command-line arguments or environment variables. Rails 7.2 will enable YJIT by default using this method. This can also be used to enable YJIT only once your application is done booting. --yjit-disable can be used if you want to use other YJIT options while disabling YJIT at boot. More YJIT stats are available by default yjit_alloc_size and several more metadata-related stats are now available by default. ratio_in_yjit stat produced by --yjit-stats is now available in release builds, a special stats or dev build is no longer required to access most stats. Add more profiling capabilities --yjit-perf is added to facilitate profiling with Linux perf. --yjit-trace-exits now supports sampling with --yjit-trace-exits-sample-rate=N More thorough testing and multiple bug fixes RJIT Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT. RJIT supports only x86-64 architecture on Unix platforms. Unlike MJIT, it doesn’t require a C compiler at runtime. RJIT exists only for experimental purposes. You should keep using YJIT in production. If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi. M:N thread scheduler M:N thread scheduler was introduced. [Feature #19842] M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced. It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default. RUBY_MN_THREADS=1 environment variable enables M:N threads on the main Ractor. M:N threads are always enabled on non-main Ractors. RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8. Since only one Ruby thread per Ractor can run at the same time, the number of native threads will be used, which is the smaller of the number specified in RUBY_MAX_CPU and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread. To support blocking operations, more than N native threads can be used. Performance improvements defined?(@ivar) is optimized with Object Shapes. Name resolution such as Socket.getaddrinfo can now be interrupted (in environments where pthreads are available). [Feature #19965] Several performance improvements to the Garbage Collector Young objects referenced by old objects are no longer immediately promoted to the old generation. This significantly reduces the frequency of major GC collections. [Feature #19678] A new REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO tuning variable was introduced to control the number of unprotected objects cause a major GC collection to trigger. The default is set to 0.01 (1%). This significantly reduces the frequency of major GC collection. [Feature #19571] Write Barriers were implemented for many core types that were missing them, notably Time, Enumerator, MatchData, Method, File::Stat, BigDecimal and several others. This significantly reduces minor GC collection time and major GC collection frequency. Most core classes are now using Variable Width Allocation, notably Hash, Time, Thread::Backtrace, Thread::Backtrace::Location, File::Stat, Method. This makes these classes faster to allocate and free, use less memory and reduce heap fragmentation. Support for weak references has been added to the garbage collector. [Feature #19783] Other notable changes since 3.2 IRB IRB has received several enhancements, including but not limited to: Advanced irb:rdbg integration that provides an equivalent debugging experience to pry-byebug (doc). Pager support for ls, show_source and show_cmds commands. More accurate and helpful information provided by the ls and show_source commands. Experimental autocompletion using type analysis (doc). It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (doc) In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements. For more detailed updates, please refer to Unveiling the big leap in Ruby 3.3’s IRB. Compatibility issues Note: Excluding feature bug fixes. it calls without arguments in a block with no ordinary parameters are deprecated. it will be a reference to the first block parameter in Ruby 3.4. [Feature #18980] Removed environment variables The following deprecated methods are removed. Environment variable RUBY_GC_HEAP_INIT_SLOTS has been deprecated and is a no-op. Please use environment variables RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS instead. [Feature #19785] Stdlib compatibility issues ext/readline is retired We have reline that is pure Ruby implementation compatible with ext/readline API. We rely on reline in the future. If you need to use ext/readline, you can install ext/readline via rubygems.org with gem install readline-ext. We no longer need to install libraries like libreadline or libedit. Standard library updates RubyGems and Bundler warn if users do require the following gems without adding them to Gemfile or gemspec. This is because they will become the bundled gems in the future version of Ruby. This warning is suppressed if you use bootsnap gem. We recommend to run your application with DISABLE_BOOTSNAP=1 environment variable at least once. This is limitation of this version. Targeted libraries are: abbrev base64 bigdecimal csv drb getoptlong mutex_m nkf observer racc resolv-replace rinda syslog The following default gem is added. prism 0.19.0 The following default gems are updated. RubyGems 3.5.3 abbrev 0.1.2 base64 0.2.0 benchmark 0.3.0 bigdecimal 3.1.5 bundler 2.5.3 cgi 0.4.1 csv 3.2.8 date 3.3.4 delegate 0.3.1 drb 2.2.0 english 0.8.0 erb 4.0.3 error_highlight 0.6.0 etc 1.4.3 fcntl 1.1.0 fiddle 1.1.2 fileutils 1.7.2 find 0.2.0 getoptlong 0.2.1 io-console 0.7.1 io-nonblock 0.3.0 io-wait 0.3.1 ipaddr 1.2.6 irb 1.11.0 json 2.7.1 logger 1.6.0 mutex_m 0.2.0 net-http 0.4.0 net-protocol 0.2.2 nkf 0.1.3 observer 0.1.2 open-uri 0.4.1 open3 0.2.1 openssl 3.2.0 optparse 0.4.0 ostruct 0.6.0 pathname 0.3.0 pp 0.5.0 prettyprint 0.2.0 pstore 0.1.3 psych 5.1.2 rdoc 6.6.2 readline 0.0.4 reline 0.4.1 resolv 0.3.0 rinda 0.2.0 securerandom 0.3.1 set 1.1.0 shellwords 0.2.0 singleton 0.2.0 stringio 3.1.0 strscan 3.0.7 syntax_suggest 2.0.0 syslog 0.1.2 tempfile 0.2.1 time 0.3.0 timeout 0.4.1 tmpdir 0.2.0 tsort 0.2.0 un 0.3.0 uri 0.13.0 weakref 0.1.3 win32ole 1.8.10 yaml 0.3.0 zlib 3.1.0 The following bundled gem is promoted from default gems. racc 1.7.3 The following bundled gems are updated. minitest 5.20.0 rake 13.1.0 test-unit 3.6.1 rexml 3.2.6 rss 0.3.0 net-ftp 0.3.3 net-imap 0.4.9 net-smtp 0.4.0 rbs 3.4.0 typeprof 0.21.9 debug 1.9.1 See GitHub releases like Logger or changelog for details of the default gems or bundled gems. See NEWS or commit logs for more details. With those changes, 5532 files changed, 326851 insertions(+), 185793 deletions(-) since Ruby 3.2.0! Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3! Download https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz SIZE: 22065999 SHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b SHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d SHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6 https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz SIZE: 16345456 SHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6 SHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b SHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01 https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip SIZE: 26935108 SHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1 SHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8 SHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450 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. Posted by naruse on 25 Dec 2023

empty

[Technology] 🌎 https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/ [🧠] [v2] article_embedding_description: {:llm_project_id=>"Unavailable", :llm_dimensions=>nil, :article_size=>20525, :llm_embeddings_model_name=>"textembedding-gecko"}
[🧠] [v1/3] title_embedding_description: {:ricc_notes=>"[embed-v3] Fixed on 9oct24. Only seems incompatible at first glance with embed v1.", :llm_project_id=>"unavailable possibly not using Vertex", :llm_dimensions=>nil, :article_size=>20525, :poly_field=>"title", :llm_embeddings_model_name=>"textembedding-gecko"}
[🧠] [v1/3] summary_embedding_description: {:ricc_notes=>"[embed-v3] Fixed on 9oct24. Only seems incompatible at first glance with embed v1.", :llm_project_id=>"unavailable possibly not using Vertex", :llm_dimensions=>nil, :article_size=>20525, :poly_field=>"summary", :llm_embeddings_model_name=>"textembedding-gecko"}
[🧠] As per bug https://github.com/palladius/gemini-news-crawler/issues/4 we can state this article belongs to titile/summary version: v3 (very few articles updated on 9oct24)

🗿article.to_s

------------------------------
Title: Ruby 3.3.0 Released
Summary: We are pleased to announce the release of Ruby 3.3.0. Ruby 3.3 adds a new parser named Prism, uses Lrama as a parser generator, adds a new pure-Ruby JIT compiler named RJIT, and many performance improvements especially YJIT.

Prism


  Introduced the Prism parser as a default gem
    
      Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language
    
  
  Prism is production ready and actively maintained, you can use it in place of Ripper
    
      There is extensive documentation on how to use Prism
      Prism is both a C library that will be used internally by CRuby and a Ruby gem that can be used by any tooling which needs to parse Ruby code
      Notable methods in the Prism API are:
        
          Prism.parse(source) which returns the AST as part of a parse result object
          Prism.parse_comments(source) which returns the comments
          Prism.parse_success?(source) which returns true if there are no errors
        
      
    
  
  You can make pull requests or issues directly on the Prism repository if you are interested in contributing
  You can now use ruby --parser=prism or RUBYOPT="--parser=prism" to experiment with the Prism compiler. Please note that this flag is for debugging only.


Use Lrama instead of Bison


  Replace Bison with Lrama LALR parser generator [Feature #19637]
    
      If you have interest, please see The future vision of Ruby Parser
      Lrama internal parser is replaced with LR parser generated by Racc for maintainability
      Parameterizing Rules (?, *, +) are supported, it will be used in Ruby parse.y
    
  


YJIT


  Major performance improvements over Ruby 3.2
    
      Support for splat and rest arguments has been improved.
      Registers are allocated for stack operations of the virtual machine.
      More calls with optional arguments are compiled. Exception handlers are also compiled.
      Unsupported call types and megamorphic call sites no longer exit to the interpreter.
      Basic methods like Rails #blank? and
specialized #present? are inlined.
      Integer#*, Integer#!=, String#!=, String#getbyte,
Kernel#block_given?, Kernel#is_a?, Kernel#instance_of?, and Module#===
are specially optimized.
      Compilation speed is now slightly faster than Ruby 3.2.
      Now more than 3x faster than the interpreter on Optcarrot!
    
  
  Significantly improved memory usage over Ruby 3.2
    
      Metadata for compiled code uses a lot less memory.
      --yjit-call-threshold is automatically raised from 30 to 120
when the application has more than 40,000 ISEQs.
      --yjit-cold-threshold is added to skip compiling cold ISEQs.
      More compact code is generated on Arm64.
    
  
  Code GC is now disabled by default
    
      --yjit-exec-mem-size is treated as a hard limit where compilation of new code stops.
      No sudden drops in performance due to code GC.
Better copy-on-write behavior on servers reforking with
Pitchfork.
      You can still enable code GC if desired with --yjit-code-gc
    
  
  Add RubyVM::YJIT.enable that can enable YJIT at run-time
    
      You can start YJIT without modifying command-line arguments or environment variables.
Rails 7.2 will enable YJIT by default
using this method.
      This can also be used to enable YJIT only once your application is
done booting. --yjit-disable can be used if you want to use other
YJIT options while disabling YJIT at boot.
    
  
  More YJIT stats are available by default
    
      yjit_alloc_size and several more metadata-related stats are now available by default.
      ratio_in_yjit stat produced by --yjit-stats is now available in release builds,
a special stats or dev build is no longer required to access most stats.
    
  
  Add more profiling capabilities
    
      --yjit-perf is added to facilitate profiling with Linux perf.
      --yjit-trace-exits now supports sampling with --yjit-trace-exits-sample-rate=N
    
  
  More thorough testing and multiple bug fixes


RJIT


  Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT.
    
      RJIT supports only x86-64 architecture on Unix platforms.
      Unlike MJIT, it doesn’t require a C compiler at runtime.
    
  
  RJIT exists only for experimental purposes.
    
      You should keep using YJIT in production.
    
  
  If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi.


M:N thread scheduler


  M:N thread scheduler was introduced. [Feature #19842]
    
      M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced.
      It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default.
        
          RUBY_MN_THREADS=1 environment variable enables M:N threads on the main Ractor.
          M:N threads are always enabled on non-main Ractors.
        
      
      RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8.
        
          Since only one Ruby thread per Ractor can run at the same time, the number of native threads will be used, which is the smaller of the number specified in RUBY_MAX_CPU and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread.
          To support blocking operations, more than N native threads can be used.
        
      
    
  


Performance improvements


  defined?(@ivar) is optimized with Object Shapes.
  Name resolution such as Socket.getaddrinfo can now be interrupted (in environments where pthreads are available). [Feature #19965]
  Several performance improvements to the Garbage Collector
    
      Young objects referenced by old objects are no longer immediately
  promoted to the old generation. This significantly reduces the frequency of
  major GC collections. [Feature #19678]
      A new REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO tuning variable was
  introduced to control the number of unprotected objects cause a major GC
  collection to trigger. The default is set to 0.01 (1%). This significantly
  reduces the frequency of major GC collection. [Feature #19571]
      Write Barriers were implemented for many core types that were missing them,
  notably Time, Enumerator, MatchData, Method, File::Stat, BigDecimal
  and several others. This significantly reduces minor GC collection time and major
  GC collection frequency.
      Most core classes are now using Variable Width Allocation, notably Hash, Time,
  Thread::Backtrace, Thread::Backtrace::Location, File::Stat, Method.
  This makes these classes faster to allocate and free, use less memory and reduce
  heap fragmentation.
      Support for weak references has been added to the garbage collector. [Feature #19783]
    
  


Other notable changes since 3.2

IRB

IRB has received several enhancements, including but not limited to:


  Advanced irb:rdbg integration that provides an equivalent debugging experience to pry-byebug (doc).
  Pager support for ls, show_source and show_cmds commands.
  More accurate and helpful information provided by the ls and show_source commands.
  Experimental autocompletion using type analysis (doc).
  It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (doc)


In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.

For more detailed updates, please refer to Unveiling the big leap in Ruby 3.3’s IRB.

Compatibility issues

Note: Excluding feature bug fixes.


  it calls without arguments in a block with no ordinary parameters are
deprecated. it will be a reference to the first block parameter in Ruby 3.4.
[Feature #18980]


Removed environment variables

The following deprecated methods are removed.


  Environment variable RUBY_GC_HEAP_INIT_SLOTS has been deprecated and is a no-op. Please use environment variables RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS instead. [Feature #19785]


Stdlib compatibility issues

ext/readline is retired


  We have reline that is pure Ruby implementation compatible with ext/readline API. We rely on reline in the future. If you need to use ext/readline, you can install ext/readline via rubygems.org with gem install readline-ext.
  We no longer need to install libraries like libreadline or libedit.


Standard library updates

RubyGems and Bundler warn if users do require the following gems without adding them to Gemfile or gemspec. This is because they will become the bundled gems in the future version of Ruby.

This warning is suppressed if you use bootsnap gem. We recommend to run your application with DISABLE_BOOTSNAP=1 environment variable at least once. This is limitation of this version.

Targeted libraries are:

  abbrev
  base64
  bigdecimal
  csv
  drb
  getoptlong
  mutex_m
  nkf
  observer
  racc
  resolv-replace
  rinda
  syslog


The following default gem is added.


  prism 0.19.0


The following default gems are updated.


  RubyGems 3.5.3
  abbrev 0.1.2
  base64 0.2.0
  benchmark 0.3.0
  bigdecimal 3.1.5
  bundler 2.5.3
  cgi 0.4.1
  csv 3.2.8
  date 3.3.4
  delegate 0.3.1
  drb 2.2.0
  english 0.8.0
  erb 4.0.3
  error_highlight 0.6.0
  etc 1.4.3
  fcntl 1.1.0
  fiddle 1.1.2
  fileutils 1.7.2
  find 0.2.0
  getoptlong 0.2.1
  io-console 0.7.1
  io-nonblock 0.3.0
  io-wait 0.3.1
  ipaddr 1.2.6
  irb 1.11.0
  json 2.7.1
  logger 1.6.0
  mutex_m 0.2.0
  net-http 0.4.0
  net-protocol 0.2.2
  nkf 0.1.3
  observer 0.1.2
  open-uri 0.4.1
  open3 0.2.1
  openssl 3.2.0
  optparse 0.4.0
  ostruct 0.6.0
  pathname 0.3.0
  pp 0.5.0
  prettyprint 0.2.0
  pstore 0.1.3
  psych 5.1.2
  rdoc 6.6.2
  readline 0.0.4
  reline 0.4.1
  resolv 0.3.0
  rinda 0.2.0
  securerandom 0.3.1
  set 1.1.0
  shellwords 0.2.0
  singleton 0.2.0
  stringio 3.1.0
  strscan 3.0.7
  syntax_suggest 2.0.0
  syslog 0.1.2
  tempfile 0.2.1
  time 0.3.0
  timeout 0.4.1
  tmpdir 0.2.0
  tsort 0.2.0
  un 0.3.0
  uri 0.13.0
  weakref 0.1.3
  win32ole 1.8.10
  yaml 0.3.0
  zlib 3.1.0


The following bundled gem is promoted from default gems.


  racc 1.7.3


The following bundled gems are updated.


  minitest 5.20.0
  rake 13.1.0
  test-unit 3.6.1
  rexml 3.2.6
  rss 0.3.0
  net-ftp 0.3.3
  net-imap 0.4.9
  net-smtp 0.4.0
  rbs 3.4.0
  typeprof 0.21.9
  debug 1.9.1


See GitHub releases like Logger or
changelog for details of the default gems or bundled gems.

See NEWS
or commit logs
for more details.

With those changes, 5532 files changed, 326851 insertions(+), 185793 deletions(-)
since Ruby 3.2.0!

Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3!

Download


  
    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz

    SIZE: 22065999
SHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b
SHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d
SHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6
    
  
  
    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz

    SIZE: 16345456
SHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6
SHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b
SHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01
    
  
  
    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip

    SIZE: 26935108
SHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1
SHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8
SHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450
    
  


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.

Posted by naruse on 25 Dec 2023

[content]
empty
[/content]

PublishedDate: 2023-12-25
Category: Technology
NewsPaper: Ruby (EN RSS)
{"id"=>4233,
"title"=>"Ruby 3.3.0 Released",
"summary"=>"\n

We are pleased to announce the release of Ruby 3.3.0. Ruby 3.3 adds a new parser named Prism, uses Lrama as a parser generator, adds a new pure-Ruby JIT compiler named RJIT, and many performance improvements especially YJIT.

\n\n

Prism

\n\n
    \n
  • Introduced the Prism parser as a default gem\n
      \n
    • Prism is a portable, error tolerant, and maintainable recursive descent parser for the Ruby language
    • \n
    \n
  • \n
  • Prism is production ready and actively maintained, you can use it in place of Ripper\n
      \n
    • There is extensive documentation on how to use Prism
    • \n
    • Prism is both a C library that will be used internally by CRuby and a Ruby gem that can be used by any tooling which needs to parse Ruby code
    • \n
    • Notable methods in the Prism API are:\n
        \n
      • Prism.parse(source) which returns the AST as part of a parse result object
      • \n
      • Prism.parse_comments(source) which returns the comments
      • \n
      • Prism.parse_success?(source) which returns true if there are no errors
      • \n
      \n
    • \n
    \n
  • \n
  • You can make pull requests or issues directly on the Prism repository if you are interested in contributing
  • \n
  • You can now use ruby --parser=prism or RUBYOPT=\"--parser=prism\" to experiment with the Prism compiler. Please note that this flag is for debugging only.
  • \n
\n\n

Use Lrama instead of Bison

\n\n\n\n

YJIT

\n\n
    \n
  • Major performance improvements over Ruby 3.2\n
      \n
    • Support for splat and rest arguments has been improved.
    • \n
    • Registers are allocated for stack operations of the virtual machine.
    • \n
    • More calls with optional arguments are compiled. Exception handlers are also compiled.
    • \n
    • Unsupported call types and megamorphic call sites no longer exit to the interpreter.
    • \n
    • Basic methods like Rails #blank? and\nspecialized #present? are inlined.
    • \n
    • Integer#*, Integer#!=, String#!=, String#getbyte,\nKernel#block_given?, Kernel#is_a?, Kernel#instance_of?, and Module#===\nare specially optimized.
    • \n
    • Compilation speed is now slightly faster than Ruby 3.2.
    • \n
    • Now more than 3x faster than the interpreter on Optcarrot!
    • \n
    \n
  • \n
  • Significantly improved memory usage over Ruby 3.2\n
      \n
    • Metadata for compiled code uses a lot less memory.
    • \n
    • --yjit-call-threshold is automatically raised from 30 to 120\nwhen the application has more than 40,000 ISEQs.
    • \n
    • --yjit-cold-threshold is added to skip compiling cold ISEQs.
    • \n
    • More compact code is generated on Arm64.
    • \n
    \n
  • \n
  • Code GC is now disabled by default\n
      \n
    • --yjit-exec-mem-size is treated as a hard limit where compilation of new code stops.
    • \n
    • No sudden drops in performance due to code GC.\nBetter copy-on-write behavior on servers reforking with\nPitchfork.
    • \n
    • You can still enable code GC if desired with --yjit-code-gc
    • \n
    \n
  • \n
  • Add RubyVM::YJIT.enable that can enable YJIT at run-time\n
      \n
    • You can start YJIT without modifying command-line arguments or environment variables.\nRails 7.2 will enable YJIT by default\nusing this method.
    • \n
    • This can also be used to enable YJIT only once your application is\ndone booting. --yjit-disable can be used if you want to use other\nYJIT options while disabling YJIT at boot.
    • \n
    \n
  • \n
  • More YJIT stats are available by default\n
      \n
    • yjit_alloc_size and several more metadata-related stats are now available by default.
    • \n
    • ratio_in_yjit stat produced by --yjit-stats is now available in release builds,\na special stats or dev build is no longer required to access most stats.
    • \n
    \n
  • \n
  • Add more profiling capabilities\n
      \n
    • --yjit-perf is added to facilitate profiling with Linux perf.
    • \n
    • --yjit-trace-exits now supports sampling with --yjit-trace-exits-sample-rate=N
    • \n
    \n
  • \n
  • More thorough testing and multiple bug fixes
  • \n
\n\n

RJIT

\n\n
    \n
  • Introduced a pure-Ruby JIT compiler RJIT and replaced MJIT.\n
      \n
    • RJIT supports only x86-64 architecture on Unix platforms.
    • \n
    • Unlike MJIT, it doesn’t require a C compiler at runtime.
    • \n
    \n
  • \n
  • RJIT exists only for experimental purposes.\n
      \n
    • You should keep using YJIT in production.
    • \n
    \n
  • \n
  • If you are interested in developing JIT for Ruby, please check out k0kubun’s presentation on Day 3 of RubyKaigi.
  • \n
\n\n

M:N thread scheduler

\n\n
    \n
  • M:N thread scheduler was introduced. [Feature #19842]\n
      \n
    • M Ruby threads are managed by N native threads (OS threads) so the thread creation and management cost are reduced.
    • \n
    • It can break C-extension compatibility so that M:N thread scheduler is disabled on the main Ractor by default.\n
        \n
      • RUBY_MN_THREADS=1 environment variable enables M:N threads on the main Ractor.
      • \n
      • M:N threads are always enabled on non-main Ractors.
      • \n
      \n
    • \n
    • RUBY_MAX_CPU=n environment variable sets maximum number of N (maximum number of native threads). The default value is 8.\n
        \n
      • Since only one Ruby thread per Ractor can run at the same time, the number of native threads will be used, which is the smaller of the number specified in RUBY_MAX_CPU and the number of running Ractors. So that single Ractor applications (most of applications) will only use 1 native thread.
      • \n
      • To support blocking operations, more than N native threads can be used.
      • \n
      \n
    • \n
    \n
  • \n
\n\n

Performance improvements

\n\n
    \n
  • defined?(@ivar) is optimized with Object Shapes.
  • \n
  • Name resolution such as Socket.getaddrinfo can now be interrupted (in environments where pthreads are available). [Feature #19965]
  • \n
  • Several performance improvements to the Garbage Collector\n
      \n
    • Young objects referenced by old objects are no longer immediately\n promoted to the old generation. This significantly reduces the frequency of\n major GC collections. [Feature #19678]
    • \n
    • A new REMEMBERED_WB_UNPROTECTED_OBJECTS_LIMIT_RATIO tuning variable was\n introduced to control the number of unprotected objects cause a major GC\n collection to trigger. The default is set to 0.01 (1%). This significantly\n reduces the frequency of major GC collection. [Feature #19571]
    • \n
    • Write Barriers were implemented for many core types that were missing them,\n notably Time, Enumerator, MatchData, Method, File::Stat, BigDecimal\n and several others. This significantly reduces minor GC collection time and major\n GC collection frequency.
    • \n
    • Most core classes are now using Variable Width Allocation, notably Hash, Time,\n Thread::Backtrace, Thread::Backtrace::Location, File::Stat, Method.\n This makes these classes faster to allocate and free, use less memory and reduce\n heap fragmentation.
    • \n
    • Support for weak references has been added to the garbage collector. [Feature #19783]
    • \n
    \n
  • \n
\n\n

Other notable changes since 3.2

\n\n

IRB

\n\n

IRB has received several enhancements, including but not limited to:

\n\n
    \n
  • Advanced irb:rdbg integration that provides an equivalent debugging experience to pry-byebug (doc).
  • \n
  • Pager support for ls, show_source and show_cmds commands.
  • \n
  • More accurate and helpful information provided by the ls and show_source commands.
  • \n
  • Experimental autocompletion using type analysis (doc).
  • \n
  • It is now possible to change the font color and font style in the completion dialog by a newly introduced class Reline::Face (doc)
  • \n
\n\n

In addition, IRB has also undergone extensive refactoring and received dozens of bug fixes to facilitate easier future enhancements.

\n\n

For more detailed updates, please refer to Unveiling the big leap in Ruby 3.3’s IRB.

\n\n

Compatibility issues

\n\n

Note: Excluding feature bug fixes.

\n\n
    \n
  • it calls without arguments in a block with no ordinary parameters are\ndeprecated. it will be a reference to the first block parameter in Ruby 3.4.\n[Feature #18980]
  • \n
\n\n

Removed environment variables

\n\n

The following deprecated methods are removed.

\n\n
    \n
  • Environment variable RUBY_GC_HEAP_INIT_SLOTS has been deprecated and is a no-op. Please use environment variables RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS instead. [Feature #19785]
  • \n
\n\n

Stdlib compatibility issues

\n\n

ext/readline is retired

\n\n
    \n
  • We have reline that is pure Ruby implementation compatible with ext/readline API. We rely on reline in the future. If you need to use ext/readline, you can install ext/readline via rubygems.org with gem install readline-ext.
  • \n
  • We no longer need to install libraries like libreadline or libedit.
  • \n
\n\n

Standard library updates

\n\n

RubyGems and Bundler warn if users do require the following gems without adding them to Gemfile or gemspec. This is because they will become the bundled gems in the future version of Ruby.

\n\n

This warning is suppressed if you use bootsnap gem. We recommend to run your application with DISABLE_BOOTSNAP=1 environment variable at least once. This is limitation of this version.

\n\n

Targeted libraries are:

\n
    \n
  • abbrev
  • \n
  • base64
  • \n
  • bigdecimal
  • \n
  • csv
  • \n
  • drb
  • \n
  • getoptlong
  • \n
  • mutex_m
  • \n
  • nkf
  • \n
  • observer
  • \n
  • racc
  • \n
  • resolv-replace
  • \n
  • rinda
  • \n
  • syslog
  • \n
\n\n

The following default gem is added.

\n\n
    \n
  • prism 0.19.0
  • \n
\n\n

The following default gems are updated.

\n\n
    \n
  • RubyGems 3.5.3
  • \n
  • abbrev 0.1.2
  • \n
  • base64 0.2.0
  • \n
  • benchmark 0.3.0
  • \n
  • bigdecimal 3.1.5
  • \n
  • bundler 2.5.3
  • \n
  • cgi 0.4.1
  • \n
  • csv 3.2.8
  • \n
  • date 3.3.4
  • \n
  • delegate 0.3.1
  • \n
  • drb 2.2.0
  • \n
  • english 0.8.0
  • \n
  • erb 4.0.3
  • \n
  • error_highlight 0.6.0
  • \n
  • etc 1.4.3
  • \n
  • fcntl 1.1.0
  • \n
  • fiddle 1.1.2
  • \n
  • fileutils 1.7.2
  • \n
  • find 0.2.0
  • \n
  • getoptlong 0.2.1
  • \n
  • io-console 0.7.1
  • \n
  • io-nonblock 0.3.0
  • \n
  • io-wait 0.3.1
  • \n
  • ipaddr 1.2.6
  • \n
  • irb 1.11.0
  • \n
  • json 2.7.1
  • \n
  • logger 1.6.0
  • \n
  • mutex_m 0.2.0
  • \n
  • net-http 0.4.0
  • \n
  • net-protocol 0.2.2
  • \n
  • nkf 0.1.3
  • \n
  • observer 0.1.2
  • \n
  • open-uri 0.4.1
  • \n
  • open3 0.2.1
  • \n
  • openssl 3.2.0
  • \n
  • optparse 0.4.0
  • \n
  • ostruct 0.6.0
  • \n
  • pathname 0.3.0
  • \n
  • pp 0.5.0
  • \n
  • prettyprint 0.2.0
  • \n
  • pstore 0.1.3
  • \n
  • psych 5.1.2
  • \n
  • rdoc 6.6.2
  • \n
  • readline 0.0.4
  • \n
  • reline 0.4.1
  • \n
  • resolv 0.3.0
  • \n
  • rinda 0.2.0
  • \n
  • securerandom 0.3.1
  • \n
  • set 1.1.0
  • \n
  • shellwords 0.2.0
  • \n
  • singleton 0.2.0
  • \n
  • stringio 3.1.0
  • \n
  • strscan 3.0.7
  • \n
  • syntax_suggest 2.0.0
  • \n
  • syslog 0.1.2
  • \n
  • tempfile 0.2.1
  • \n
  • time 0.3.0
  • \n
  • timeout 0.4.1
  • \n
  • tmpdir 0.2.0
  • \n
  • tsort 0.2.0
  • \n
  • un 0.3.0
  • \n
  • uri 0.13.0
  • \n
  • weakref 0.1.3
  • \n
  • win32ole 1.8.10
  • \n
  • yaml 0.3.0
  • \n
  • zlib 3.1.0
  • \n
\n\n

The following bundled gem is promoted from default gems.

\n\n
    \n
  • racc 1.7.3
  • \n
\n\n

The following bundled gems are updated.

\n\n
    \n
  • minitest 5.20.0
  • \n
  • rake 13.1.0
  • \n
  • test-unit 3.6.1
  • \n
  • rexml 3.2.6
  • \n
  • rss 0.3.0
  • \n
  • net-ftp 0.3.3
  • \n
  • net-imap 0.4.9
  • \n
  • net-smtp 0.4.0
  • \n
  • rbs 3.4.0
  • \n
  • typeprof 0.21.9
  • \n
  • debug 1.9.1
  • \n
\n\n

See GitHub releases like Logger or\nchangelog for details of the default gems or bundled gems.

\n\n

See NEWS\nor commit logs\nfor more details.

\n\n

With those changes, 5532 files changed, 326851 insertions(+), 185793 deletions(-)\nsince Ruby 3.2.0!

\n\n

Merry Christmas, Happy Holidays, and enjoy programming with Ruby 3.3!

\n\n

Download

\n\n
    \n
  • \n

    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz

    \n\n
    SIZE: 22065999\nSHA1: 1a7e56851bf29bda1183aca99b3b323c58e0187b\nSHA256: 96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d\nSHA512: 26074009b501fc793d71a74e419f34a6033c9353433919ca74ba2d24a3de432dbb11fd92c2bc285f0e4d951a6d6c74bf5b69a2ab36200c8c26e871746d6e0fc6\n
    \n
  • \n
  • \n

    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz

    \n\n
    SIZE: 16345456\nSHA1: c8f68e1b0a114b90460a0b44165a3b2f540fa5b6\nSHA256: 676b65a36e637e90f982b57b059189b3276b9045034dcd186a7e9078847b975b\nSHA512: 7959c5753bfa0bfc4d6d74060869aabbe9815c1c97930659da11b917ee0803ddbbd80e869e00c48b8694b4ba48709c3b6493fd045568e36e902616c35ababf01\n
    \n
  • \n
  • \n

    https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.zip

    \n\n
    SIZE: 26935108\nSHA1: a433eef1d7f96daeaf3b4cb842d0ed2dd82e7dc1\nSHA256: 0e6563f679dd3694732eb3addf9de681c67b584602ac574376b60e7a509d2cd8\nSHA512: a94a85937a14b217c1f4b90d24185289ed4aee79239c4f3eecf8034d3fd34e65ee8d66869473857ed153067188adc9b70c0471e4ebe842c9f98ef60c34090450\n
    \n
  • \n
\n\n

What is Ruby

\n\n

Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993,\nand is now developed as Open Source. It runs on multiple platforms\nand is used all over the world especially for web development.

\n\n

Posted by naruse on 25 Dec 2023

",
"content"=>"",
"author"=>nil,
"link"=>"https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/",
"published_date"=>Mon, 25 Dec 2023 00:00:00.000000000 UTC +00:00,
"image_url"=>nil,
"feed_url"=>"https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/",
"language"=>nil,
"active"=>true,
"ricc_source"=>"feedjira::v1",
"created_at"=>Mon, 01 Apr 2024 20:13:37.951013000 UTC +00:00,
"updated_at"=>Mon, 21 Oct 2024 18:03:09.732600000 UTC +00:00,
"newspaper"=>"Ruby (EN RSS)",
"macro_region"=>"Technology"}
Edit this article
Back to articles