RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2

Ruby

Product
Date of the premiere of the system: 1995
Technology: Application Development Tools

Content

Ruby logo

Ruby is a dynamic, reflective, interpreted high-level programming language. Ruby's creator is Yukihiro Matsumoto (Matz).

2022: Ruby 3.2.0

On December 25, 2022, it became known that Ruby 3.2.0, a dynamic object-oriented programming language, was released, which was characterized by the effectiveness of program development and incorporated the features of Perl, Java, Python, Smalltalk, Eiffel, Ada and Lisp. The project code is distributed under the BSD licenses ("2-clause BSDL") and "Ruby," which refers to the latest version of the GPL license and is fully compatible with GPLv3.

As reported, major changes include the following:

  • Added the initial port of the CRuby interpreter, compiled into intermediate WebAssembly code to run in a web browser or under the control of separate runtime, such as wasmtime. For direct interaction with the operating system during a separate launch, the WASI (WebAssembly System Interface) API is used. Among other things, VFS binding is provided over WASI, which allows you to package the entire Ruby application into a view as a single wasm file. Running in a browser can be used to create training and demo web services such as TryRuby. At the current stage of development, the port passes the basic and bootstrap test sets, which do not use the Thread API. The port also does not support Fiber, exceptions, or garbage collection.
  • Declared stable and ready for operational use by the in-process JIT compiler YJIT, created by the developers e-commerce of the Shopify platform as part of an initiative to increase the performance of Ruby programs that use the Rails framework and call many methods. A key difference from the previously used JIT compiler MJIT, based on the processing of methods in its entirety and using an external compiler in the language, Xi is that YJIT uses basic block versioning (LBBV - Lazy Basic Block Versioning) and contains an integrated JIT compiler. Thanks to LBBV, JIT first compiles only the beginning of the method, and compiles the rest after a while, after the types of variables and arguments used are determined during execution. YJIT is available for x86-64 and arm64/aarch64 architectures in,, Linux macOS BSD and other - UNIX platforms. Unlike CRuby, the YJIT code is written in Rust and requires the presence of the rustc 1.58.0 + compiler for compilation, so the YJIT assembly is disabled by default and is optional. When using YJIT, performance optimization was recorded when performing the yjit-bench test by 41% compared to using interpretation.
  • Added additional protection against denial of service attacks when processing external data in inefficient and long-running regular expressions (ReDoS). The mapping algorithm is optimized, which uses the memoization technique. For example, the execution time of the expression '/ ^a*b?a*$/= ~ "a" * 50000 + "x" 'was reduced from 10 to 0.003 seconds. The cost of optimization is an increase in memory consumption, the consumption of which is about 10 times higher than the size of the input data. The second measure of protection is the ability to determine the timeout (for example, "Regexp.timeout = 1.0"), which should have time to process a regular expression.
  • The composition includes a syntax_suggest mode that helps diagnose the causes of errors associated with a missing or superfluous closing expression "end." The ability to mark arguments for errors associated with types and arguments has been added to the error location display mode.
  • Syntax added to redirect to other methods of argument sets:

def foo(*)

bar(*)

end

def baz(**)

quux(**)

end

  • A ruby_vm/mjit/compiler is proposed - a version of the old JIT compiler MJIT, rewritten in Ruby. MJIT execution is provided in a separate process, instead of execution in the MJIT worker thread.
  • Bundler 2.4 uses the PubGrub versioner when processing dependencies, which is also used in the pub package manager for the Dart language. The previously used Molinillo algorithm continues to be used in RubyGems, but will also be replaced by PubGrub in the future.
  • Updated versions of built-in and included in the standard library of gem modules[1].

Programming languages

See also

Notes