From: Eric Wong Date: 2017-04-18T20:32:06+00:00 Subject: [ruby-core:80776] Re: [Ruby trunk Feature#13434] better method definition in C API Also, this is a bit far off; but a potential future optimization is even being able to use readonly markers in C methods to infer readonly args use in pure Ruby methods. For example, Rack::Request is: def get_header(name) @env[name] end where @env is a Hash. Since rb_hash_aref can be marked with the key being read-only, the end goal is to make even pure Ruby method calls like: get_header("HTTP_FOO") avoid allocation, just as current calls to @env["HTTP_FOO"] get optimized with opt_aref_with. And we should do this without introducing any incompatibility. Again, I am 100% against making frozen_string_literal the default because it introduces backwards incompatibility. Unsubscribe: