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
# Okasaki style Functional Red Black Tree | |
# https://www.cs.tufts.edu/comp/150FP/archive/chris-okasaki/redblack99.pdf | |
# | |
# leaves and root are black | |
# BST | |
# No red node has a red child | |
# Every path from the root to a leaf has the same number of black nodes | |
# | |
# Based off Tenderlove's ruby version: https://gist.github.com/tenderlove/c843996b39e50ea6eb129871f07e589d | |
# |
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
@[Link("tcl")] | |
lib LibTcl | |
type Tcl_FreeProc = Void* | |
fun Tcl_SetVar(interp : Tcl_Interp*, varName : LibC::Char*, newValue : LibC::Char*, flags : Int32) : LibC::Char* | |
fun Tcl_Eval(interp : Tcl_Interp*, script : LibC::Char*) : Int32 | |
fun Tcl_CreateInterp : Tcl_Interp* | |
fun Tcl_GetStringResult(interp : Tcl_Interp*) : LibC::Char* | |
fun Tcl_Init(interp : Tcl_Interp*) : Void | |
struct Tcl_Interp |
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
@[Link("tcl")] | |
lib LibTcl | |
type Tcl_FreeProc = Void* | |
fun Tcl_SetVar(interp : Tcl_Interp*, varName : LibC::Char*, newValue : LibC::Char*, flags : Int32) : LibC::Char* | |
fun Tcl_Eval(interp : Tcl_Interp*, script : LibC::Char*) : Int32 | |
fun Tcl_CreateInterp : Tcl_Interp* | |
struct Tcl_Interp | |
result : LibC::Char* | |
freeProc : Tcl_FreeProc |
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
Index: lang/crystal/Makefile | |
=================================================================== | |
RCS file: /cvs/ports/lang/crystal/Makefile,v | |
retrieving revision 1.8 | |
diff -u -p -u -r1.8 Makefile | |
--- lang/crystal/Makefile 7 Sep 2019 08:46:41 -0000 1.8 | |
+++ lang/crystal/Makefile 29 Jun 2020 15:30:24 -0000 | |
@@ -3,8 +3,9 @@ | |
# Hopefully ${CLANG_ARCHS} at some point. | |
ONLY_FOR_ARCHS= amd64 |
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
CC=/usr/bin/cc | |
CFLAGS= -I/opt/X11/include -L/opt/X11/lib -std=iso9899:1999 -m64 -O0 -g -fno-builtin \ | |
-pedantic -pedantic-errors \ | |
-march=k8 -mtune=k8 -mieee-fp -mhard-float \ | |
-fno-fast-math -malign-double \ | |
-mstackrealign -mno-mmx \ | |
CPPFLAGS=-D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE \ |
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
$ uname -a | |
OpenBSD home.wmoxam.com 6.7 GENERIC.MP#116 amd64 | |
$ crystal -v | |
Crystal 0.34.0 (2020-04-11) | |
LLVM: 8.0.1 | |
Default target: x86_64-unknown-openbsd6.7 |
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
home$ CXX=/usr/local/bin/clang++ gmake | |
Using /usr/bin/llvm-config [version=8.0.1] | |
/usr/local/bin/clang++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/include -O2 -pipe -fno-ret-protector -mno-retpoline -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -DNDEBUG -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS | |
cc -fPIC -c -o src/ext/sigfault.o src/ext/sigfault.c | |
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o | |
CRYSTAL_CONFIG_PATH="/home/wmoxam/projects/crystal/src" CRYSTAL_CONFIG_LIBRARY_PATH="" CRYSTAL_CONFIG_BUILD_COMMIT="5d135c22b" ./bin/crystal build -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib |
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
$ gmake deps | |
Using /usr/local/bin/llvm-config [version=5.0.0] | |
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o | |
$ CC=/usr/local/bin/clang-5.0 gmake | |
Using /usr/local/bin/llvm-config [version=5.0.0] | |
CRYSTAL_CONFIG_PATH=`pwd`/src ./bin/crystal build -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib | |
/usr/local/lib/libevent_core.so.1.1: warning: warning: random() may return deterministic values, is that what you want? | |
_main.o: In function `__crystal_personality': | |
main_module:(.text+0x2868): undefined reference to `_Unwind_GetRegionStart' | |
main_module:(.text+0x2873): undefined reference to `_Unwind_GetIP' |
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
grammar Parser { | |
rule TOP { I <love> <lang> } | |
token love { '♥' | love } | |
token lang { < Perl Rust Go Python Ruby > } | |
} | |
say Parser.parse: 'I ♥ Perl'; | |
# OUTPUT: 「I ♥ Perl」 love => 「♥」 lang => 「Perl」 | |
say Parser.parse: 'I love Rust'; |
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
require "motif" | |
app = Motif.new(ARGV, {title: "Hello"}) | |
button = Motif.create_element( | |
Motif::PushButton, | |
{ | |
label: "Push here to say hello" | |
}.to_h | |
) |
NewerOlder