This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
Hello, world. | |
</body> | |
</html> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<a href="https://github.com" rel="noopener" target="_blank">link</a> | |
</body> | |
</html> |
This file contains 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
package main | |
import ( | |
"fmt" | |
"strings" | |
"testing" | |
) | |
// Version A (traditional) |
This file contains 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
; 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 |
This file contains 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
; 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 |
This file contains 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
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) |
This file contains 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
; 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: |
This file contains 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
let a = 10 in | |
let rec f x = if x < 1 then 0 else x + (f (x - 1)) in | |
print_int (f a) |
This file contains 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
package lexer | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"github.com/rhysd/mincaml-parser/token" | |
"io" | |
"unicode" | |
"unicode/utf8" |
This file contains 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
pub fn insert(target: &mut String, index: usize, replaced: &str) { | |
for c in replaced.chars().rev() { | |
target.insert(index, c); | |
} | |
} |