Xuejie "Rafael" Xiao xxuejie

View .vimrc
1 2 3 4 5 6 7 8 9 10
set nocompatible
 
syntax on
filetype plugin indent on
 
set background=dark
colorscheme solarized
 
set ffs=mac,unix,dos
set encoding=utf-8
View status.md

We now have reached a corner regarding the development of webruby.Emscripten is now switching to a LLVM-based backend, which eventually will replace the old JS-based backend. However, a bug in clang prevents us to use the new le32-unknown-nacl triple in LLVM/emscripten, it also prevents us from using the new LLVM-based backend of emscripten.

A fix has been developed for LLVM to solve this problem, but as of today, it's neither in the PNaCl fork of clang, nor emscripten-fastcomp-clang. So this prevents us from switching to the latest version of emscripten.

In a meantime, an attempt to fix this problem at mruby side was also rejected, since this would complicate mruby a lot for a small corner case.

We could maintain

View after_clang_and_pnacl_patch.log
1 2 3 4 5 6 7 8 9 10
$ EMCC_FAST_COMPILER=1 ~/develop/opensource/webruby/modules/emscripten/emcc vatest.c
Warning: Variable __init_array_start not referenced
Warning: Variable __init_array_end not referenced
Warning: Variable __fini_array_start not referenced
Warning: Variable __fini_array_end not referenced
false && "Unsupported type"
/Users/rafael/develop/opensource/emscripten-fastcomp/lib/Target/JSBackend/JSBackend.cpp : 683
LLVM ERROR: fail
Traceback (most recent call last):
File "/Users/rafael/develop/opensource/webruby/modules/emscripten/emscripten.py", line 1347, in <module>
View command.sh
1 2 3 4 5 6 7 8 9 10
# Suppose the currenct directory is ~/develop
 
$ git clone https://github.com/redis/hiredis
$ cd hiredis
 
# Set emscripten compiling target
$ export EMCC_LLVM_TARGET=i386-pc-linux-gnu
 
# Locale the installation path of webruby, for example, on my mac this is:
# ~/.gem/ruby/2.0.0/gems/webruby-0.2.4/
View gist:6258440
1 2 3 4 5 6 7
$ git co CABLES-68-dev
(coding...)
$ git fetch
$ git rebase origin/CABLES-68
(fix merging...)
$ git co CABLES-68 && git rebase CABLES-68-dev
$ git push origin CABLES-68
View build.log
1
$ EMCC_LLVM_TARGET=i386-pc-linux-gnu EMCC_DEBUG=1 /Users/rafael/develop/webruby/modules/emscripten/emcc /Users/rafael/develop/webruby/build/mrbtest.bc -o /Users/rafael/develop/webruby/build/mrbtest.js -s TOTAL_MEMORY=33554432 --js-library /Users/rafael/develop/webruby/build/gem_test_library.js --pre-js /Users/rafael/develop/webruby/build/gem_test_append.js -s EXPORTED_FUNCTIONS="['_mruby_js_argument_type', '_mruby_js_convert_symbol_to_string', '_mruby_js_get_array_handle', '_mruby_js_get_float', '_mruby_js_get_hash_handle', '_mruby_js_get_integer', '_mruby_js_get_object_handle', '_mruby_js_get_proc', '_mruby_js_get_string_len', '_mruby_js_get_string_ptr', '_mruby_js_invoke_alloc_argv', '_mruby_js_invoke_fetch_argp', '_mruby_js_invoke_proc', '_mruby_js_invoke_release_argv', '_mruby_js_name_error', '_mruby_js_set_array_handle', '_mruby_js_set_boolean', '_mruby_js_set_float', '_mruby_js_set_function_handle', '_mruby_js_set_integer', '_mruby_js_set_nil', '_mruby_js_set_object_handle', '_mruby_js_set_string', '_ma
View rubykaigi.scss
1 2 3 4 5 6 7 8 9 10
/**
* A simple theme for reveal.js presentations, similar
* to the default theme. The accent color is darkblue.
*
* This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
* reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se; so is the theme - beige.css - that this is based off of.
*/
 
 
// Default mixins and settings -----------------
View clang.out
1 2 3 4 5 6 7 8 9 10
$ clang vatest.c
$ ./a.out
Type is 0
Value is 5
Type is 1
Value is 12
Type is 2
Value is 19
Type is 3
Value is 26
View mrbtest.log
1 2 3 4 5 6 7 8 9 10
Entering: _mrb_run: 104,5521416,5666064,1484
Calling setjmp in run curr: 0x400, prev: (nil)!
Entering: _stack_extend: 5521416,5,5
Exiting: _stack_extend
Entering: _mrb_realloc: 5521416,0,44
Entering: _allocf: 5521416,0,44,0
Entering: _realloc: 0,44
Entering: _malloc: 44
Exiting: _malloc
Exiting: _realloc
View geometries.js
1 2 3 4 5 6 7 8 9
// The original JS code for WebGL geometries example in three.js repository
// I only changed the order of the functions for better comparison
// with the Ruby version.
// You can still find the original version inline at http://mrdoob.github.com/three.js/examples/webgl_geometries.html
 
var container, stats;
var camera, scene, renderer;
 
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
Something went wrong with that request. Please try again.