DevelopersMeeting20150820Japan
https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20150820Japan
Attendee: akr, ayumin, hsbt, ko1, matz, naruse, nobu, kosaki, usa, yuki, amatsuda
did_you_mean gem (Yuki Nishijima)
- Naming: did_you_mean or correctable?
- did_you_mean is acceptable, but it’s determined by what feature set is bundled.
- Bundled gem or stdlib? It's going to be reuiqred in prelude (Yuki still doesn't know what it is)
- Bundled gem
- It’ll be required when a Ruby process spins up
- Rescue LoadError and just ignore when it doesn’t exist
- Ability to skip a correction attempt when raised within a certain method
- Completely disable the feature for apps running in production (env flag? method that does it?)
- Why want to disable in production? -> Because it makes rails slow.
- Why slow? -> Rails parses the message of NameError exception for rails’ autoload feature.
- `time ruby --disable-gem -e1`: 0.061s
- `time ruby -e1`: 0.083s
- `time ruby -rdid_you_mean -e1`: 0.109s
- (ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14])
- Like --disable-gem, we can extend --disable-did_you_mean
- -> We should change Rails, and we should offer a new API to take the qualified name of the Class/Module.
- Current Rails parses error message like “NameError: undefined local variable or method `foo' for main:Object”
- Use NameError#name
- NameError#name doesn’t include parent modeule names which is included in the error message. We need a new API including this.
- How about adding a new method that returns the binding?
- More succinct message. Delete two empty line and indent.
% ruby -rdid_you_mean -e '
class C
def bar
end
end
C.new.baz
'
-e:6:in `<main>': undefined method `baz' for #<C:0x007f790863e880> (NoMethodError)
Did you mean? #bar
zsh: exit 1 /home/akr/alias/ruby -rdid_you_mean -e
% ocaml
OCaml version 4.01.0
# let bar = 1;;
val bar : int = 1
# baz;;
Error: Unbound value baz
Did you mean bar?
# let bas = 2;;
val bas : int = 2
# baz;;
Error: Unbound value baz
Did you mean bas or bar?
# let bat = 3;;
val bat : int = 3
# baz;;
Error: Unbound value baz
Did you mean bas, bat or bar?
#
empty line is not needed because lines of display is essential resource. indent is ok.



- Use `--disable=’ commandline option.
- Need to implement API in ruby level to take what features are disabled.
- global method? global variable? constant?
- NameError for constant reference
- module M
A::B::C
end - failed to refrence A -> needs binding and the name :A.
- failed to refernce B -> needs A and the name :B.
- failed to refrence C -> needs B and the name :C.
Release Schedule
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/ReleaseEngineering23
Subversion Repository Migration
current machine is old debian.
Migration is required before next Spring.
Options:
- Migrate to new Subversion server (on AWS)
- Migrate to Git server ( on AWS)
- related migrations are required.
- Term of service; GitHub Issues are not portable
- Partial migration (use git for HEAD and continue to use SVN for maintaining branches)
Problem: If we migrate to git, we need to migrate SVN related tools (auto date update, etc)
Magic Comment for Frozen String Literal by default
Default of the status of String Literal will be frozen from Ruby 3.0.
- it has been rejected before 2.2 by matz
- it has been rejected again early 2.3 development by matz
- amatsuda: tired of seeing pull requests adding “..”.freeze here and there. This is ugly.
- amatsuda: please reconsider akr’s magic comment solution [https://bugs.ruby-lang.org/issues/8976]
- matz: accepted. As a migration path, magic comment is reasonable. naming is still problem.
- command line option to frozen string literal by default
- It is acceptable but can’t be a migration path
- Ruby 3.0 will interpret string literal frozen by default.
- command line option candidates
- --enable-frozen-string-literal
- command line option is weaker than magic comment
Frozen Regexp Literal
It doesn’t need a migration path.
Next Meeting (18, September)
Next Meeting (21, October)