Skip to content

Instantly share code, notes, and snippets.

View waywardmonkeys's full-sized avatar

Bruce Mitchener waywardmonkeys

View GitHub Profile
@waywardmonkeys
waywardmonkeys / Makefile
Last active August 29, 2015 13:56
Embedding Dylan - An example of calling Dylan from C
all: build
.PHONY: build test
LIB_SOURCES = $(wildcard *.dylan) \
embed-dylan.lid
build: $(LIB_SOURCES)
mkdir -p _build/bin
dylan-compiler -build embed-dylan.lid
@waywardmonkeys
waywardmonkeys / design-notes.dylan
Last active August 29, 2015 13:55
Design notes for type-safe and easier Objective C / Dylan bridging
// An instance of an Objective C object gets wrapped:
define abstract class <objc/instance> (<object>)
constant slot raw-instance :: <machine-word>,
required-init-keyword: instance:;
constant each-subclass slot instance-objc-class :: <objc/class>;
end;
// However, we want them to be type safe and we want to
// to be able to dispatch on their arguments, so we will
D Kalloc_testVobjc_test_suiteI () {
D c_;
D s_;
D T3;
DWORD T4;
DWORD T5;
DWORD T6;
D o_;
D T8_0;
D T9;
@waywardmonkeys
waywardmonkeys / dynamic-class.dylan
Created September 13, 2013 10:43
Testing out creating classes with slots at runtime
Module: dynamic-class
Synopsis: Testing out creating classes with slots at runtime
Author: Bruce Mitchener
Copyright:
define function main (name :: <string>, arguments :: <vector>)
let foo-gf = make(<generic-function>, required: 1, debug-name: "foo");
let bar-gf = make(<generic-function>, required: 1, debug-name: "bar");
let slots = vector(vector(allocation: #"instance",
getter: foo-gf,
module: calvino-glfw3-test-suite
synopsis: Test suite for the calvino-glfw3 library.
define suite calvino-glfw3-test-suite ()
test basics;
end suite;
define test basics ()
glfwInit();
glfwWindowHint($GLFW-VISIBLE, 1);
@waywardmonkeys
waywardmonkeys / awk.pass.cpp
Last active December 14, 2015 13:59
Causes the emscripten relooper to crash (previously caused stack range errors).
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <regex>
@waywardmonkeys
waywardmonkeys / atomic_flag_clear.pass.cpp
Created February 26, 2013 18:24
emscripten bug with volatile atomic ops.
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <atomic>
@waywardmonkeys
waywardmonkeys / includes.pass.cpp
Created February 26, 2013 09:48
Test case for possible emscripten compiler bug
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <algorithm>
@waywardmonkeys
waywardmonkeys / bad_tls.s
Created August 24, 2012 02:25
TLS comparison
_KemptyQVKdMM2I:
00000000 pushl %ebp
00000001 movl %esp,%ebp
00000003 pushl %edi
00000004 pushl %esi
00000005 subl $0x10,%esp
00000008 calll 0x0000000d
0000000d popl %edi
0000000e calll _get_teb
00000013 movl 0x15273-0xd(%edi),%ecx
@waywardmonkeys
waywardmonkeys / project_manager.rst
Created November 19, 2011 17:09
Rethinking the OD project manager

Rethinking the Project Manager

Problem

The current project manager as a variety of problems that we would like to solve. These include:

  • It combines install with build. Everything is built and installed