Ruby 3 : New features

Hi, This is Shubham Mishra from India,  this is the part of Ruby on Rails exploration journey.  In this post we will discuss about the ruby's some special concepts and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started...

The most recent significant version of the Ruby programming language is Ruby 3. It has a number of interesting new features and advancements and was published on December 25, 2020. We will examine some of Ruby 3's updated features in this blog.

-> Ractors Ruby 3 introduces Ractors, also referred to as Ruby Actors. They enable us to execute several threads of code concurrently without having to share memory or state. As a result, concurrent and parallel programming is made simpler, which can enhance performance and scalability. Ractors are simple to use and integrate with existing code because they are designed on top of the Thread API that already exists.

-> Type Profiling Type profiling, which is a means to examine how programmes behave at runtime and determine the kinds of objects at runtime, is introduced in Ruby 3. By helping the Ruby interpreter to produce more effective code, this can help performance. Type profiling is an optional feature that can be turned on or off at runtime.

-> Enhancing Performance A new virtual machine (MJIT) that can convert Ruby code into machine code in real time as well as performance-enhancing changes to the garbage collector are among the performance enhancements in Ruby 3. These enhancements can speed up and improve the effectiveness of Ruby programmes.

-> Pattern Matching With the help of the new pattern matching functionality in Ruby 3, we can quickly compare data structures and retrieve values. It can increase readability and maintainability of code and make it simpler to design code that interacts with complex data structures.

-> Endless Method Definition Using Ruby 3's new endless method declaration syntax, we can define methods without mentioning an end keyword. This can simplify the syntax for defining methods and increase the readability of the code.

-> Immutable Strings In Ruby 3, strings are immutable by default. This means that once a string is created, its value cannot be changed. Immutable strings can improve performance and prevent unexpected changes to data.

In conclusion, Ruby 3 is a noteworthy update that adds a number of fresh features and performance enhancements. A few of the new features that make Ruby 3 a potent and contemporary programming language include Ractors, type profiling, increased efficiency, pattern matching, unlimited method definition, and immutable strings. Regardless of your level of experience as a developer, Ruby 3 is undoubtedly worth investigating.

You can explore my other blogs too here,
Get to know answers for common search on Google : A blog for posts which can help you for daily life problems, such as where to get free images, Topic suggestion for the blog.

Computer Science algorithms and other knowledge share : A blog for posts such as best search algorithm, Top interview questions for diffrent technologies, knowledge share for some frameworks or programming languages for the interview or in general terms.

My ideas to solve real world problems : A blog where me shared and presented my ideas to solve a real world problems, this will be interesting for me.

Future of computer science technology discussed : A blog where me discussed about the future of computer science and new technologies which will change our way for looking to solve problems.

Ruby on Rails Web development Blog : As the name suggest, it is the blog for sharing few knowledge about RoR web development framework.

Comments

Popular posts from this blog

Rails Postgresql Query timeout set and skip during migration

Rails Sync Postgresql and Elasticsearch Database of a Model

Ruby on Rails configure CORS setting with rack cors gem