View mapping.rb
1 2 3 4 5 6 7 8 9 10
# Based on the JSON output as listed at
# http://www.w3.org/TR/html5/syntax.html#named-character-references
DECODE_MAPPING = {
"Á" => [193].pack('U'),
"&Aacute" => [193].pack('U'),
"á" => [225].pack('U'),
"&aacute" => [225].pack('U'),
"Ă" => [258].pack('U'),
"ă" => [259].pack('U'),
"∾" => [8766].pack('U'),
View bench_3320_each_cons.rb
1 2 3 4 5 6 7 8 9 10
require 'benchmark/ips'
 
module Enumerable
def each_cons(num)
n = Rubinius::Type.coerce_to_collection_index num
raise ArgumentError, "invalid size: #{n}" if n <= 0
 
return to_enum(:each_cons, num) {
if (enum_size = enumerator_size).nil?
nil
View gist:3835874051c0f36234f9
1 2 3 4 5 6 7 8 9 10
git clone git@github.com:YorickPeterse/oga.git
git checkout ruby-ll # if this complains, use git checkout -b ruby-ll origin/ruby-ll
bundle install
gem install oga
rake generate fixtures
 
# To benchmark the old parser, open benchmark/benchmark_helper.rb
# and replace the require_relative on line 5 with require 'oga'
 
# Then to benchmark it:
View gist:59bdb982a3afcda1a6cc
1 2 3 4 5 6 7 8 9 10
Starting program: /home/yorickpeterse/.rubies/rbx-git/bin/ruby -e Rubinius::VariableScope.new.locals
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff7f8f700 (LWP 15561)]
[New Thread 0x7ffff4cf7700 (LWP 15562)]
[New Thread 0x7ffff4bf6700 (LWP 15563)]
[New Thread 0x7ffff4af5700 (LWP 15564)]
[New Thread 0x7ffff49f4700 (LWP 15565)]
View gist:b659c906738a5ce54f66
1 2 3 4 5 6 7 8 9 10
Starting program: /home/yorickpeterse/Private/Projects/ruby/rubinius/staging/bin/rbx -e foo
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff7f8f700 (LWP 25155)]
[New Thread 0x7ffff4cf7700 (LWP 25156)]
 
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7066410 in pthread_join () from /usr/lib/libpthread.so.0
View gist:1fe9086e483090506ee2
1 2 3 4 5 6 7 8 9
 
Thread 8 (Thread 0x7fb85e81b700 (LWP 14846)):
#0 0x00007fb85d8f28cf in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
#1 0x000000000089397d in wait (this=<optimized out>, mutex=...) at /home/yorickpeterse/Private/Projects/ruby/rubinius/vm/util/thread.hpp:448
#2 worker_wait (this=<optimized out>) at vm/gc/finalize.cpp:420
#3 rubinius::FinalizerThread::run (this=0x1fbdb80, state=0x7fb85e81aec0) at vm/gc/finalize.cpp:142
#4 0x000000000060b0a1 in rubinius::InternalThread::run (ptr=0x1fbdb80) at vm/internal_threads.cpp:46
#5 0x00007fb85d8ed314 in start_thread () from /usr/lib/libpthread.so.0
#6 0x00007fb85ca8224d in clone () from /usr/lib/libc.so.6
View gist:b3c662e9b2d9e1d91e42
1 2 3 4 5 6 7 8 9 10
** Invoke install (first_time)
** Invoke build:build (first_time)
** Invoke vm/vm (first_time)
** Invoke vm/gen/config_variables.h (first_time, not_needed)
** Invoke library/rubinius/configuration.rb (first_time, not_needed)
** Invoke config.rb (first_time, not_needed)
** Invoke vm/gen/signature.h (first_time, not_needed)
** Invoke kernel/signature.rb (first_time, not_needed)
** Invoke kernel/bootstrap/load_order.txt (first_time, not_needed)
** Invoke kernel/common/load_order.txt (first_time, not_needed)
View literate_thread_backtrace_location.md

Thread::Backtrace::Location

The Location class is used by Kernel#caller_locations to store information of every call frame in a call stack. Instances of this class can store information such as:

  • The path to the file where the frame originated from
  • The name of the context of the frame (method name, "block", etc)
  • The line number where the frame originated from
View gist:db021c2b62489472ff52
1 2 3 4 5 6 7 8 9 10
lib/ll/parser.rll:11:1:error: first/first conflict, multiple branches start with the same terminals
X = A | A;
^
lib/ll/parser.rll:11:5:error: branch starts with: T_NAME, epsilon
X = A | A;
^
lib/ll/parser.rll:11:9:error: branch starts with: T_NAME, epsilon
X = A | A;
^
lib/ll/parser.rll:8:5:error: first/follow conflict, branch can start with epsilon and is followed by (non) terminals
View gist:1dfd46ffe84bdf9479bd
1 2 3 4 5 6 7 8 9 10
Starting program: /home/yorickpeterse/.rubies/rbx-git/bin/rbx -S bundle install
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff4cf7700 (LWP 17025)]
[New Thread 0x7ffff48f6700 (LWP 17026)]
[New Thread 0x7ffff44f5700 (LWP 17027)]
[New Thread 0x7fffe7fff700 (LWP 17028)]
[New Thread 0x7fffe7bfe700 (LWP 17029)]
Something went wrong with that request. Please try again.