Skip to content

Instantly share code, notes, and snippets.

@sfpgmr
sfpgmr / .gitignore
Last active May 7, 2017 08:47
テクスチャマップを工夫することによる表示品質の改善
typings
node_modules
.vscode
temp
@sfpgmr
sfpgmr / .gitignore
Last active May 16, 2017 12:35
ExtrudeGeometry&TextureMapping
typings
node_modules
.vscode
temp
@sfpgmr
sfpgmr / .gitignore
Last active May 21, 2017 09:31
THREE.ShaderMaterial
typings
node_modules
.vscode
temp
@sfpgmr
sfpgmr / .gitignore
Last active May 20, 2017 10:29
ExtrudeGeometry & Texturemap (2)
typings
node_modules
.vscode
temp
@sfpgmr
sfpgmr / .gitignore
Last active May 28, 2017 02:46
WebGL2を試す
.vscode
node_modules
@sfpgmr
sfpgmr / index.mjs
Last active April 1, 2018 10:51
四則演算をwasmにコンパイルして実行してみる
import binaryen from 'binaryen';
import tokenize from './tokens.mjs';
import make_parse from './parse.mjs';
import fs from 'fs';
const testSrc =
`
((1 + 2) * 100 + 10) / 10 - 1
`;
@sfpgmr
sfpgmr / result.wat
Last active April 19, 2018 20:53
オレオレ言語のコンパイルテスト1
(module
(type $main (func (result i32)))
(export "main" (func $main))
(func $main (; 0 ;) (type $main) (result i32)
(local $0 i32)
(local $1 i32)
(set_local $0
(i32.const 2)
)
(set_local $1
@sfpgmr
sfpgmr / compiled.wat
Created April 21, 2018 11:52
オレオレ言語コンパイルテスト(2)
(module
(type $main (func (result i32)))
(export "main" (func $main))
(func $main (; 0 ;) (type $main) (result i32)
(local $0 i32)
(local $1 i32)
(set_local $0
(i32.const 2)
)
(set_local $1
@sfpgmr
sfpgmr / source
Last active April 22, 2018 07:15
オレオレ言語のコンパイルテスト(3)function call
i32 mul(i32 a,i32 b){
return a * b;
}
export i32 main(){
i32 c = 2,a = 2;
// a -= 2;
++a;
@sfpgmr
sfpgmr / source
Created April 22, 2018 21:08
オレオレ言語のコンパイルテスト(4)ポストデクリメントや日本語関数名など
i32 𩸽(i32 a,i32 b){
return a * b;
}
export i32 main(){
i32 c = 1,a = 1;
if(c != 2){
c = 2;
a += c;