Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing on wain project

Linda_pp rhysd

🎯
Focusing on wain project
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<body>
<a href="https://github.com" rel="noopener" target="_blank">link</a>
</body>
</html>
View ast_node_test.go
package main
import (
"fmt"
"strings"
"testing"
)
// Version A (traditional)
View foo.ll
; ModuleID = 'foo.ml'
source_filename = "foo.ml"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin16.4.0"
; コード:
; let rec f x = x + x in
; println_int (f 42)
; Function Attrs: nounwind
View foo.ll
; ModuleID = 'foo.c'
source_filename = "foo.c"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"
@.str = private unnamed_addr constant [13 x i8] c"hello, world\00", align 1
; Function Attrs: nounwind ssp uwtable
define i32 @main() #0 {
%1 = alloca i32, align 4
View 0コード.ml
let rec fact_ i acc = if i = 0 then acc else fact_ (i-1) (i+acc) in
let rec fact i = fact_ i 0 in
println_int (fact x)
View 0最適化前.ll
; ModuleID = 'foo.ml'
source_filename = "foo.ml"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-darwin15.6.0"
declare void @println_bool(i1) #0
; Function Attrs: ssp uwtable
define i32 @main() #1 {
entry:
@rhysd
rhysd / 0これが.ml
Last active Feb 15, 2017
変遷の様子
View 0これが.ml
let a = 10 in
let rec f x = if x < 1 then 0 else x + (f (x - 1)) in
print_int (f a)
View lexer.go
package lexer
import (
"bufio"
"bytes"
"fmt"
"github.com/rhysd/mincaml-parser/token"
"io"
"unicode"
"unicode/utf8"
View string_insert.rs
pub fn insert(target: &mut String, index: usize, replaced: &str) {
for c in replaced.chars().rev() {
target.insert(index, c);
}
}
View peco-repos.zsh
function peco-repos() {
local input
input="$(find "$GOPATH/src" -maxdepth 3 -mindepth 3 -name "*" -type d)"
input="${input}\n$(ghq list | sed "s#^#$(ghq root)/#")"
input="${input}\n$(ls -1 -d "$HOME/.vim/bundle/"*)"
input="${input}\n$(ls -1 -d "$HOME/.cache/dein/repos/"*)"
input="$(echo "$input" | sed "s#^$HOME#~#g")"
local selected_dir=$(echo "${input}" | peco --prompt 'repos >' --query "$LBUFFER")
You can’t perform that action at this time.