785 karma · joined Jan 15, 2011 (15y ago) · 257 submissions
comment 9y ago · link · parent
comment 9y ago · link · parent
The reality is that WASM has to target the existing JavaScript backends in every popular browser. And now you can't use LLVM, because the backends in question typically only handle reducible control flow, etc. Conversion from LLVM to a form that your JavaScript backend supports is relatively expensive and not something you want to do on every load.
comment 9y ago · link · parent
So honestly I think that this is a great exam. The only problem I see is that 5 hours of exam work in a single day is a bit much, even with a one hour break in the middle. It's probably a logistical problem though, with many prospective students being in town just to take this exam...
comment 9y ago · link · parent
Though at the moment the semantics isn't entirely clear to me. For instance, in the protocol example, shouldn't the pair be using multiplicative linear conjunction? It doesn't matter so much for a function receiving two Ints, but what's the semantics for a function receiving multiple ressources?
I guess you can use an impredicative encoding, e.g.
A ⊗ B = forall C. (A ⊸ B ⊸ C) ⊸ C
but isn't it more usable if it's built into the compiler?comment 9y ago · link · parent
On the other hand, I just read the advertisement for ReMarkable and made a note to buy one when it comes out... A genuinely good E Ink tablet is something I've wanted for a long time now.
comment 9y ago · link · parent
In any case, I'm looking forward to the more in depth post. :)
comment 9y ago · link · parent
And (afaik) you need a Mahlo cardinal for every type theoretic universe that is closed under induction-recursion. My point is that induction-recursion is a very intuitive notion from a computational perspective, yet its encoding in set theory is anything but intuitive...
comment 9y ago · link · parent
As for computability being a physical notion, I can't speak to the motivation of Church and his students, but I do know that there are characterizations of total computable functions in domain theory which make no mention of physics. The intuition about computable functions is that they are precisely the functions whose output for any given input depends only on a finite part of the input. The really interesting thing about the Church Turing thesis is that there are so many different models of computation that capture precisely this idea (the surprising part is that these very simple models are expressive enough to cover all computable functions).
comment 9y ago · link · parent
Hopefully this will lead to many more simplifications in the future.
Does anyone know which optimizations finally catapulted Ignition+Turbofan ahead of FullCodeGen+Crankshaft in terms of performance?
comment 9y ago · link · parent
My opinion is still that ZFC itself is unnatural as a foundation for mathematics, precisely because we have to do so much encoding to get anything useful out of it. And whenever you iterate "large" encodings you leave the universe of "ordinary ZFC". Conway suggested - and this is realized in modern type theory - that we should instead allow arbitrary "free" constructions, such as his surreal numbers, to extend the basic universe of mathematics. To some extend this can be encoded in set theory, but only with ridiculously large (Mahlo) cardinals.
This is not a direction that Friedman considers worthwhile, because he thinks that first-order logic and ZFC are inevitable. It's a shame that so many people on the FOM mailing list share the same view. There are good reasons why you don't find a lot of category theorists on that list anymore...
comment 9y ago · link · parent
comment 9y ago · link · parent
I'm going to ignore the social component... that said, we work in a wonderful profession where the world is changing completely every decade and many design decisions from the previous generation make no sense anymore. The business case for developing your application in COBOL rather than Common Lisp may have been sound 20 years ago, but today many of the reason why you didn't choose lisp are invalid (e.g., garbage collection takes milliseconds rather than seconds).
Note that this is not the case in more mature fields such as construction.
comment 9y ago · link · parent
In practice I would expect, say, a gaussian filter to be both easier to approximate and less prone to aliasing artifacts. Apparently that expectation is completely wrong though, since nobody seems to implement it that way! What's so special about vector graphics that makes the box filter behave well?
comment 9y ago · link · parent
On the other hand, automating all of programming is a pipe dream. If you could do that, you could also automate mathematics and by extension most of the sciences...
comment 9y ago · link · parent
Typical JavaScript VMs have a lot of fast paths for small scripts which also benefits small benchmarks like this. For more realistic workloads, parsing and compiling takes a significant amount of time and you could skip (almost) all of it by precompiling to WebAssembly (not at the moment, since you can't generate JavaScript objects from WebAssembly yet, but that'll happen eventually).
JavaScript in particular also has the problem that its semantics is an utterly horrifying mess... This forces the generated code to be very conservative and include a lot of dynamic checks and escape hatches to the interpreter. If anything, the situation is worse than with Lua, and let me remind you that LuaJIT doesn't actually compile said "escape hatches" because of code size. There are just that many of them.
comment 9y ago · link · parent
Logically, we are not finding better and better approximations to some mathematical laws of nature, but rather making a series of arbitrary choices (you can assert the truth or falsity of any independent statement). Philosophically, we can argue about the sense in which the continuum hypothesis ought to be true or false (that is what Gödel did), but practically it makes more sense to think of logic as a tool that you build to describe and solve specific problems.
comment 9y ago · link · parent
As for the axiom of choice, the real problem is trying to claim that it is right or wrong in the first place. Mathematics as a whole has never quite recovered from the failure of Hilbert's program... The bottom line is that there is no complete and consistent notion of "truth". There is no objective mathematical reality, because it cannot include a statements about its own consistency (and it's easy to translate this into "statements about certain hard problems", by exactly the same process we use to show that some problems are NP complete by reduction from another NP complete problem).
On the other hand, this is not actually detrimental to mathematical practice. It only means that you have a lot more freedom in modeling your problem domain. For instance, it turns out that set theory with the axiom of choice is a horrible place to do probability theory in (non-measurable sets and functions are a direct consequence, and you have to go to a lot of trouble to exclude them everywhere). If ZFC was part of some objective mathematical reality, then this would in some sense be unavoidable, since ultimately you want to make statements describing reality. On the other hand, once we realize that this assumption is just plainly false, we can start looking for more refined models.
comment 9y ago · link · parent
What I can say is that these days the Curry-Howard correspondence is typically taken to state that "Propositions are Types". And for typed languages, the difference between intrinsic types (Church style) and types as properties of programs (Curry style) are just two extremes on a very fluid spectrum.
You are absolutely right that this realizability interpretation as stated doesn't really help you define a complete notion of truth, since it doesn't solve the (unsolvable) problem of telling which proposition a program realizes. This is one of the reasons why Brouwer was so opposed to basing everything in mathematics on a system of inference rules. Without "intuition" about whether a particular program realizes a proposition you cannot really get off the ground.
comment 9y ago · link · parent
p |= A /\ B: if p evaluates to a pair of a proof of A and a proof of B.
p |= A -> B: if p implements a total function mapping proofs of A into proofs of B.
p |= exists n, A: if p evaluates to a pair of a number k and a proof of the statement A where n is replaced by k.
This is, for instance, implemented in NuPRL. It validates all laws of intuitionistic logic, but is also open ended. You can always add new axioms, so long as you can implement a realizer for them. E.g. if P is a boolean predicate on natural numbers, the statement "(~forall n, ~P n) -> exists n, P n" is true, since we can realize it using linear search, which terminates because of the assumption on P. Similarly, we have a realizer for the statement that "all function on real numbers are continuous", so what you get here is truly distinct from classical logic.
Of course, realizability has the problem that it already presupposes that you know how to show properties of arbitrary programs! On the other hand, if you have a proof for a positive statement you can always check the truth of special instances by running a program and looking at the results.
Anyway, to get back to your question. Under this interpretation, you can implement a proof on a metabolic network, in the same way as you can implement it using sticks and stones. Whether or not that has anything to do with the "Curry-Howard" correspondence is another question, though.
comment 9y ago · link · parent
comment 9y ago · link · parent
If you compile exception handling to separate return addresses this becomes rather obvious. In this case your control flow also stays reducible, which is commonly taken to mean "simple to reason about", and is very different from the kind of control flow that you can introduce using goto statements.
I think the main problems with exception handling are cultural and psychological. Culturally we don't insist on proper documentation for exceptions. At best you'll see documentation for the functions throwing exceptions directly, but almost never for the functions using them a few levels up the stack... The situation is even worse with higher order functions for which people almost never document the exception behavior. Psychologically most people seem to ignore all but the most obvious exceptional cases. We really have to force ourselves to notice everything that could go wrong and to take a step back and rethink our designs if this question doesn't have a simple answer...
comment 9y ago · link · parent
One example are all the consequences of the Robertson-Seymour theorem which (non-constructively) asserts that a large number of graph problems "is in P". For instance, we know that testing whether a graph can be embedded in the torus is in P, but the algorithm in question is completely infeasible.
I would expect a positive answer to P = NP to be completely useless in practice. A negative answer would similarly be rather unexiting by itself. What would be exiting are the tools for getting this answer...
comment 9y ago · link · parent
All of these things may change in the future (apart from the reducible control flow restriction), but, at the moment, the goal of WebAssembly is just to have a viable compilation target for C++ in the browser. Google was championing LLVM IR for this purpose in the form of pnacl, but that was not enough of a compromise to work on the web platform. :(
comment 9y ago · link · parent
- CakeML is written in HOL4, which is using ML.
- SML, unlike Ocaml has a well-defined semantics and so there is a good starting point for a verified compiler.
Second, regarding Ocaml, the easiest reason for choosing Ocaml over ML is because there is only one implementation of the language that everybody is using. This makes it a lot more likely that the ocaml compiler will still be around a few decades from now. There are several modern ML compilers, most of which are more or less unmaintained. PolyML, which everybody seems to be using these days, is substantially developed by a single person.
comment 9y ago · link · parent
But, as you mentioned the constant factors involved are ridiculously high and this is not going to give you a practical solution.