Skip to content

Instantly share code, notes, and snippets.

View samth's full-sized avatar

Sam Tobin-Hochstadt samth

View GitHub Profile
[samth@huor:~/sw/pycket/pycket/test (master) plt] raco decomp -n 120 bubble.rkt
(begin
(module bubble ....
(require (lib "racket/main.rkt"))
(module configure-runtime ....
(require '#%kernel (lib "racket/runtime-config.rkt"))
(|_configure:p@(lib "racket/runtime-config.rkt")| '#f))
(define-values (_SIZE) '10000)
(define-values (_vec) (make-vector '10000))
(define-values

Sometimes people have a small job for a computer. To complete this small job, they write some simple directions for the computer. But if their directions are good, or other people want to do the same job, other people will want to use their directions too.

But if they didn't plan for lots of people to use their directions for the computer, they might be in trouble. The directions they wrote might be slow, or they might not work right for other people. They might have to make a whole new set of directions that works for everyone.

My job is to make it so you can write one set of directions, and keep using it the whole time. For this to work, you have to be able to change the directions to work better for everyone, or to run faster, or to use lots of computers at once. But changing the directions shouldn't mean that you need a whole new set of directions. Instead, you should just change part of the directions at a time. And even when you have changed part of the directions, but not all the other parts, all

@samth
samth / problems.md
Last active August 29, 2015 13:57
Reproducing reproduction.

Keybase proof

I hereby claim:

  • I am samth on github.
  • I am samth (https://keybase.io/samth) on keybase.
  • I have a public key whose fingerprint is 616B 3763 7903 2187 AD7B 98B8 AC95 CABB 56D0 1F08

To claim this, I am signing this object:

# deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424)]/ raring main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ftp.ussg.iu.edu/linux/ubuntu/ saucy main restricted
deb-src http://ftp.ussg.iu.edu/linux/ubuntu/ saucy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ftp.ussg.iu.edu/linux/ubuntu/ saucy-updates main restricted
#! /bin/sh
#|
exec racket -tm "$0" ${1+"$@"}
|#
#lang racket
(provide main)
;; accept the shortest sequence of LetterKeyEvents that match some = regular exp.
#lang racket
(module m1 racket
(require (for-syntax racket/pretty))
(define-syntax (modbeg stx)
(syntax-case stx ()
[(_ forms ...)
(let ()
(define expanded (local-expand #'(#%plain-module-begin forms ...) 'module-begin null))
(pretty-print (syntax->datum expanded))
#lang typed/racket
(require syntax/parse/define)
(define-simple-macro (for/flsum x ... (c ...) b ... e)
(for/fold x ... ([s 0.0]) (c ...) b ... (+ s e)))
(time (for/flsum : Float ([i : Positive-Fixnum (in-range 1 100000001)]) (/ 1.0 i)))
#lang racket
(putenv "PLT_TR_CONTRACTS" "1")
(define ns (make-base-namespace))
(current-namespace ns)
(dynamic-require 'racket 0)
(use-compiled-file-paths null)
@samth
samth / weird.rkt
Last active August 29, 2015 14:01
#lang racket
(module evaluator racket
;; Allow evaluation at phase1
(require (for-syntax racket/base syntax/parse))
(provide phase1-phase0-eval phase1-phase0-run)
(define-namespace-anchor anchor)
(define namespace (namespace-anchor->empty-namespace anchor))