This file contains hidden or 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
Compiler design | |
Compilers | |
https://github.com/snazzy-d/SDC | |
https://github.com/dbohdan/embedded-scripting-languages | |
https://github.com/ishiura-compiler/CF3 | |
https://gitlab.com/styx-lang/styx | |
http://mlton.org/CompilerOverview | |
https://github.com/TurkeyMan/mlang | |
https://github.com/FeepingCreature/fcc | |
https://github.com/jondgoodwin/cone |
This file contains hidden or 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
// vox fannkuch.vx C:\Windows\System32\kernel32.dll | |
// https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/fannkuchredux.html | |
void main() { | |
i32 n = 12; | |
Result res = fannkuch(n); | |
println("fannkuch(", n, ") = ", res.sum, " ", res.maxflips); | |
ExitProcess(0); | |
} |
This file contains hidden or 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
import std; | |
struct Node | |
{ | |
int value; | |
Node* next; | |
} | |
Node* reverseList(Node* head) | |
{ |
This file contains hidden or 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
intervals formatInt | |
p 0 rax [rax]: [40; 41) [86; 88) [108; 112) | |
p 1 rcx [rcx]: [1; 2) [30; 41) | |
p 2 rdx [rdx]: [1; 4) [32; 41) [84; 90) [106; 110) | |
p 4 rsp [rsp]: [36; 44) | |
p 8 r8 [r8]: [1; 6) [34; 41) | |
p 9 r9 [r9]: [1; 8) [36; 41) | |
p 10 r10 [r10]: [40; 41) | |
p 11 r11 [r11]: [40; 41) |
This file contains hidden or 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
void tran_thong(i32 xstart, i32 ystart, i32 xend, i32 yend, void function(void*, i32, i32) callback, void* userData) | |
{ | |
i32 x = xstart; | |
i32 y = ystart; | |
i32 deltax; | |
i32 signdx; | |
if (xend >= xstart) { | |
deltax = xend - xstart; | |
signdx = 1; |
This file contains hidden or 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
--- <cli_args> | |
main.d sdl.d sdlimage.d kernel32.d C:\Windows\System32\kernel32.dll SDL2.dll SDL2_image.dll | |
--- main.d | |
import sdl; | |
import sdlimage; | |
import kernel32; | |
enum scale = 2; | |
enum map_width = 10; | |
enum map_height = 10; |
This file contains hidden or 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
15 100 1к 10к 100к 1М 10M | |
TCC 0.9.27 8.5 8.6 8.7 12 48 426 8749 | |
tiny_jit 19 20 21 30 135 1172 11600 | |
MSVC 2017 82 82 90 114 503 45000 2116000 | |
DMD 2.083 94 95 98 141 594 5510 OOM | |
Clang 7.0.1 107 109 123 290 2000 18500 183000 | |
Go 1.12.4 156 154 171 349 1921 18096 318963 | |
Rust 1.34.1 165 169 197 516 3896 39260 852222 | |
GCC 8.3.0 196 199 241 682 5718 199000 26920000 | |
GCC 4.8.3 125 130 178 665 6420 269000 ICE |
This file contains hidden or 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
import std.array : empty; | |
import std.string : format; | |
import std.typecons : Flag, Yes, No; | |
import std.stdio : writeln, write, writef, writefln, stdout; | |
import std.format : formattedWrite, FormatSpec; | |
import std.range : repeat; | |
import std.range : chain; | |
import std.bitmanip : bitfields; | |
import std.algorithm : min, max, sort, swap; | |
import std.stdio; |
This file contains hidden or 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
#!/bin/bash | |
num_steps=100 | |
tasks_per_man=10 | |
let num_managers=$num_steps/$tasks_per_man | |
int_from=-100 | |
int_to=100 | |
awk -v xmin="$int_from" -v xmax="$int_to" -v num_steps="$num_steps" 'BEGIN {dx=(xmax-xmin)/num_steps; for (i = xmin; i < xmax; i+=dx) print i" "i+dx }' > ranges.txt | |
g++ integral.cxx -oexe | |
# res - results for individual tasks |
This file contains hidden or 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
// Source | |
i32 test(i32* array, i32 index) { | |
return array[index]; // read from array | |
} | |
// IR | |
function i32 $test () { | |
| @start:0 instr[0..6] | |
1| %0 = ptr o_param uses [ ptr %3] | |
2| %1 = i32 o_param uses [ i64 %2] |