Skip to content

Instantly share code, notes, and snippets.

View frenchy64's full-sized avatar

Ambrose Bonnaire-Sergeant frenchy64

  • Madison, Wisconsin
View GitHub Profile
@frenchy64
frenchy64 / schema.md
Last active August 16, 2022 19:04
Schema generative testing

(This is a really long answer to feedback on plumatic/schema#445)

Sorry, I don't understand from here down.

My bad, there's a ton of implicit decisions and I'm only explaining the tiny details :) I'll try writing this again.

Are you basing this design off an existing language or library that I can read about to get a better understanding?

This is a combination of several ideas and tradeoffs.

@frenchy64
frenchy64 / macrovich-case.md
Last active February 22, 2022 02:45
Macrovich case explanation
typed.clj.refactor=> (refactor-form-string "+" {})
"clojure.core/+"
typed.clj.refactor=> (refactor-form-string "(defn foo [a] (+ a 3))" {})
"(clojure.core/defn foo [a__#0] (clojure.core/+ a__#0 3))"
typed.clj.refactor=> (refactor-form-string "(defmacro foo [a] `(+ ~a 3))" {})
"(clojure.core/defmacro foo [a__#0] `(+ ~a__#0 3))"
@frenchy64
frenchy64 / hidden.md
Last active July 21, 2019 01:17
Venue: Keynote for Compose :: Melbourne, September 2nd 2019 (http://www.composeconference.org/)

The Hidden Data Flow in Types

On the surface, function types simply describe inputs and outputs—indeed, that's how they're used in most type systems. But there's more to function types!

Fascinatingly, a function type can be transformed into a data flow graph that predicts the inner workings of any function that has that type. Using this graph, intricate dependencies between function inputs and outputs can be inferred

@frenchy64
frenchy64 / README.md
Last active July 11, 2019 04:41
RFC: Animation for cljfx

RFC: Animation for cljfx

This is an initial attempt at supporting animations in cljfx. Running instructions are below.

The actual animation logic is here under the Demo comment.

The original code is here.

Running

@frenchy64
frenchy64 / notes.md
Last active July 8, 2019 18:05
Notes on JavaScript prototypes

Why Objects were successful

https://www.cs.cmu.edu/~charlie/courses/15-214/2014-fall/slides/25-history-oo.pdf

  • essense of objects is (dynamic) dispatch
  • dispatch provides interoperability
  • first-class interoperability is critical to frameworks and ecosystems
  • frameworks and ecosystems are economically critical to the software industry
  • likely a significant factor in objects' success
  • Also talks about early mistakes in Simula

Why objects are inevitable

@frenchy64
frenchy64 / Io Example Problems
Created June 25, 2019 18:23 — forked from jezen/Io Example Problems
The example problems have gone missing from the Io language website, so here’s a backup.
#Sample code
#Hello world
"Hello world!" print
#Factorial
factorial := method(n, if(n == 1, 1, n * factorial(n - 1)))
99 bottles of beer
(ns colored-lti-clj.core)
(defalias List
(TFn [a]
'{:match (All [b] [(ListVisitor a b) :-> b])}))
(defalias ListVisitor
(TFn [a b]
'{:caseNil (All [:-> b])
:caseCons (All [a (List a) :-> b])}))
@frenchy64
frenchy64 / compiler.clj
Created April 18, 2018 21:57
cljs.compiler generated specs (core.typed 0.5.1)
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
(ns cljs.compiler
#?(:clj (:refer-clojure :exclude [munge macroexpand-1 ensure])
@frenchy64
frenchy64 / compiler.clj
Created April 18, 2018 21:53
cljs.compiler generated types (core.typed 0.5.1)
; Copyright (c) Rich Hickey. All rights reserved.
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this license.
; You must not remove this notice, or any other, from this software.
(ns cljs.compiler
#?(:clj (:refer-clojure :exclude [munge macroexpand-1 ensure])