This file contains hidden or 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
$ 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> |
This file contains hidden or 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
# 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/ |
This file contains hidden or 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 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 |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
/** | |
* 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 ----------------- |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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 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(); |
This file contains hidden or 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
$ clang swap64.c | |
$ ./a.out | |
72057594037927936 |
This file contains hidden or 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 <stdio.h> | |
#include <emscripten/emscripten.h> | |
int EMSCRIPTEN_KEEPALIVE c_func_calling_from_js() { | |
printf("This is a c function calling from js!"); | |
return 0; | |
} |