SU2019 - Ruby version poll, and stand-alone Ruby poll

What version of Ruby would you like to see included with SketchUp 2019?

  • 2.2
  • 2.3
  • 2.4
  • 2.5
  • 2.6
  • Any of the above or no opinion

0 voters

Notes:

  1. A list of current Windows builds is shown at MSP-Greg/appveyor-ruby, a current list of Travis MacOS builds is shown at MSP-Greg/travis-ruby.
  2. Note that both Windows & Travis use OpenSSL 1.1.0 from Ruby version 2.5 forward.
  3. If you have a preference for a specific teeny version (other than the most current), please state reasons. Ruby versions are MAJOR.MINOR.TEENY

Do you use stand-alone Ruby, and if so, how often?

  • Never
  • A few times a month
  • A few times a week
  • Daily

0 voters

Thanks, Greg

Whatever version is chosen I think it’ll take quite some time for extensions to support immutable strings. I think it would be wise to have the next SU version warn every time a string is modified, but allow it, to give developers time to adapt.

The main Ruby test suite is the ‘test-all’ suite, and it reports the following:

19,057 tests, 2,233,058 assertions, 0 failures, 0 errors, 94 skips

I ran a portion of the tests (the ‘ruby’ folder), and with ‘frozen strings’ set as a start up option, there were thirteen errors. There would probably be more if I ran the whole suite. Hence, Ruby trunk can’t freeze strings and have its own test suite pass.

Importantly, a quick look at the errors showed that they were caused by the test code, not base Ruby code. Said another way, to pass, changes are required only in the test code.

Hence, Ruby will not be setting frozen strings as the default for a few versions, probably not until Ruby 3. Trimble could set it, but that’s unlikely.

Regardless, portions of Ruby and many external libraries/gems are using # frozen_string_literal: true. Some are setting it as a startup option in their CI testing.

I would suggest that plugin authors start testing their code with it enabled via the comment. In some situations, it may result in increased speed or lower memory use…

Thanks, Greg

2 Likes

What version of Ruby made immutable strings the default?

I think it is planned for version 3 but be gradually phased in. First it is optional (2.3) but if I understand it correctly it is planned to be compulsorily in the end. Maybe it is good to get to where it is optional as soon as possible to give the community time to adapt our code before it is made compulsory.

If I recall Matz correctly from a conferense a couple of years ago then Ruby 3 is quite a bit away. (Unless that’s changed recently.)

I’ll make a note to have this on our list of things to test for while looking at Ruby upgrades.

2 Likes

To all, I apologize for some incorrect statements in this thread. I stated

With current versions of SketchUp, that functionality is not available. I am not using an alpha or beta version of SketchUp, but I am using a ‘non-standard’ version that I created.

It is the default version that loads, and it’s the only version on my Windows start menu and taskbar. Similarly, the default version of stand-alone Ruby that I use is a current version of trunk.

Hence, I sometimes forget that I am not using the standard versions…

As @eneroth3 correctly stated, the ‘frozen-string’ comment can only be used with Ruby versions 2.3 and later.

Thanks, Greg

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.