Skip to content

Instantly share code, notes, and snippets.

def conv(txt)
txt.gsub(/&Vec<(.+?)>/) do
"&[#{$1}]"
end
end
ARGV.each do |path|
txt = conv File.read(path)
File.write(path, txt)
end
; 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
; 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
@yhara
yhara / a.ll
Created November 4, 2019 09:53
; ModuleID = 'main'
source_filename = "main"
%"Meta:A" = type <{}>
%A = type <{}>
%Object = type <{}>
%Math = type <{}>
@"::A" = internal global %"Meta:A"* null
@"::H" = internal global i32 0
;
; Chibiのsyntax-rules実装を動かしてみる
;
; original: ~/research/chibi-scheme/lib/init-7.scm
(import (scheme base) (scheme write) (chibi)) ; (chibi syntax-case))
(define (syntax-rules-transformer expr rename compare)
(let ((ellipsis-specified? (identifier? (cadr expr)))
(count 0)
(_er-macro-transformer (rename 'er-macro-transformer))
@yhara
yhara / err.txt
Last active September 3, 2019 14:36
/Users/yhara/proj/qmk_firmware/lets_yhara % ./write.sh [263/405]
QMK Firmware 0.6.385
WARNING:
Some git sub-modules are out of date or modified, please consider running:
make git-submodule
You can ignore this warning if you are not compiling any ChibiOS keyboards,
or if you have modified the ChibiOS libraries yourself.
Making lets_split/rev2 with keymap yhara and target avrdude
avr-gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
; original: ~/research/chibi-scheme/lib/init-7.scm
(import (scheme base) (scheme write) (chibi)) ; (chibi syntax-case))
(define (syntax-rules-transformer expr rename compare)
(let ((ellipsis-specified? (identifier? (cadr expr)))
(count 0)
(_er-macro-transformer (rename 'er-macro-transformer))
(_lambda (rename 'lambda)) (_let (rename 'let))
(_begin (rename 'begin)) (_if (rename 'if))
(_and (rename 'and)) (_or (rename 'or))
@yhara
yhara / a.rb
Last active June 20, 2019 13:30
require 'tempfile'
# File.openを使う処理
def write_hello(path)
File.open(path, "a") do |file|
file.write "hello"
end
end
# テスト
@yhara
yhara / finalizer.rb
Last active February 16, 2019 10:35
HOOK = proc{}
class A
def foo
ObjectSpace.define_finalizer self, HOOK
end
end
A.new.foo
10.times{GC.start}
p ObjectSpace.each_object(A).to_a #=> [#<A:0x00007fbae28ef1f8>]
source 'https://rubygems.org'
gem 'activerecord', '5.2.0'