Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
hello

Yutaka HARA yhara

:octocat:
hello
View GitHub Profile
View builtin.ll
; ModuleID = 'main'
source_filename = "main"
target triple = "x86_64-apple-macosx10.15.7"
%Dict = type { i8*, %Class.0*, %Array* }
%Class.0 = type { i8*, %Class.0*, %String*, %Object*, %Object* }
%String = type { i8*, %Class.0*, %"Shiika::Internal::Ptr"*, %Int* }
%"Shiika::Internal::Ptr" = type { i8*, %Class.0*, i8* }
%Int = type { i8*, %Class.0*, i64 }
%Object = type { i8*, %Class.0* }
View a.diff
diff --git a/package.json b/package.json
index 2591ad0..5972b3c 100644
--- a/package.json
+++ b/package.json
@@ -22,6 +22,8 @@
"optparse": "1.0.5"
},
"devDependencies": {
+ "@biwascheme/eval": "file:./src/bs_eval",
+ "@rollup/plugin-node-resolve": "^13.1.3",
View a.md

少し大きめのリファクタリングを入れたので何をしたかを書いておく。

元のコード

リファクタリングしたのはHirMakerContextという構造体である。こいつはASTからHIR(高レベル中間表現)を作る際に使うもので、もとはこういう定義だった。

#[derive(Debug)]
pub struct HirMakerContext {
View keymap.c
/*
* 別途、keyboards/alpha/config.hに以下を記入
#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT
#define RGBLED_NUM 10
#define RGBLIGHT_LAYERS
//#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
#define COMBO_COUNT 6
#define COMBO_TERM 35
*/
View error.txt
Ψ Compiling keymap with gmake alpha:yhara:flash
QMK Firmware 0.10.53 Making alpha with keymap yhara and target flash
avr-gcc (Homebrew AVR GCC 8.4.0) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Size before: text data bss dec hex filename
0 22924 0 22924 598c .build/alpha_yha
View ray.sk.ll
/Users/yhara/Dropbox/proj/shiika/examples % lldb -c /cores/core.67850
(lldb) target create --core "/cores/core.67850"
warning: (x86_64) /cores/core.67850 load command 433 LC_SEGMENT_64 has a fileoff + filesize (0x2f51e000) that extends beyond the end of the file (0x2f51d000), the segment will be truncated to match
warning: (x86_64) /cores/core.67850 load command 434 LC_SEGMENT_64 has a fileoff (0x2f51e000) that extends beyond the end of the file (0x2f51d000), ignoring this section
Core file '/cores/core.67850' (x86_64) was loaded.
(lldb) bt
* thread #1, stop reason = signal SIGSTOP
* frame #0: 0x000000010cf21e0d libgc.1.dylib`GC_clear_stack_inner + 46
frame #1: 0x000000010cf21e27 libgc.1.dylib`GC_clear_stack_inner + 72
frame #2: 0x000000010cf21e27 libgc.1.dylib`GC_clear_stack_inner + 72
View ray.sk
# orig: http://qiita.com/doxas/items/477fda867da467116f8d
IMAGE_WIDTH = 512
IMAGE_HEIGHT = 512
IMAGE_DEPTH = 256
EPS = 0.0001
MAX_REF = 4
class Vec
def initialize(x: Float, y: Float, z: Float)
View fix_ptr_arg.rb
def conv(txt)
txt.gsub(/&Vec<(.+?)>/) do
"&[#{$1}]"
end
end
ARGV.each do |path|
txt = conv File.read(path)
File.write(path, txt)
end
View mandel.sk.opt.ll
; ModuleID = 'examples/mandel.sk.bc'
source_filename = "main"
%Void = type <{}>
%Math = type <{}>
%Object = type <{}>
@"::ITER" = internal unnamed_addr global i1 false
@"::Void" = internal unnamed_addr global %Void* null
@"::LIMIT_SQUARED" = internal unnamed_addr global double 0.000000e+00
View mandel.sk.ll
; ModuleID = 'main'
source_filename = "main"
%Void = type <{}>
%Math = type <{}>
%Object = type <{}>
@"::ITER" = internal global i32 0
@"::Void" = internal global %Void* null
@"::LIMIT_SQUARED" = internal global double 0.000000e+00