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
module _ | |
type Vec has { | |
x float | |
y float | |
z float | |
} | |
fn main() { | |
var positions [int: Vec] |
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
module _ | |
# test: pass | |
# expect: pass with 5 | |
# expect: pass with 6 | |
def main() | |
x := 5 | |
foo := def (y int) | |
print("pass with " + (x + y)) |
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
global | |
type OwningBuffer C has | |
let raw *C | |
let length uint | |
def __finalize__(owning_buffer OwningBuffer any) | |
posix.free(owning_buffer.raw) |
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 logging | |
from contextlib import contextmanager | |
from Queue import Queue | |
from threading import Thread | |
class ThreadStop(Exception): | |
pass | |
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
javascript:if (1) { | |
var node = document.createElement('style'); | |
node.innerHTML = "body { font-family: Georgia; width: 35em; line-height:1.5; margin-left: auto; margin-right: auto; } p { margin-top: 1em; }"; | |
document.head.appendChild(node); | |
} |
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
module tee | |
get sys | |
get file | |
def main() | |
if len(sys.args) == 2 | |
newline := "\n" | |
f := file.open(sys.args[1], "w") | |
state := f.state |
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
module _ | |
def gimme_bool() bool | |
return true | |
def main() | |
static_print(7) | |
static_print("hello") | |
static_print(gimme_bool()) | |
static_print(gimme_bool() ? "foo" : 4.5) |
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
# Run this after your AMI comes online | |
private_hostname=ip-$(curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null | sed s/\\./-/g) | |
sudo su - -c "grep $private_hostname /etc/hosts || echo 127.0.0.1 $private_hostname >> /etc/hosts" |
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
module _ | |
# test: pass | |
type C{T} is | |
Ax(T, int, float) or | |
Bx(int, T, float) or | |
Cx(int, float, T) | |
def main() | |
a_int := Ax(4, 5, 2.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
#!/usr/bin/python | |
# coding=utf8 | |
""" | |
Lambda Calculus with Unification for Algebraic Data Types with Macros. | |
Copyright (c) 2016 William Bradley | |
The MIT License | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to |