RSSAmplifier

Blog

(untitled)

Ayaz Hafiz's website.

ayazhafiz.comRSS feed ↗10 posts

Latest posts

A Lambda Calculus With Coroutines and Heapless, Directly-Called Closures

co_lc is a lambda calculus extended with stackful coroutines. An efficient implementation for the compilation and virtual machine execution of co_lc is presented. The implementation supports tail-call optimization and eliminates all indirect calls by defunctionalizing closures.

Simple Refinement of Anonymous Sum Types in Pattern Matches

I describe a simple, "zero-cost" system for adding flow-typing-like refinement of anonymous sum types to a language, with a model of compilation that supports unboxed, non-uniform representations. The system extends naturally to also support type expansion (the opposite of refinement) thanks to its reliance on unification.

Why Don't More Languages Offer Flow Typing?

A brief survey of where flow typing does and doesn't fit, and when it may play a role in other languages.

Emulating the Lambda Calculus in TypeScript's Type System

We show that the TypeScript type system can emulate the lambda calculus, thereby providing a proof that the type system is Turing-complete.

Type Inference for <em>Sound and Complete Flow Typing</em>

We design a type inference algorithm for the FT calculus of "Sound and Complete Flow Typing with Unions, Intersections, and Negations" (Pearce 2012), proving that it infers minimal types where they are expressible and infers all minimal user-typable types.

Strictly Annotated: A Pretty-Printer With Support for Annotations

We present an extension of Lindig's Strictly Prettier (2000) pretty-printer with support for harmoniously formatting a document and arbitrary annotations attached to its terms.

A Flying Tour of Kan Extensions

A half-hour, flying tour of Kan extensions with examples and applications in other mathematics.

Representability, Coproducts, and Reflective Subcategories

Write-ups of interesting problems from Riehl's Category Theory in Context, sections 4.5 and 4.6.

A Simple Language With Flow Typing

We discuss a simple language and type system that provides for flow typing with records and union types. We also present an extension that generalizes to near-arbitrary narrowing of types at the expense of greater runtime costs.

Hot Code Reloading, with libc or in the browser

A small framework for writing programs with support for hot code reloading. Discusses runtimes that execute machine code or JavaScript in the browser.