Skip to content

Instantly share code, notes, and snippets.

View samth's full-sized avatar

Sam Tobin-Hochstadt samth

View GitHub Profile
@samth
samth / mb-st.rkt
Created June 25, 2012 21:00
Trouble with state and module-begin
#lang racket/load
(module st racket
(define is-typed? (box #f))
(define type-env (box 0))
(provide is-typed? type-env))
(module mac racket
(require (for-syntax 'st))
(define-syntax (m stx)
#lang racket/load
(module st racket
(define state (box 0))
(provide state))
(module m1 racket
(define l (list #'l))
(provide l))
@samth
samth / rlnull.decompiled.rkt
Created July 12, 2012 14:55
strange timings
(begin
(module rlnull ....
(require (lib "racket/base.rkt")
(lib "typed/racket/base.rkt")
(for-syntax
(lib "syntax/location.rkt")
(lib "racket/base.rkt")
(lib "typed-racket/env/env-req.rkt")))
(begin
(begin-for-syntax (let () '#<void>))
@samth
samth / announce.md
Created July 19, 2012 20:54
RacketCon 2012

Plans for (second RacketCon)

We're planning on holding the second iteration of RacketCon at Northeastern in Boston this fall. This will be a one-day event, featuring both short talks and tutorials. To choose a date that works for the most people, we need your feedback. Here is a quick poll on which dates (all Saturdays) you would be interested in attending RacketCon.

The Agenda

This year, RacketCon will feature 3 2-hour tutorial sessions, as well as a series of short talks about development in and of Racket over the last year.

Potential tutorial sessions include:

#lang racket
#|
P1 Portable bitmap ASCII
P2 Portable graymap ASCII
P3 Portable pixmap ASCII
#lang racket/load
(module lang racket/base
(require (for-syntax racket/base))
(provide (rename-out [mb #%module-begin]) (except-out (all-from-out racket/base) #%module-begin))
(define-syntax (mb stx)
(syntax-case stx ()
[(_ rest ...)
(local-expand #'(#%plain-module-begin rest ...) 'module-begin null)])))
#lang racket/base
(require (for-syntax syntax/parse racket/base syntax/free-vars racket/syntax)
racket/place)
(define-syntax (open-place stx)
(syntax-parse stx
[(_ ch:id body:expr ...)
(define b #'(let () body ...))
(define/with-syntax b* (local-expand b 'expression null))
@samth
samth / any-c.rkt
Created August 24, 2012 11:51
Why any-wrap/c is needed
#lang racket/load
(module m1 typed/racket
(: f : Integer -> Integer)
(define (f x) (add1 x))
(define: g : Any f) ;; safe by subtyping
(provide g))
(module m2 racket
(require 'm1)
#lang racket/base
;; The Computer Language Benchmarks Game
;; http://shootout.alioth.debian.org/
;; contributed by Eli Barzilay
;; parallelized by Sam Tobin-Hochstadt
(require racket/require (for-syntax racket/base) racket/future
(filtered-in (lambda (n) (regexp-replace #rx"unsafe-" n ""))
racket/unsafe/ops)