Skip to content

Instantly share code, notes, and snippets.

View bakkdoor's full-sized avatar

Christopher Bertels bakkdoor

View GitHub Profile
@bakkdoor
bakkdoor / Rakefile.diff
Created January 9, 2011 01:46
Change Rakefile to compile all files at once with fancy-written compiler and use rbx -Xint option
diff --git a/Rakefile b/Rakefile
index 2782ca9..b4cc318 100644
--- a/Rakefile
+++ b/Rakefile
@@ -89,7 +89,7 @@ namespace :compiler do
task :compile => file(boot_parser_e) do
say "Compiling fancy using stable compiler."
- cmd = ['rbx', load_rb]
+ cmd = ['rbx -Xint', load_rb]
@bakkdoor
bakkdoor / bytecode for times:
Created January 9, 2011 02:43
implementation of Fixnum#times:
============== :"times:" ===============
Arguments: 1 required, 1 total
Locals: 1: block
Stack size: 3
Lines to IP: 22: -1..0, 21: 1..2, 22: 3..7
0000: push_self
0001: push_local 0 # block
0003: allow_private
0004: send_stack_with_block :times, 0
def mytimes(block)
times(&block)
end
=============== :"loop:" ===============
Arguments: 1 required, 1 total
Locals: 1: block
Stack size: 3
Lines to IP: 12: -1..-1, 9: 0..1, 11: 2..3, 12: 4..7
0000: create_block #<Rubinius::CompiledMethod loop: file=lib/object.fy>
0002: create_block #<Rubinius::CompiledMethod loop: file=lib/object.fy>
0004: send_stack :"while_true:", 1
@bakkdoor
bakkdoor / cascading.tuple.TupleEntryIterator.hasNext() backtrace
Created January 14, 2011 00:42
backtrace of calling cascading.tuple.TupleEntryIterator.hasNext() after it has returned false
cascading.pipe.OperatorException: [ddc15846-4ba7-4f3a-ad0...][sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)] operator Every failed executing buffer: CascalogBufferExecutor[decl:'?follower-ids']
at cascading.pipe.Every$EveryBufferHandler.operate(Every.java:542)
at cascading.flow.stack.EveryBufferReducerStackElement.collect(EveryBufferReducerStackElement.java:89)
at cascading.flow.stack.GroupReducerStackElement.operateGroup(GroupReducerStackElement.java:74)
at cascading.flow.stack.GroupReducerStackElement.collect(GroupReducerStackElement.java:58)
at cascading.flow.stack.FlowReducerStack.reduce(FlowReducerStack.java:169)
at cascading.flow.FlowReducer.reduce(FlowReducer.java:75)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:463)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:411)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:215)
it: "should return an instance of the apropriate MatchData class" when: {
def create_tuple: num {
(num, num * num) # create a Tuple
}
match create_tuple: 10 -> {
case Tuple -> |md, x, y|
md class should == (Tuple MatchData)
x should == 10
def with_tmp_fs: block {
tmp_path_names = []
block arity times: |i| {
path = "/tmp/tmp_path_#{i}"
tmp_path_names << path
Directory create: path
}
block call: tmp_path_names
tmp_path_names each: |p| {
Directory delete!: p
find . -type f -exec grep -nH -e "selector" {} /dev/null \;
./parser/ext/lexer.lex:55:selector ({letter}|[_&*])({letter}|{digit}|{special_under})*":"
./parser/ext/lexer.lex:148:{selector} {
./parser/ext/parser.y:88:%type <object> selector
./parser/ext/parser.y:262:selector: SELECTOR {
./parser/ext/parser.y:348:method_arg: selector identifier {
./parser/ext/parser.y:364:method_arg_default: selector identifier LPAREN space exp space RPAREN {
./parser/ext/parser.y:469:send_args: selector arg_exp {
./parser/ext/parser.y:472: | selector space arg_exp {
./parser/ext/parser.y:475: | send_args selector arg_exp {
---------------------------------------------
CRASH: A fatal error has occured.
Backtrace:
0 rbx 0x00000001000201f0 _ZN8rubiniusL12segv_handlerEi + 160
1 libSystem.B.dylib 0x00007fff86a4567a _sigtramp + 26
2 ??? 0x0000003236346461 0x0 + 215657768033
3 rbx 0x0000000100208b82 _ZN8rubinius17VisitInstructionsINS_8JITVisitEE8dispatchEi + 4962
4 rbx 0x00000001001e9af4 _ZN8rubinius3jit7Builder13generate_bodyEv + 1156
5 rbx 0x00000001001d2159 _ZN8rubinius7Inliner21inline_generic_methodEPNS_5ClassEPNS_6ModuleEPNS_14CompiledMethodEPNS_8VMMethodE + 1545
def meth: block {
block call: [1,2]
}
meth: |a,b| {
# do stuff here with a and b
}