- origin = shugo/jruby, upstream = jruby/jruby. Pull requests are usually created by Shugo himself; do not create one unless asked.
- Branches may be amended or rebased in parallel sessions. Before any
force-push, verify the remote SHA with
git ls-remoteand use--force-with-lease. If a push went through an explicit URL instead of the configured remote, the tracking refs are stale; `git fetch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Heuristic checker for non-volatile locals read on the longjmp path. | |
| # | |
| # Scans C sources for functions using EC_EXEC_TAG()/EXEC_TAG()/RUBY_SETJMP | |
| # and reports locals that are declared before the setjmp, are not volatile, | |
| # and are read in the longjmp-reachable region (outside the TAG_NONE block). | |
| # | |
| # Two severities: | |
| # STRICT - also written between setjmp and longjmp: indeterminate per | |
| # C11 7.13.2.1p3, a real portability bug. |
I built a small PEG/packrat parser-combinator gem (packrat_parser) whose grammar rules
can be written with a Scala-style for-comprehension. The comprehension is a feature of an
experimental Ruby fork: for x in p, y in q then ... end desugars (at parse time) to
p.flat_map { |x| q.map { |y| ... } }. Along the way I hit a subtle bug caused by the
comprehension's loop variables leaking into the enclosing method scope. This writeup is
mostly about that bug.
The comprehension is only recognized by the fork's legacy parser, so everything below runs with
ruby --parser=parse.y. The default (Prism) parser rejectsfor ... then.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module M | |
| refine String do | |
| def shout = upcase + "!" | |
| end | |
| end | |
| N = 2_000_000 | |
| prc = ->(s) { s } | |
| # Warm up the memo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "objspace" | |
| module M | |
| refine String do | |
| def shout = upcase + "!" | |
| end | |
| end | |
| module A | |
| refine(String) { def shout = "A" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /home/shugo/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \ | |
| --executables="compare-ruby::/home/shugo/src/ruby/ruby -I.ext/common --disable-gem" \ | |
| --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems --disable-gem" \ | |
| --output=markdown --output-compare -v $(find ./benchmark -maxdepth 1 -name 'vm' -o -name '*vm*.yml' -o -name '*vm*.rb' | sort) | |
| compare-ruby: ruby 4.1.0dev (2026-01-06T04:38:13Z master ad6b85450d) +PRISM [x86_64-linux] | |
| built-ruby: ruby 4.1.0dev (2026-06-09T07:45:27Z feature/proc-with_.. d58b477bf8) +PRISM [x86_64-linux] | |
| warming up............................................... | |
| # Iteration per second (i/s) | |
| | |compare-ruby|built-ruby| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def hello | |
| puts "hello" | |
| end | |
| Task.new do | |
| using PipeOUT | |
| puts "hello" # パイプに書く | |
| hello # パイプに書く? | |
| end |
openpgp4fpr:1e565fa7b310cfc1b144d93c2dfe34085e97ce47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $c=%,$c=%%%%%%%%%c%%%%s%%c;puts$c%%%%%%%%44%%%%%%%%44%%%%%%%%$c,;puts$c%44%44%$c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def foo | |
| x = 1 | |
| x | |
| y | |
| end |
NewerOlder