Live data from Hacker News

Seemingly impossible functional programs (2007)

math.andrej.com

21–30 of 46 posts

Re: Seemingly impossible functional programs (2007)

#21

> The Maybe type constructor is predefined by Haskell as [...] It's hard for me to imagine a reader that understands the rest of this jargon, presented without explanation, who does not know what `Maybe` is.

Probably targeted at people who use other ML family languages (although this isn't a large crowd).

Re: Seemingly impossible functional programs (2007)

#22
post #13

I found this post and the code and math so fascinating it changed my life when I found it three years ago. I did not previously understand the capability of computers to work with the abstract logic of infinite sets in a meaningful way and it led me into the world of formalization of mathematics in the dependently typed programming language Agda, which is one of the current activities of the mathematician (Martin Esc…

Can you mention some downstream effects such that your life was changed?

I made the study of mathematical logic and the connections between set theory and type theory and formalization in Agda my full-time focus. Increasing physical disability ended my career as a performing musician a few years ago and I had a life-long interest in philosophical topics connected with infinity. In the past two years I've written over 100,000 lines of Agda code as a product of my learning and research. I'd like to figure out a type-theoretical translation of the set-theoretic large cardinal axioms at the level of measurable and beyond.

Re: Seemingly impossible functional programs (2007)

#23
post #13

Earlier quoted context omitted.

Can you mention some downstream effects such that your life was changed?

I think they just mean that they wouldn't necessarily have heard about or got into Agda otherwise.

Now read their answer :)

Re: Seemingly impossible functional programs (2007)

#24
post #6

Earlier quoted context omitted.

Are we already calling it 'Meta' unironically?

Supercompilation has also been known as metacompilation for decades.

In this case by Meta I think they mean Facebook. Name change today in case you missed thar.

Re: Seemingly impossible functional programs (2007)

#25
post #8

The first thing to note that, given a deterministic program that computes a boolean given an infinite bit string will either run in O(1) time for all inputs or will have an input where it doesn't halt. Thus if you assume that the function is total and thus doesn't halt, it must run in O(1) time. To find an infinite input bit string where the function halts, we can just record which k = O(1) bits the function is query…

How is not halting O(1)? Wouldn't that be O(∞)?

Re: Seemingly impossible functional programs (2007)

#26
post #9

Can someone explain to me in plain English what this is? I looked up Cantor Sets so I have a vague understanding... but there are many things I don't understand. Like what does it mean to have a sequence with a bit appended to a Cantor Set? Why is that a Cantor Set? What the heck is a total p - is it a function?

Cantor space is just the space formed by infinite binary sequences, that is sequences which assumes only the values 0 or 1. Considered as a topological space, Cantor space happens to have the same structure as the Cantor set, a highly disconnected subset of the real numbers that has some at-first-unintuitive properties. But you don't have to understand, or even worry about this correspondence to grasp what's going on…

> Considered as a topological space, Cantor space happens to have the same structure as the Cantor set […]

And this is, intuitively, because every element of the (standard) Cantor set can be expressed as a trinary number in the range [0, 1) where every digit is either 0 or 2 (because at every level the middle third is excluded in the construction of the set). That is, a string of exactly two symbols – that is, a bitstring.

Re: Seemingly impossible functional programs (2007)

#27
post #6
post #5

Earlier quoted context omitted.

One of the authors of this work apparently now works on supercompilers at Meta and open sourced some nice tools for equivalence checking based on graph rewriting [1] and constructive type theory [2]. If you're interested in that kind of thing I would recommend checking out his work: [1]: https://github.com/ilya-klyuchnikov/mrsc [2]: https://github.com/ilya-klyuchnikov/ttlite

Are we already calling it 'Meta' unironically?

Whom? Metaface?

Re: Seemingly impossible functional programs (2007)

#29
post #8

The first thing to note that, given a deterministic program that computes a boolean given an infinite bit string will either run in O(1) time for all inputs or will have an input where it doesn't halt. Thus if you assume that the function is total and thus doesn't halt, it must run in O(1) time. To find an infinite input bit string where the function halts, we can just record which k = O(1) bits the function is query…

How is not halting O(1)? Wouldn't that be O(∞)?

I think they meant

> Thus if you assume that the function is total and thus does halt, it must run in O(1) time.

Since that's what total means.

Post reply on HN