irb
irb copied to clipboard
Launch another Ruby Interpreter when IRB is started
from https://github.com/ruby/irb/pull/254#issuecomment-871698900
Separation running and input interpreters sounds good. But I know it's never easy.
At first I can do is creating issue so I do.
Expected benefits
- Running something(ex compiling) to check the code on background does not effect the input interpreter
- Reduce
requre - maybe something more...
I did a bit debugging with ruby/debug:
$ ruby -Ilib -rnet/http -rdebug -e "debugger(do: 'trace call') ;; puts Net::HTTP.get(URI.parse('https://raw.githubusercontent.com/ruby/debug/master/.gitignore'))"
And I think it hangs at
DEBUGGER (trace/call) #th:1 #depth:19> IO#wait_readable at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:219
More traces:
# ...
DEBUGGER (trace/call) #th:1 #depth:20< OpenSSL::SSL::SSLSocket#sysread_nonblock #=> :wait_readable at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/openssl/buffering.rb:214
DEBUGGER (trace/call) #th:1 #depth:19< OpenSSL::Buffering#read_nonblock #=> :wait_readable at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/openssl/buffering.rb:214
DEBUGGER (trace/call) #th:1 #depth:19> Module#=== at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:213
DEBUGGER (trace/call) #th:1 #depth:19< Module#=== #=> false at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:213
DEBUGGER (trace/call) #th:1 #depth:19> Symbol#=== at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:218
DEBUGGER (trace/call) #th:1 #depth:19< Symbol#=== #=> true at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:218
DEBUGGER (trace/call) #th:1 #depth:19> OpenSSL::SSL::SSLSocket#io at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:219
DEBUGGER (trace/call) #th:1 #depth:19< OpenSSL::SSL::SSLSocket#io #=> #<Socket:fd 11> at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:219
DEBUGGER (trace/call) #th:1 #depth:19> IO#wait_readable at /Users/st0012/.rbenv/versions/3.1.0/lib/ruby/3.1.0/net/protocol.rb:219