This file contains 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/yorickpeterse/.rubies/ruby-1.8.7-p374/bin/ruby -r ./siteconf20150102-25402-4mfu9j-0.rb extconf.rb | |
extconf.rb:8: warning: already initialized constant ToolSet | |
make clean | |
make | |
compiling melbourne.cpp | |
compiling symbols.cpp | |
generating parser grammar.y | |
compiling grammar.cpp |
This file contains 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
Thread 8 (Thread 0x7fc82c644700 (LWP 13272)): | |
#0 0x00007fc8319088cf in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0 | |
#1 0x000000000088f7d1 in wait (this=<optimized out>, mutex=...) | |
at /home/yorickpeterse/Private/Projects/ruby/rubinius/vm/util/thread.hpp:455 | |
#2 worker_wait (this=<optimized out>) at vm/gc/finalize.cpp:481 | |
#3 rubinius::FinalizerHandler::perform (this=0x34b3960, state=0x7fc82c643ec0) at vm/gc/finalize.cpp:196 | |
#4 0x000000000088f649 in rubinius::finalizer_handler_tramp (state=0x7fc82c643ec0) at vm/gc/finalize.cpp:74 | |
#5 0x000000000086b556 in rubinius::Thread::in_new_thread (ptr=0x34f7330) at vm/builtin/thread.cpp:283 | |
#6 0x00007fc831903314 in start_thread () from /usr/lib/libpthread.so.0 | |
#7 0x00007fc830a9824d in clone () from /usr/lib/libc.so.6 |
This file contains 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
#include <string.h> | |
#include <stdio.h> | |
#include <malloc.h> | |
%%{ | |
machine test_lexer; | |
newline = [\n|\r\n]+; | |
integer = ('+'|'-')?[0-9]+; | |
operator = ['+''-''*''/''=''%''^']+; |
This file contains 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
#include <juno/lexer.hpp> | |
using namespace Juno::Lexing; | |
#define ADVANCE_COLUMN column = column + (te - ts) | |
#define ADVANCE_LINE line++; column = 0; | |
#define ADD_TOKEN(TYPE) \ | |
tokens->push(this->create_token(TYPE, ts, te, line, column)); \ | |
ADVANCE_COLUMN |
This file contains 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
class Example | |
def foo | |
return 10 + 20 | |
end | |
end | |
example = Example.new | |
method = example.method(:foo).executable | |
Rubinius::JIT.compile(example, method) |
This file contains 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
# The contents of this block would be arbitrary, it's _not_ tied into any ORM/database/etc. | |
define_dummy(:stubbed_user) do |attrs| | |
user = User.new(attrs) | |
user.stub(:something).and_return('foo') | |
user | |
end | |
describe User do |
This file contains 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
source 'https://rubygems.org' | |
gem 'oga' |
This file contains 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 'benchmark/ips' | |
class Bench | |
def fact(n) | |
if n > 1 | |
n * fact(n-1) | |
else | |
1 | |
end | |
end |
This file contains 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
Ruby: {"name"=>"Yorick", "age"=>22, "location"=>"Netherlands", "anger_level"=>9000} | |
CAPI: {"name"=>"Yorick", "age"=>22, "location"=>"Netherlands", "anger_level"=>9000} | |
Racc: {"name"=>"Yorick", "age"=>22, "location"=>"Netherlands", "anger_level"=>9000} | |
Calculating ------------------------------------- | |
Ruby reuse 2.966k i/100ms | |
Ruby new 2.934k i/100ms | |
CAPI reuse 8.044k i/100ms | |
CAPI new 7.212k i/100ms | |
Racc reuse 5.075k i/100ms |
This file contains 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
git clone git@github.com:YorickPeterse/ruby-ll.git | |
cd ruby-ll | |
bundle install | |
rake clean compile | |
ruby test.rb # see Ruby script below |