Skip to content

Instantly share code, notes, and snippets.

Avatar
🦁
Statusing

Sam Tobin-Hochstadt samth

🦁
Statusing
View GitHub Profile
View b.rkt
#lang racket
(define (convert.1 n)
(define pling (divides? 3 n))
(define plang (divides? 5 n))
(define plong (divides? 7 n))
(if (or pling plang plong)
(string-append (if pling "Pling" "")
(if plang "Plang" "")
(if plong "Plong" ""))
View racket-raytracer.rkt
#lang racket/base
;;; Copyright © 2020 Jakob L. Kreuze <zerodaysfordays@sdf.org>
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
View small_step.py
def step(expr):
(E,redex) = find_redex(expr)
if isinstance(redex, App):
if redex.op == "call/cc":
v = redex.arg
# E[(call/cc v)] -> E[(v (lambda (w) (abort E[w])))]
return plug(E, App(v, Lam("w", App("abort", plug(E, "w")))))
View gist:46dd2a719a5818da6591058de30e8e23
--- old.s 2020-04-21 11:07:00.527082284 -0400
+++ new.s 2020-04-21 11:06:43.331026298 -0400
@@ -1,71 +1,71 @@
+#if defined(__thumb__)
+#define RETURN(x) bx x
+#else
+#define RETURN(x) mov pc, x
+#endif
+
+ .align 3
View test.perf
racketcs 21845/21845 5184070.732380: 1 cycles:u:
7fc3fee4a100 [unknown] (/usr/lib/x86_64-linux-gnu/ld-2.30.so)
racketcs 21845/21845 5184070.732386: 1 cycles:u:
7fc3fee4a100 [unknown] (/usr/lib/x86_64-linux-gnu/ld-2.30.so)
racketcs 21845/21845 5184070.732390: 23 cycles:u:
7fc3fee4a100 [unknown] (/usr/lib/x86_64-linux-gnu/ld-2.30.so)
racketcs 21845/21845 5184070.732394: 746 cycles:u:
View fltester.rkt
#lang racket
(require math/bigfloat racket/flonum
math/private/flonum/flonum-functions
math/private/utils/flonum-tests
math/private/flonum/flonum-bits
math/private/flonum/flonum-constants)
(define-namespace-anchor ns)
View transcript
[samth@huor:~/.../math-test/math/tests (master) plt] cat x.c
/* pow example */
#include <stdio.h> /* printf */
#include <math.h> /* pow */
int main (int argc, char** argv)
{
double d = 1.4916681462400412e-154;
double x = -1.0;
if (argc > 5) {
View x.s
.file "x.c"
.text
.section .rodata
.LC2:
.string "test = %20.20g\n"
.text
.globl main
.type main, @function
main:
.LFB0:
View bad-future.rkt
#lang racket/base
(require racket/future racket/flonum)
(let ((f0
(future
(λ ()
(let ((i 1))
(unless (zero? i)
(if (fl<
(apply
fl-
View bad-future.rkt
#lang racket/base
(require racket/future racket/flonum)
(let ((f0
(future
(λ ()
(let loop ((i 1))
(unless (zero? i)
(if (fl<
(apply
fl-
You can’t perform that action at this time.