Software Unscripted cover image

Defunctionalization in a Functional Language with Ayaz Hafiz

Software Unscripted

00:00

The Morific System for Closing Closures

In most languages, when you're closing over something or capturing it in a closure, you need some place to store the information of like what was captured. Now in a lot of languages, because that value can be sort of dynamic depending on the application that you're doing, this is an expensive problem. William Brandon pointed out that there's a system that you can use called de-functionalization for getting rid of these heap allocations and just pass your functions around. Because we're a monomorphizing compiler, we can make it so that however many different times you call the same function passing closures of different sized captures to it, we just generate a specialization for each of those functions that accepts that

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app