Saturday, January 2, 2010

Log 010210

Hello World. Fixed a bug in '@.' Some documentation work. Ended the day with a core dump...

Generated programs are huge. Not sure it's because of compiled out constants or large routines, looking for an analyser for binary/C programs. Looks like it is the cost of not having bytecode, possibly the cost of not compiling to machine code directly. Plus there's some overhead for using the C calling convention and some overhead for generated constants. Are there static analysers which dump data on calling overhead, constants, and assembly?

With -Os, optimize for size, I'll be looking at x3-4 size w.r.t. Ocaml, and -O9, optimize for speed, x10-15 w.r.t Ocaml. Which is interesting, since I don't see how -O9 could be faster than -Os, on this generated code?

All generated variables are in SSA form, all data can be treated as constants. How to tell C?

[marco@horse tests]$ make system/test_print_tuple.out
gcc -g -I /usr/lib64/libffi-3.0.5/include -lffi -l dl -I ../runtime/ system/test_print_tuple.c -o system/test_print_tuple.out
[marco@horse tests]$ ./system/test_print_tuple.out

evaluating : (_MAIN )

evaluating : (___exception )

evaluating : (main (___exception ))

evaluating : (system.print (___exception )(system.tuple_3 10 (system.false )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))))

evaluating : (_select_system.to_text (___exception )(system.tuple_3 10 (system.false )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))))(system.tuple_3 10 (system.false )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))))

evaluating : (_select_system.to_text130484 (___exception )(system.tuple_3 10 (system.false )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))))

evaluating : (system.txt (___exception )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))))

evaluating : (_select_system.to_text (___exception )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))))

evaluating : (_select_system.to_text130494 (system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))))

evaluating : (system.concat (___exception )(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))(system._txt (list.cons ) (list.nil ))))

evaluating : (system.concat130501 (___exception ))

evaluating : (system.fix (___exception )(system.concat130501 (___exception )))

evaluating : (system.fix130570 (___exception )(system.concat130501 (___exception )))

evaluating : (___apply (system.concat130501 (___exception ))(system.fix130570 (___exception )(system.concat130501 (___exception ))))

evaluating : (system.concat130501 (___exception )(system.fix130570 (___exception )(system.concat130501 (___exception ))))

evaluating : (system.concat130499 (___exception )(system.concat130501 (___exception )(system.fix130570 (___exception )(system.concat130501 (___exception ))))(system._txt (list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil )))))))))))))(system._txt (list.cons ) (list.nil ))))

evaluating : (___apply (system.concat130501 (___exception )(system.fix130570 (___exception )(system.concat130501 (___exception ))))(list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))(list.cons ) (list.nil )))

evaluating : (system.concat130501 (___exception )(system.fix130570 (___exception )(system.concat130501 (___exception )))(list.cons h (list.cons e (list.cons l (list.cons l (list.cons o (list.cons   (list.cons w (list.cons o (list.cons r (list.cons l (list.cons d (list.nil ))))))))))))(list.cons ) (list.nil )))

evaluating : (___apply (system.fix130570 (___exception )(system.concat130501 (___exception )))(null)
(list.cons ) (list.nil )))


...
 

Segmentation fault (core dumped)
[marco@horse tests]$ echo "uh, null?"


When you're talking to your computer, you're a hacker. When your computer talks back to you, you're schizo.

No comments:

Post a Comment